sly1 icon indicating copy to clipboard operation
sly1 copied to clipboard

Match functions, misc fixes, add script to check progress

Open 545u opened this issue 5 months ago • 4 comments

  • Put functions in the list of problematic functions in configure.py in alphabetical order based on name of the TU.
  • Fix small typo in scripts/readme.md.
  • Separate library sources from engine sources in src/readme.md.
  • Match some functions in various files.
  • Added fully matched RemoveZpdZapLo by @polybiusproxy that was based on a scratch by me. However there is a TU padding problem. I think the sce/libs TU should start at address 0xF69C4 instead of 0xF69C0 like it is now. Changing the address doesn't work because the 4 NOP bytes get added right after the function.
  • Added a script to locally check the project progress. Changed the checks.sh script to optionally output the progress report generated by objdiff to a new file.
  • Managed to identify quite a lot of .data segment starting addresses.
  • Merged split P2/UNKNOWN2 into P2/sw as it seemed to make the most sense.

545u avatar Oct 11 '25 23:10 545u

The reason it adds 4 bytes of padding when you change sce/libs to start at 0xF69C4 is because all TUs are aligned to 8 bytes, i.e. the TU offsets always have to end in 0 or 8. If you don't align it to an 8-byte boundary it will add padding to make it so.

TheOnlyZac avatar Oct 18 '25 01:10 TheOnlyZac

The reason it adds 4 bytes of padding when you change sce/libs to start at 0xF69C4 is because all TUs are aligned to 8 bytes, i.e. the TU offsets always have to end in 0 or 8. If you don't align it to an 8-byte boundary it will add padding to make it so.

Interesting. The last function in P2/zap cannot be taken out of the SKIP_ASM ifdef because it will overwrite the first bytes of sce/libs iirc. How should that be fixed?

545u avatar Oct 18 '25 01:10 545u

It sounds like the offset of sce/libs is incorrect. Can you just push the offset of sce/libs back so the zap function doesn't overlap?

TheOnlyZac avatar Oct 18 '25 01:10 TheOnlyZac

It sounds like the offset of sce/libs is incorrect. Can you just push the offset of sce/libs back so the zap function doesn't overlap?

I tried that already but sce/libs gets misaligned.

545u avatar Oct 18 '25 01:10 545u