Skip to content

feat(src): match 2 USA v1.01 functions and carry 18 PAL ones - #422

Open
cadelass wants to merge 1 commit into
OpenRAC:masterfrom
cadelass:match/usa-pal-twenty
Open

cadelass wants to merge 1 commit into
OpenRAC:masterfrom
cadelass:match/usa-pal-twenty

Conversation

@cadelass

@cadelass cadelass commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

What

20 functions in C, all matching every place:

  • 2 in USA v1.01;
  • 18 PAL-only functions (func_PAL_…), 24,728 distinct bytes over 52 places.

USA v1.01

  • func_L15_004307E0 (Gorn cutscene controller, 848 bytes). func_0029B3E0 returns int, as its matched definition in src/game/0029AE78-save-g8.c does. With the value-returning call, local-alloc gives retail's registers after it; a void declaration swaps $v0/$v1.
  • func_L23_0041A3B8 (Damosel effect trigger, 652 bytes).
    • Its kind 0xF arm groups its real effect (two calls and a store) in a nonempty one-pass statement. That is the RAC1 source method recorded in docs/COMPILER-NOTES.md (Match five HUD and level initialization functions #417).
    • The group's loop notes keep the la of D_L23_001B3850 ahead of the two frame-address arguments.
    • func_L00_0035F5A0 returns int, as its matched definition does.

Both near-miss notes and their functional copies are removed.

PAL

Each unit is the C of a matched v1.01 function, changed only where PAL's bytes differ. Its header names the v1.01 twin and lists every change.

PAL function v1.01 C Bytes Places What changes
func_PAL_L14_00427108, L15_004241F8, L17_0041D4E8, L18_0043BDE8, L20_0043E868, L22_00414080, L23_0041A950 func_L00_0040EAA0 1540 each 1 each only the callees' PAL names
func_PAL_L00_002C3250 func_L00_002C30B0 1928 16 50 Hz timer steps (1/600 → 1/500 …)
func_PAL_L22_002C8740 func_L22_002C8610 2012 2 the same
func_PAL_L18_002DF168 func_L18_002DEFF8 2016 2 the same
func_PAL_L20_002D6678 func_L20_002D6488 2044 1 the same
func_PAL_L01_003BD328 func_L01_003B9798 1944 2 lift steps scaled by 60/50 (0.1 → 0.12) and (60/50)² (0.00167 → 0.0024)
func_PAL_L02_003D06F0 func_L02_003CC7B0 1304 2 the 300-frame timer becomes 250
func_PAL_L05_004212A8, 004225D0, 0042BD38, 0042C2E8, 0042C880 func_L05_003CD598 540 each 4 each see below

The five func_PAL_L05_… glow rings each change in three ways:

  • the fade count goes from 255 to 212 steps (≈ 255 × 50/60);
  • its reciprocal goes from 0.0039215689f to 0.004716981f;
  • each copy has its own pair of colours.

The unit flags are the v1.01 file's.

Not included

The 22 menu accessors func_PAL_L00_0030F* carry the same way, from func_L00_0030D240. They match 23 of 27 places each. The other 4 fail because the PAL catalogue's places for these entries are shifted by one in levels 05, 10, 15 and 25, which is a catalogue repair (#421). They stay INCLUDE_ASM.

Checks

On this branch, rebased on 5e3add6f:

  • tools/build.py all --strict: 28/28 USA v1.01 programs OK;
  • tools/build.py all --strict --version pal: 28/28 PAL programs OK;
  • python -m unittest discover -s tests: 383 tests OK;
  • tests/check_repository.py and tools/progress.py --check pass.

USA v2.00 was not built, because I don't have its dump. func_L23_0041A3B8 exists there with the same fingerprint; func_L15_004307E0 and the PAL functions do not.

🤖 Generated with Claude Code

USA v1.01:
- func_L15_004307E0 (Gorn cutscene controller): func_0029B3E0 returns int,
  as its matched definition does.
- func_L23_0041A3B8 (Damosel effect trigger): the kind 0xF arm groups its
  effect in a nonempty one-pass statement, the RAC1 source method recorded
  in docs/COMPILER-NOTES.md; func_L00_0035F5A0 returns int.

PAL, each the C of a matched v1.01 function with PAL's values (the unit
header lists every change):
- func_PAL_L14_00427108, L15_004241F8, L17_0041D4E8, L18_0043BDE8,
  L20_0043E868, L22_00414080, L23_0041A950 (from func_L00_0040EAA0);
- func_PAL_L00_002C3250, L22_002C8740, L18_002DF168, L20_002D6678 and
  L01_003BD328: 50 Hz timer steps;
- func_PAL_L02_003D06F0: the 300-frame timer becomes 250;
- func_PAL_L05_004212A8, 004225D0, 0042BD38, 0042C2E8, 0042C880: the
  255-step glow fade becomes 212 steps, with each copy's own colours.

tools/build.py all --strict: 28 USA v1.01 and 28 PAL programs OK; 382
tests, repository checks and progress --check pass. USA v2.00 was not
built (no dump here); func_L23_0041A3B8 has the same fingerprint there.

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

bytematchdev Bot commented Nov 4, 2026

Copy link
Copy Markdown

ByteMatch progress report

SCES_516.07

Code matched 55.43% · 3.16 MB of 5.70 MB
Fuzzy match 55.43%
Functions 7,156 / 8,671
Data matched 0.00%
Units complete 990 / 1,217

No function changes.

SCUS_972.68

Code matched 90.31% · 4.99 MB of 5.53 MB
Fuzzy match 90.31%
Functions 8,096 / 8,578
Data matched 0.00%
Units complete 972 / 1,060

No function changes.

SCUS_972.68_v2

Code matched 84.86% · 4.73 MB of 5.58 MB
Fuzzy match 84.86%
Functions 7,870 / 8,633
Data matched 0.00%
Units complete 1,015 / 1,188

No function changes.

Commit 9dc5b75 · Ratchet & Clank: Going Commando on ByteMatch

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