Skip to content

Match 50 PAL resident functions - #93

Open
Sumaiter wants to merge 2 commits into
OpenRAC:mainfrom
Sumaiter:decomp/pal-large-batch-07
Open

Sumaiter wants to merge 2 commits into
OpenRAC:mainfrom
Sumaiter:decomp/pal-large-batch-07

Conversation

@Sumaiter

@Sumaiter Sumaiter commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Adds matching C implementations for 50 previously undecompiled PAL resident functions (9,036 bytes). Two reconstructions used public engine-family interface references. Immutable repositories, commits, source files and functions are credited in config/pal/crossgame_sources.tsv and the source comments.

The batch covers state transitions, initialization and cleanup, menu callbacks, resource dispatch, serialization helpers and small loops. Candidates were reconstructed from PAL retail assembly and pseudocode, with targeted RAC1/RAC3 interface references where useful. Three candidates (func_00460B68, func_004B38A0 and func_004AC610) were excluded because their semantically safe C forms did not reproduce the retail bytes.

Adds 50 PAL match rows and corresponding US other rows while preserving all existing entries and their order. PAL matched code increases from 497,616 to 506,652 bytes (8.560511% to 8.715958%), and matched functions from 6,032 to 6,082. The US progress report is unchanged. The branch includes the current origin/main; none of the 50 functions already has a match there.

Validation:

  • Rebuilt all 50 final translation units individually through the unchanged tools/cc.sh pipeline and compared them at their direct PAL catalogue addresses: 50/50 MATCH.
  • Independently resolved all 460 text relocation entries against PAL retail, including call targets, function pointers, HI16/LO16 addresses, GP-relative references and locally defined initializers.
  • Independent agents reviewed ABI, output initialization, object and array bounds, 64-bit values and C semantics. Review findings were corrected and the three unsafe candidates above were excluded.
  • Both versions' progress/source-map checks pass. Verified the exact PAL function/byte increase, unchanged US report, preservation of upstream map rows and matching source hashes after the merge.

This validation covers the added translation units and their matching metadata. No full repository rebuild, US disc audit, linked game build or runtime test was run. No compiler-pipeline changes, disc data, extracted binaries, assembly listings, toolchains or local build artifacts are included.

Sumaiter and others added 2 commits November 4, 2026 07:01
Co-Authored-By: Kimi Code <noreply@moonshot.cn>
…h-07

# Conflicts:
#	README.md
#	THIRD_PARTY_NOTICES.md
#	config/pal/crossgame_sources.tsv
#	config/pal/map.tsv
#	config/us/map.tsv
#	progress/pal/report.json
@bytematchdev

bytematchdev Bot commented Nov 4, 2026

Copy link
Copy Markdown

ByteMatch progress report

SCUS_974.65

Code matched 7.17% · 414.34 KB of 5.78 MB
Fuzzy match 7.73%
Functions 5,435 / 18,085
Units complete 2,839 / 2,899

No function changes.

SCES_532.85

Code matched 8.72% (+0.16%) · 506.65 KB of 5.81 MB
Fuzzy match 9.21% (+0.15%)
Functions 6,082 (+50) / 18,113
Units complete 3,320 (+50) / 3,379
✅ Newly matched (50)
  • func_00452DC0 (256 bytes)
  • func_00474260 (256 bytes)
  • func_0047F640 (256 bytes)
  • func_004B25E8 (244 bytes)
  • func_00540FA8 (244 bytes)
  • func_004CC6E8 (240 bytes)
  • func_004D7118 (240 bytes)
  • func_004A3988 (228 bytes)
  • func_004A91A0 (228 bytes)
  • func_0054BA08 (224 bytes)
  • func_00431190 (220 bytes)
  • func_0046B2A8 (216 bytes)
  • func_004EF188 (216 bytes)
  • func_004F5DA8 (216 bytes)
  • func_0049B9B0 (204 bytes)
  • func_004E8378 (204 bytes)
  • func_004CC218 (196 bytes)
  • func_0054A5A0 (196 bytes)
  • func_0045D258 (192 bytes)
  • func_0049C3C0 (192 bytes)
  • func_004B6A10 (192 bytes)
  • func_004CFC50 (192 bytes)
  • func_004D66D0 (192 bytes)
  • func_004E3078 (192 bytes)
  • func_0049A410 (184 bytes)
  • func_0043A660 (176 bytes)
  • func_00466078 (176 bytes)
  • func_004E31E8 (176 bytes)
  • func_004E8448 (176 bytes)
  • func_0046D0B0 (172 bytes)
  • …and 20 more
📉 Worse (1)
  • func_004898D0 88.46% → 0.00%

Commit 49c10da · Ratchet: Deadlocked on ByteMatch

@Sumaiter
Sumaiter marked this pull request as draft November 4, 2026 11:56
@Sumaiter
Sumaiter marked this pull request as ready for review November 4, 2026 15:53
This was referenced Nov 4, 2026
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