Skip to content

Add PAL C for 15 PAL-only functions - #213

Open
chistianh wants to merge 4 commits into
OpenRAC:mainfrom
chistianh:pal-oficial-23
Open

chistianh wants to merge 4 commits into
OpenRAC:mainfrom
chistianh:pal-oficial-23

Conversation

@chistianh

@chistianh chistianh commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

DESCRIPTION (paste from the next line on): PAL (SCES_532.85) C for 15 PAL-only functions, reserved in #112.

Commits:

  • Add PAL C for 5 PAL-only resident functions: func_00439AA0, func_0046B380, func_004E1598, func_004FD588 and func_0054A068.
  • Add PAL C for 10 PAL-only overlay functions: the multiplayer menu's func_L00_004F5518, func_L00_004F5940, func_L00_0051F9B0, func_L00_005289A8, func_L00_0052C3E8, func_L00_0053CED8, func_L00_0074C608, func_L00_0076CA60 and the shared func_L00_00706ED8, and Dreadzone Station's func_L01_00510590.
  • Regenerate the maps and progress reports.
  • Regenerate the PAL catalogue from the proven extents: func_L00_0051F9B0, func_L00_005289A8 and func_L00_0052C3E8 end on a 0xCDCDCDCD fill word, so their catalogue rows now have the compiled sizes (148, 148 and 236 bytes) and the PAL report no longer counts the fill (12 bytes) as code.

Notes for review:

  • Five files have a cflags line. func_0054A068 uses -fno-thread-jumps (retail's loop exit still goes through the test after the loop) and func_L00_0076CA60 uses -fno-gcse (retail loads the high half of D_001721E0's address again in the later blocks); both are explained in a comment in the file. func_L00_0053CED8 uses @ee29 -O2 -G0, and func_L00_004F5518 and func_L00_004F5940 use @ee296 -O2 -G0, like the other multiplayer menu files built with those compilers.
  • func_L00_0051F9B0 passes all eight of its arguments on to its handlers: retail keeps arg0 in $t4 during the switch, and with fewer arguments the copy goes to $a2 instead.
  • No volatile, inline assembly, #define aliases, hardcoded addresses or permuter output.

Checks:

  • tools/audit_pal_relocs.py: 332 relocations checked in 15 exact PAL native functions, 0 mismatches, 0 unresolved.
  • A PAL-only run of the build_all.sh steps (build.sh, build_libgcc.sh, build_libm.sh, then the PAL map and report), with the isolated ee29-01, ee296 and ee32-040921 profiles hash-verified, completes without errors. The US steps were not run: I don't have the US dumps.
  • tools/match_map.py --update-native records all 15 as match on PAL; tools/progress.py --check and --version pal --check pass. The US map records the PAL sources as other, so the US report does not change.
  • The branch is based on main (7812248). None of the 15 functions is in an open pull request.

🤖 Generated with Claude Code

chistianh and others added 3 commits December 5, 2026 11:51
func_00439AA0, func_0046B380, func_004E1598, func_004FD588 and func_0054A068.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Multiplayer menu: func_L00_004F5518, func_L00_004F5940, func_L00_0051F9B0, func_L00_005289A8, func_L00_0052C3E8, func_L00_0053CED8, func_L00_0074C608, func_L00_0076CA60 and the shared func_L00_00706ED8; Dreadzone Station: func_L01_00510590.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bytematchdev

bytematchdev Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

ByteMatch progress report

SCES_532.85

Code matched 26.40% (+0.09%) · 1.53 MB of 5.80 MB
Fuzzy match 27.41% (+0.09%)
Functions 11,231 (+15) / 18,376
Units complete 5,681 (+5) / 5,739
✅ Newly matched (15)
  • func_L01_00510590 (720 bytes)
  • func_0054A068 (540 bytes)
  • func_L00_0076CA60 (524 bytes)
  • func_L00_0074C608 (520 bytes)
  • func_004E1598 (484 bytes)
  • func_0046B380 (444 bytes)
  • func_004FD588 (308 bytes)
  • func_L00_0052C3E8 (236 bytes)
  • func_L00_00706ED8 (216 bytes)
  • func_00439AA0 (208 bytes)
  • func_L00_0053CED8 (176 bytes)
  • func_L00_004F5518 (160 bytes)
  • func_L00_0051F9B0 (148 bytes)
  • func_L00_005289A8 (148 bytes)
  • func_L00_004F5940 (140 bytes)

SCUS_974.65

Code matched 21.67% · 1.25 MB of 5.78 MB
Fuzzy match 22.85%
Functions 10,087 / 18,172
Units complete 5,548 / 5,607

No function changes.

Commit 2c92a11 · Ratchet: Deadlocked on ByteMatch

func_L00_0051F9B0, func_L00_005289A8 and func_L00_0052C3E8 end on a
0xCDCDCDCD fill word after their final jump and delay slot. The PAL map
already records their compiled extents (148, 148 and 236 bytes), so the
catalogue rows are regenerated from them (tools/level_catalogue.py) and
the PAL report no longer counts the fill as code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant