Repository navigation
Conversation
Each of these functions was already matched on PAL in src/pal/ and has a US twin with the same code: the same size and the same tools/inventory.py fingerprint (address fields masked). The PAL source was taken over with every func_/D_ address rewritten to the US one, from a PAL -> US map built by lining the two functions' instructions up (jal targets, $gp offsets and lui-built addresses). A source address with no counterpart in that map was not guessed: those functions were left out. 1 lands in src/core/, 197 in src/game/. The C itself is the work of the authors of the src/pal/ files. Left out: seven ports whose PAL sources credit cross-game reference code (config/pal/crossgame_sources.tsv), until their US credits are set up; the functions in open PRs, OpenRAC#94 included. Eleven near misses they replace are removed from nonmatching/ with their README rows. Maps and reports regenerated for both versions without the local libm objects, as the committed maps are; unrelated rows whose score differed in this environment are left as committed. US: 5435 -> 5633 matched functions (+27,992 bytes); PAL: 6032 -> 6039. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds US sources for 198 NTSC-U functions that were already matched on PAL in
src/pal/but had no US source: 1 insrc/core/, 197 insrc/game/. The C is the PAL contributors' work (sources added by Shaar, Joshua Nierentz, Sumaiter, chistianh and Kryštof Malinda, in #77, #81, #84 and #85 among others), with every address rewritten to the US one. One commit.Converting PAL C to US
src/is written against SCUS_974.65, andtools/match_map.pyfinds a US function's PAL twin by its code, so a US source counts on both discs. The reverse does not happen: the US map and audit leavesrc/pal/out, so a function matched only there stays unmatched on NTSC-U. The C cannot simply be reused, because it names addresses (func_XXXXXXXX,D_XXXXXXXX), which differ between the discs. This batch converts the PAL sources to US. In rac1-decomp,tools/version_sync.py carrydoes the same job, copying one version's C to the versions with the same code:src/pal/is paired with a US function that has no source yet and the same size and the sametools/inventory.pyfingerprint (identity(): address fields masked, everything else compared). 292 pairs were found; functions in open PRs, Match 26 NTSC-U functions #94 included, were left out.tools/asm_programs.py) is the same instruction for instruction apart from addresses, so lining them up gives PAL -> US for every address the code references:jaltargets,$gpoffsets (PAL$gp0x2259FF and US 0x22597F, from.reginfo), and the addresseslui+addiu/load/store pairs build.func_/D_address in the PAL source is replaced from that map, and the file is written under its US address. A source whose addresses do not all map exactly is skipped, never guessed: 219 of the 292 converted.tools/check_func.pyon the US disc: 206 MATCH.Left out:
config/pal/crossgame_sources.tsv), until their US credit rows are set up;src/game/00506B70.c);The conversion scripts are not part of this PR. If it would help, I can propose them as a tool for converting PAL batches to US, which would be rac4's counterpart to rac1's
carry.$gpglobals that a PAL file defines (docs/LEVERS.md) are defined in the US file too, under their US addresses.Also in this PR
nonmatching/, with their README rows.src/pal/are not counted twice.Validation
tools/build.sh(6,439 translation units through the unchangedtools/cc.sh);tools/match_map.py --writefor both versions: all 198 arematchon NTSC-U.tools/audit_relocs.pyreports nothing for any of the 198, so every converted address agrees with the US binary (only its existing entries remain).tools/audit_matches.pylists 24 of them with a size different from the oldconfig/functions.tsv. That list ends each of these functions early, whileconfig/us/functions.tsvand both maps have the full size, at which they match. Example:func_0053F550is 64 bytes in the maps against 20 in the old list.tools/progress.py --checkpasses for both versions, andgit diff --checkis clean.Generated files
match_map.pyandprogress.pywithout the local libm objects, as the committed maps are.near/nonedifferently in this environment; their rows are left as committed.No compiler-pipeline changes, retail data, extracted binaries or assembly listings are included.
🤖 Generated with Claude Code