Skip to content

Match 24 small US functions with no C yet (7 net, 1 game, 16 overlay) - #132

Merged
Veradictus merged 1 commit into
OpenRAC:mainfrom
farfeduc:decomp/untried-small-2
Nov 9, 2026
Merged

Veradictus merged 1 commit into
OpenRAC:mainfrom
farfeduc:decomp/untried-small-2

Conversation

@farfeduc

@farfeduc farfeduc commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Matches 24 small US functions (under 140 bytes) with no matching C yet: 7 in net.text, 1 in game, 16 in level overlays. 16 came straight out of the automatic m2c pass; 8 needed hand fixes. Two of them (func_01EC9060, func_01EC92E8) had drafts in nonmatching/net/; the drafts and their README rows are removed.

The batch was picked from functions nobody had tried, keeping only those m2c decompiles without errors (no syscall, VU0 or other instructions C cannot express here).

How they were matched

  • 16 from the automatic pass (m2c draft, the usual clean-ups, then the compiler profiles): func_004B54D8, func_01EA76E8, func_01EC9060, func_01EC92E8, func_01EC94C0, func_01EC96C0, func_01EF03CC, func_01EF9844, func_L00_00513308, func_L00_005195A8, func_L00_0052FA40, func_L00_005463F8, func_L00_00547500, func_L00_00552380, func_L00_00714A80, func_L00_00717DF0. The net ones and func_L00_00513308 build with @ee296 -O2 -G0 -falign-jumps=1 (four of them with -mno-split-addresses), five l00_multiplayer_menu ones with @ee29 -O2 -G0, func_L00_00714A80 with -mno-split-addresses, and two need no cflags line.

  • 8 fixed by hand:

    • u8 fields where retail uses lbu/sb (func_L00_00716828, func_L00_00748B20, func_L01_004D90B0);
    • a pointer step m2c scaled by the element size (func_L08_004B8018: 4 bytes, not 16);
    • five arguments where m2c saw four (func_L00_005192C0, func_L00_00528568: retail sets $t0);
    • the flags field read again instead of a cached copy (func_L00_00520548);
    • the array base computed before the index, and the callee declared without parameters: retail's $a1 is only the scaled index (func_L01_00466040).

    Profiles: func_L00_00520548, func_L00_005192C0 and func_L00_00528568 build with @ee29, like their neighbours in l00_multiplayer_menu; the other five need no cflags line.

No #define aliases, volatile, inline asm or hard-coded addresses.

Verification

On main at 4a7372f:

  • full tools/build.sh, build_libgcc.sh, build_libm.sh;
  • tools/audit_matches.py and tools/audit_relocs.py: no line names any of these functions;
  • config/{us,pal}/map.tsv changed only on these rows (match_map --write with and without the new files, applied as a delta), then match_map --check;
  • progress.py --check for US and PAL: US 7,163 → 7,187 and PAL 7,644 → 7,667.

Independent of #128 and #130 (no file in common).

Left out: func_0013A0F0 also matches in US, but src/pal/core/0013A0F0.c defines the same symbol with the PAL addresses, and audit_relocs.py checks every object in build/obj/ against the US addresses once the name is exact in US, so the PAL object shows up as 4 mismatches. That looks like a tool issue (the PAL objects should be skipped in the US check), so I kept the function out of this PR.

Reserved in #112.

🤖 Generated with Claude Code

16 come from the automatic m2c pass, 8 were fixed by hand (byte fields,
pointer stride, fifth argument, callee without parameters). Two had
drafts in nonmatching/net/ (func_01EC9060, func_01EC92E8), removed with
their README rows. The map rows change only for these functions.

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

bytematchdev Bot commented Nov 8, 2026

Copy link
Copy Markdown

ByteMatch progress report

SCUS_974.65

Code matched 10.24% (+0.04%) · 592.28 KB of 5.78 MB
Fuzzy match 10.71% (+0.04%)
Functions 7,187 (+24) / 18,170
Units complete 3,906 (+8) / 3,965
✅ Newly matched (24)
  • func_004B54D8 (120 bytes)
  • func_01EC94C0 (112 bytes)
  • func_01EC96C0 (108 bytes)
  • func_L01_004D90B0 (108 bytes)
  • func_01EF03CC (100 bytes)
  • func_L00_0052FA40 (100 bytes)
  • func_L00_005192C0 (96 bytes)
  • func_L00_005195A8 (96 bytes)
  • func_L00_00520548 (96 bytes)
  • func_L00_005463F8 (96 bytes)
  • func_L00_00552380 (96 bytes)
  • func_L08_004B8018 (96 bytes)
  • func_01EC9060 (92 bytes)
  • func_L00_00513308 (92 bytes)
  • func_L00_00716828 (92 bytes)
  • func_01EA76E8 (88 bytes)
  • func_01EC92E8 (88 bytes)
  • func_01EF9844 (88 bytes)
  • func_L00_00547500 (88 bytes)
  • func_L00_00714A80 (88 bytes)
  • func_L00_00717DF0 (84 bytes)
  • func_L00_00748B20 (84 bytes)
  • func_L00_00528568 (80 bytes)
  • func_L01_00466040 (76 bytes)
📉 Worse (2)
  • func_01EC9060 97.83% → 0.00%
  • func_01EC92E8 90.91% → 0.00%

SCES_532.85

Code matched 12.60% (+0.04%) · 732.23 KB of 5.81 MB
Fuzzy match 13.02% (+0.03%)
Functions 7,667 (+23) / 18,134
Units complete 4,180 (+8) / 4,238
✅ Newly matched (23)
  • func_004B63C8 (120 bytes)
  • func_01EC94C0 (112 bytes)
  • func_01EC96C0 (108 bytes)
  • func_L01_004DB030 (108 bytes)
  • func_01EF03CC (100 bytes)
  • func_L00_005197C0 (96 bytes)
  • func_L00_00519AA8 (96 bytes)
  • func_L00_00520A48 (96 bytes)
  • func_L00_005468F8 (96 bytes)
  • func_L00_00552880 (96 bytes)
  • func_L08_004B9BA8 (96 bytes)
  • func_01EC9060 (92 bytes)
  • func_L00_00513808 (92 bytes)
  • func_L00_0071A670 (92 bytes)
  • func_01EA76E8 (88 bytes)
  • func_01EC92E8 (88 bytes)
  • func_01EF9844 (88 bytes)
  • func_L00_00547A00 (88 bytes)
  • func_L00_007188C8 (88 bytes)
  • func_L00_0071BC38 (84 bytes)
  • func_L00_0074D750 (84 bytes)
  • func_L00_00528A68 (80 bytes)
  • func_L00_0052FF40 (40 bytes)
📉 Worse (2)
  • func_01EC9060 97.83% → 0.00%
  • func_01EC92E8 90.91% → 0.00%

Commit c6d1c3c · Ratchet: Deadlocked on ByteMatch

@Veradictus
Veradictus merged commit 4090c12 into OpenRAC:main Nov 9, 2026
1 check passed
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.

2 participants