Skip to content

Match the multiplayer help text box - #222

Merged
llesieur99 merged 3 commits into
OpenRAC:masterfrom
llesieur99:levels/match-mp-help-text-box
Dec 5, 2026
Merged

llesieur99 merged 3 commits into
OpenRAC:masterfrom
llesieur99:levels/match-mp-help-text-box

Conversation

@llesieur99

Copy link
Copy Markdown
Collaborator

Multiplayer help text box

Match func_L39_0059B428 (2,036 bytes) in PAL, shared by the 15 multiplayer levels (39 to 53). It draws the help box of the multiplayer menus by state: it opens and closes the frame (states 1, 3 and 7), and in states 4 to 6 it widens the box for rows that have an icon, places the text box for 1-, 2- or 4-player splitscreen, draws the row's icon and then the text.

The C replaces the INCLUDE_ASM marker in src/levels/shared/L39_0059B428.c, with the file's own flag line, and its draft leaves nonmatching/. It follows the structure of its single-player twin func_L01_0041B608 (src/levels/shared/L01_0041A910.c).

The best earlier C was 265 diff, all from one missing instruction that shifted the rest. Retail loads the help-row table pointer once for the text, copies it (move $t0,$a1) and reads the copy for the icon > 0 test after the player-count chain. That copy is gcse's partial-redundancy copy, and two things in the C produce it:

  • The table is read through the global at both sites. A local pointer gives both reads one register, so gcse has nothing to copy.
  • The text load sits in a block of its own after the frame call. In the C that block is if (icon_h > 0) on the case's constant icon height. cse cannot fold the test because the constant is set in another block, and gcse folds it after the copy is made, so no branch is left.

s32 max_players = 4; at the start of that block is retail's early li 4. docs/wiki/Matching-Patterns.md gets a note on the pattern.

Verification

  • tools/check.py: MATCH at all 15 places, with the file's own flag line.
  • tools/build_levels.py --setup (levels 39 to 53, tree 2d37111e; the later commit only changes a comment and the wiki): 15 of 15 levels match.
Level SHA-1 As the disc stores it
39_multiplayer_menu f89056e67decc861592e06814b4a4afffbc5decb c805172ccdc1030e865f36aed607b1569a93bf46
40_bakisi_isles 05f844e8b1ab91a98d187d44ea901c9fe80c4ca0 30171ea7a37021f25a55fda988974b4f3678a43f
41_hoven_gorge d9675395a4f34a642e4958f8e53e9b0723f2a42a 3477c456c92b1222a3a4183fa363f25fe95656bf
42_outpost_x12 8ec23ac1905d1a76d41c5ee0a7a8fe9577c1a284 b804fe36bc3951ffbebe78ae72eb69d26266feea
43_korgon_outpost ee93e42a1ca9b613099ca8e0e7fbd9decd0969be 0a8198cfec6d3df94b7453f9ffcae6f459bb0d99
44_metropolis d6681e732716854602de9a4a89f1df1309bb5cbe 40a0eded837ae1d8605e084559cda6c7c18f9ab6
45_blackwater_city fb6496621b946f0068aa8277cb9ab39948ef54e7 e0434b1fe5d6a0e527e03a6215ef669a77689f35
46_command_center 3fc9cc86a5bddd8dafb09a3a2dc44d507b87b397 aa0f34338a5c854c36a3eea03bb4c02d076dc966
47_blackwater_docks 84916e4e5bf393678e2245ddac3504fe2297df14 451252c65212b792c6a3a18099323a73eb6756f0
48_aquatos_sewers_mp 448f4477bcf0131b0eb5317bd11198a65b2f1600 6ec52d95c7ed4d578b39fa31fe63199069ba4b75
49_marcadia_palace 28e7e78cd0de5a89b59318c6b9daa0b0e73dadd0 66fe83312cd706aa50e6053a6afda17740fc30e9
50_bakisi_isles_splitscreen fce0076d59c4358de41b574a2b2f5945c92a0903 60b3a0ef88a278709c5b07667d752940e268ab2d
51_hoven_gorge_splitscreen 8bf7a30bdd30df3733c7b6fd11b8dab7ac328692 db62a67e429e30befed3b493b3adf2bf789be85f
52_outpost_x12_splitscreen 6c78281f67d00302b2efe8352b5b29897a4d8bdd fd129414a42a11c3b46ec1b9b32675b4e83a5f6b
53_korgon_outpost_splitscreen 6b3c8a075410f90b822c4fb53ddd8076683dcdc1 17f3979bdb97a5b801f4e6022e257267f45347d5
  • NTSC-U carry (version_map.py --write, c_objects.py, asm_build.py --version us --c): SCUS_973.53: 54 of 54 targets match. The function has no NTSC-U twin, so its row in config/us/map.tsv only goes from INCLUDE_ASM to C, and progress/report.json is regenerated. The carry ran on 2d37111e; the row's source hash is the current file's, since the later commit edits a comment in it.
  • python -m unittest discover -s tests: 311 tests OK (4 skipped). tests/check_repository.py: repository checks passed.

@bytematchdev

bytematchdev Bot commented Dec 5, 2026

Copy link
Copy Markdown

ByteMatch progress report

SCES_524.56

Code matched 97.50% (+0.03%) · 7.34 MB of 7.53 MB
Fuzzy match 97.50% (+0.03%)
Functions 16,488 (+1) / 16,592
Units complete 589 / 605
✅ Newly matched (1)
  • func_L39_0059B428 (2,036 bytes)

SCUS_973.53

Code matched 92.46% · 6.92 MB of 7.48 MB
Fuzzy match 93.25%
Functions 16,322 / 16,589
Units complete 563 / 594

No function changes.

Commit c09839f · Ratchet & Clank: Up Your Arsenal on ByteMatch

@llesieur99
llesieur99 merged commit dd1d0a0 into OpenRAC:master Dec 5, 2026
2 checks 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.

1 participant