Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy of Kain: Soul Reaver function doesn't match with MASPSX #93

Closed
FedericoMilesi opened this issue Aug 7, 2024 · 4 comments
Closed

Comments

@FedericoMilesi
Copy link
Contributor

FedericoMilesi commented Aug 7, 2024

Hi,

Here's a function that has got two memcpy() calls:

https://decomp.me/scratch/cKvGg

Currently it is a 100% match using gcc 2.8.1 + aspsx 2.79 (CCPSX), but changing to the current Legacy of Kain: Soul Reaver preset which uses maspsx causes it to match 99.78% instead, due to a diff between memcpy() on the left and bcopy() on the right. Using the -fno-builtin flag doesn't quite solve this issue like in most cases for a reason I currently don't know, since the first memcpy() call in the function produces very mismatching results that way.

@FedericoMilesi FedericoMilesi changed the title Legacy of Kain: Soul Reaver doesn't match with MASPSX Legacy of Kain: Soul Reaver function doesn't match with MASPSX Aug 7, 2024
@mkst
Copy link
Owner

mkst commented Aug 7, 2024

This is not an maspsx issue, gcc is emitting the bcopy.

	lw	$4,4($18)
	lw	$6,0($18)
	.set	noreorder
	.set	nomacro
	jal	bcopy
	addu	$5,$16,40

Created decompals/old-gcc#23 and closing this.

@mkst mkst closed this as completed Aug 7, 2024
@mkst
Copy link
Owner

mkst commented Aug 9, 2024

@FedericoMilesi
Copy link
Contributor Author

Glad it works, could the game preset be updated to use gcc 2.8.1-psx + maspsx? That and -G65536 needs to be changed to -G4096 which is what I'm using in the Soul Reaverse project, currently.

@mkst
Copy link
Owner

mkst commented Aug 9, 2024

Done. Per api:

{
    "id": 17,
    "name": "Legacy of Kain: Soul Reaver",
    "platform": "ps1",
    "compiler": "gcc2.8.1-psx",
    "assembler_flags": "",
    "compiler_flags": "-O2 -G4096 -fpeephole -ffunction-cse -fkeep-static-consts -fpcc-struct-return -fcommon -fgnu-linker -msplit-addresses -mgas -mgpOPT -mgpopt -msoft-float -gcoff -Wa,--aspsx-version=2.81",
    "diff_flags": [],
    "decompiler_flags": "",
    "libraries": [],
    "num_scratches": 2883,
    "owner": null
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants