Skip to content

feat(levels): match the shield arcs draw (func_L01_00342640, func_L39_00563E40) - #223

Merged
llesieur99 merged 3 commits into
OpenRAC:masterfrom
llesieur99:feat/ribbon-trail-twins
Dec 6, 2026
Merged

llesieur99 merged 3 commits into
OpenRAC:masterfrom
llesieur99:feat/ribbon-trail-twins

Conversation

@llesieur99

@llesieur99 llesieur99 commented Dec 6, 2026 •

Copy link
Copy Markdown
Collaborator

Shield arcs draw

Match func_L01_00342640 (760 bytes, shield_arcs_draw, 34 places) and its multiplayer copy func_L39_00563E40 (608 bytes, 15 places) in PAL. Both redraw the shield's five arcs. A live arc keeps the spacing of its ten points but is re-anchored at the shield's centre. Its alpha is a constant times the frames left over its life, and it is drawn as a closed loop through func_L01_00409658. The single-player copy takes the line kind and colour from the current level's entry in D_L01_002C5600. The multiplayer copy has one colour, and another one for object class 0x1192.

Files

  • func_L01_00342640 needs interblock scheduling: it is 43 diff under the line of L01_00340670.c, which has -fno-sched-interblock. It moves to src/levels/shared/L01_00342640.c, on that line without the flag. The functions after it, from func_L01_00342938 to the end of the old file, move unchanged to src/levels/shared/L01_00342938.c on the old file's line. The declarations they took from earlier in the old file are repeated at its top.
  • func_L39_00563E40 was an INCLUDE_ASM marker at the end of L39_00563DB8.c. It moves to src/levels/shared/L39_00563E40.c, on the VU0 @ps2as line that L39_005640A0.c uses.
  • Both drafts leave nonmatching/ (levels and functional), with their rows in nonmatching/functional.tsv and nonmatching/README.md.

What made them match

  • The head point is copied through an inline helper, as in the sibling func_L39_005635D0 (L39_00563370.c). The store then gets its own i * 0xA0 row product, and the .w store reuses that row address (move $a1,$a2). A direct store shares the loops' product: 38 and 126 diff, down to 3 and 17 with the helper.
  • The alpha is read into the variable that holds its scaled form: a = D[k]; a = (s32)((f32)a * scale) << 24;. That gives retail's registers in both copies.
  • The callee is declared as the matched caller func_L20_003D8248 declares it, with the floats before the colours and the colours as s32. Under the EABI, the int and float arguments take the same registers in either order.

docs/wiki/Matching-Patterns.md gets a note on each of the first two.

Verification

  • tools/check.py: func_L01_00342640 MATCH at all 34 places in its new file. func_L39_00563E40 MATCH at all 15 places.
  • tools/build_levels.py --setup on all 49 levels (tree a307f267; the later commits are the NTSC-U carry and a line wrap in the wiki note): 49 of 49 levels match. The run went through the new files' flag lines, so the functions moved to L01_00342938.c were built on its line.
Level SHA-1 As the disc stores it
01_veldin aab9a95641fa24e3acaec9c04369e942b3689e38 1b44af14c1fc005d439bc026a092b5734e6b2fb6
02_florana 13679c255f1decfcf3950cf5e2667e6f6332f9e8 daa39dff070157ebd4e40769cb0b543473b34c73
03_starship_phoenix 447ee84f02bc3ffa15c39d1bdfa339301ef7c74a a75a948488b8bb04748ca4ac8a8ad7be9c672c22
04_marcadia 7cd1b04a1fa84c888847e7032fed40962f041145 8c7764d8d793458f9f19f27d8c98a0faea263942
05_daxx 2b3877caac6de716ace61b111855bbe24684938c 11293543601528cec22af9c74c7cff2f987b8573
06_starship_phoenix_under_attack 660b280490091751f79ed922bea74cfb4cdb53e8 cee236d4c398c583381bdb42b3df7a5e4f53d489
07_annihilation_nation 1fad9b6e284d55534a7eebe6d19c4b4e37e0090a 8421d1db9f34360069daffa0295119a584c5e5bd
08_aquatos 7121a587eca7ceff13e0dc747f1a12fe7a23ef76 cb838fefcb63dd1e822b137fe34e5fa20879f76b
09_tyhrranosis cdb30aea6a0e72f76cf4db8c41c57aa413c1aecf 9df4752ec061610dd5377ae1db1222bc1f8693f5
10_zeldrin_starport 7815cb88fadf56d8fe7eb0747c6f649a424d7fad 2cfa5cea433c770149b8cb4e4bfe293169702a0d
11_obani_moons 0da808c0605c80e7caf473e797272c16961d39b1 ee0a9216f7df2c737a76db3e657bbb561a72c066
12_rilgar 89c3cf2eaba79c56a0ecb07c53ca73da2b443ea2 d11fbef13ee9d6260f1677c640266f01b9cdb5e5
13_holostar_studios_ratchet d93dd78dc3060580284acdf8a76580d21debddc6 37498424322cc79eaeb7d11a410599c590ad7e13
14_koros 5e6ae50167440ac0e8e96c6308791ee24e6e3d79 93c37ee7b85e33fa25b0fba19beb8418a9023128
16_kerwan 05669db35ead92b8c7685986de20e38070656e6e 90d1c37120d205c401c00a49cd9ce8ee66fdef7e
17_crash_site d55d5aca3b00159ec224c9d04b53dd8bfca20141 2f8ca91011893914d885a5c23c69d9c9b78fb8c0
18_aridia cacebbfe178be73d42a950584a58ebd00d6f8bac a51a43afa46b7f11c7543cb8bfcf4b93fdf038a3
19_thran_asteroid_belt 7290b9a16e4bb3548998097535b8353aaed944a7 0beafc66f13dc50b31871c9cd28c036d8f2437db
20_final_boss 307bb72dc2327ac7e9df9429261d56d275d93add 3b2e2d6c6ae5d05f08c85c78521a0e10eeee1602
21_obani_draco 97188a12babe1657cd2249aa484cfb692e576c5f 40f4548c7e59fab0a4eb28797d2f03b84ea3d120
22_mylon c7f5c3ad942d75e519901ed86cf5229f32c1fee3 35a636ab6a5ba5acb37b3cb3ac48ca148078e824
23_holostar_studios_clank 97743112f3df9b815b627265450f6fc1f82a35f6 c9aa982976c9c78950eababe3ac62bc9d84e8ebd
24_insomniac_museum 79e9d151e51d6cc987b0327fcca186175052ded3 60574360e20964b371a59d6a745c5afefb6b9ced
26_kerwan_ranger_missions b57ca607149c28f044267a752cd267f8c59e091e b5ddb15f22684787a63625db202fbc34004e4f1c
27_aquatos_base 42595aa7b0f7a50068ce253bf87317804e408416 d8f4ff29501db22558bd6acca78c08170947fdbb
28_aquatos_sewers 0b19135dddf1fde3cb8f1dc75d2d50cd7f4e079b 86b1f60e5e6c6dabea43aedd0b2d68f7501fc0b1
29_tyhrranosis_ranger_missions 5fa06bcc68b3f7f1579865b6d854ec9438212eb3 ed22ca26d2af33019bfdbfe2da1e68c866a30aef
30_vidcomic_unnamed ce93cb0a44fa9ab80d436fb0a755e7bcc19afac6 69a0592f277a730d418499c625f0525e5fdf9b4e
31_vidcomic_1 7de4e9c7fd22ea0ff0cce7c18427ca1a5239e654 8dcbcf64beea7928d1cca921fc0b8426bdc5785f
32_vidcomic_4 ba78563b050ce9b24f140db9df80da69a719343b 4f919ed39f04b52ef2356e4c36c798c0bfffae46
33_vidcomic_2 51592e036338094c4f5f53a748875187678c9aba 5feec48b1b13d3bc47068bcab45bdd2f00854525
34_vidcomic_3 07e0404f5789cdf55a145091053b429217fb5b6f 0766377afe5098ac20ce53bbbd918860ae840a4a
35_vidcomic_5 e35bec5c2e797d9f2eb1b032cd7aaa9c2e25674c 8dbda4934c0e85df5aff1bd1dc9d15ee77966794
36_vidcomic_1_special_edition 7394d30609ee0b8a8e40b1792923b3501cd0720d 099efabc28b4f8c677ab22154507807db235341d
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 (tools/carry_us.sh on a307f267: version_map.py --write, c_objects.py, asm_build.py --version us --c): SCUS_973.53: 54 of 54 targets match. Both twins go from INCLUDE_ASM to C in config/us/map.tsv (func_L01_00341DA0 at 34 places and func_L39_005632C8 at 17), with their rows in config/us/built.tsv. The other changed rows only take the new source hash of their file, for every function of L01_00340670.c, L01_00342938.c and L39_00563DB8.c. progress/report.json and progress/us/report.json are regenerated.
  • python -m unittest discover -s tests: 311 tests OK (4 skipped). tests/check_repository.py: repository checks passed.

Match func_L01_00342640 (shield_arcs_draw) and its multiplayer copy
func_L39_00563E40. Each moves to a file of its own on the flag line it
needs. L01_00342640.c holds only the function, without
-fno-sched-interblock (43 diff with it); the functions after it move
to L01_00342938.c on the old file's line. L39_00563E40.c uses the VU0
@ps2as line of L39_005640A0.c.

The wiki gets two notes: the head store through an inline copy helper,
and reading a value into the variable that holds its scaled form.
Regenerate config/us/map.tsv, config/us/built.tsv and the progress reports for func_L01_00342640 and func_L39_00563E40 (NTSC-U func_L01_00341DA0 and func_L39_005632C8, both C and matching).
@bytematchdev

bytematchdev Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

ByteMatch progress report

SCUS_973.53

Code matched 92.48% (+0.02%) · 6.92 MB of 7.48 MB
Fuzzy match 93.27% (+0.02%)
Functions 16,324 (+2) / 16,589
Units complete 563 / 594
✅ Newly matched (2)
  • func_L01_00341DA0 (760 bytes)
  • func_L39_005632C8 (608 bytes)

SCES_524.56

Code matched 97.51% (+0.02%) · 7.34 MB of 7.53 MB
Fuzzy match 97.51% (+0.02%)
Functions 16,490 (+2) / 16,592
Units complete 589 / 605
✅ Newly matched (2)
  • func_L01_00342640 (760 bytes)
  • func_L39_00563E40 (608 bytes)

Commit 3547b98 · Ratchet & Clank: Up Your Arsenal on ByteMatch

@llesieur99
llesieur99 merged commit ca99405 into OpenRAC:master Dec 6, 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