Skip to content

Match 26 NTSC-U functions - #94

Open
LucienTo wants to merge 1 commit into
OpenRAC:mainfrom
LucienTo:matches-batch-1
Open

LucienTo wants to merge 1 commit into
OpenRAC:mainfrom
LucienTo:matches-batch-1

Conversation

@LucienTo

@LucienTo LucienTo commented Nov 4, 2026

Copy link
Copy Markdown

Adds matching C for 26 NTSC-U functions that had no US source yet: one libgraph routine in
core.text (func_001270C0, sceGsSyncV, built @ee29 -O2 -G0) and 25 small resident game
functions in src/game/. One commit per function, then one commit regenerating the maps and
reports.

The game functions are object and table accessors (five info-block getters that share one shape,
range-checked table lookups), flag setters and clears, lazy-init getters, small call sequences, two
loops over tables, and two helpers that take a pointer as a 64-bit integer. Each file has a short
comment describing what the function does. Names stay func_/D_ address names.

19 of these functions were already matched on PAL in src/pal/ (by #89, #90 and earlier). The US map
and audit leave src/pal/ out, so they were still unmatched on NTSC-U. The PAL map now lists them
under their US source as well. The PAL report counts each one once: only the 5 that had no PAL
source are added there.

func_00543338 replaces its near miss: nonmatching/game/func_00543338.c and its README row are
removed in the same commit.

Progress:

  • US: matched functions 5,435 -> 5,461, matched code 414,340 -> 415,952 bytes (7.1655% -> 7.1934%).
  • PAL: matched functions 6,032 -> 6,037, matched code 497,616 -> 498,012 bytes. func_004455A8
    and func_00548550 have no identical PAL function (differs).

Validation:

  • Full build of all translation units through the unchanged tools/cc.sh pipeline;
    tools/match_map.py --write for both versions: all 26 are match on NTSC-U, 24 on PAL.
  • Every candidate's callees and globals were checked against the assembly before landing.
    tools/audit_relocs.py reports nothing for any of them (only its existing entries remain).
  • tools/audit_matches.py: no new mismatches, except two size lines that come from the old
    config/functions.tsv. It ends func_004CCFD8 (36 bytes) and func_0050E3F0 (24) after their
    first jr $ra, but both have a second return. config/us/functions.tsv and both maps have them
    at 44 bytes.
  • $gp globals reached outside a delay slot are defined in their files (docs/LEVERS.md); none of
    them is defined in another file.
  • tools/progress.py --check passes for both versions. test_cc_routes.py passes, and
    git diff --check is clean.

Generated files:

  • The maps and reports were regenerated with match_map.py and progress.py. The local libm
    objects were moved aside so that the libm rows stay as committed.
  • Eight unrelated level-code near misses scored near vs none differently in this environment.
    Their rows are left as they were.
  • inventory.py and level_catalogue.py were not committed: run here, they rewrote a large part
    of config/*/functions.tsv and inventory.tsv unrelated to these functions.

No compiler-pipeline changes, retail data, extracted binaries or assembly listings are included.

🤖 Generated with Claude Code

One libgraph routine in core.text (func_001270C0, sceGsSyncV, @ee29 -O2 -G0)
and 25 small resident game functions in src/game/: object and table
accessors, flag setters and clears, lazy-init getters, call sequences, two
table loops and two helpers taking a pointer as a 64-bit integer. 19 were
already matched on PAL in src/pal/; on NTSC-U they were not. func_00543338
replaces its near miss in nonmatching/.

Maps and reports regenerated for both versions (match_map.py, progress.py),
without the local libm objects as the committed maps are; eight unrelated
level-code near-miss rows are left as they were. US: 5435 -> 5461 matched
functions; PAL: 6032 -> 6037.

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