Skip to content

Match, split, and link gm_1832 - #3303

Merged
MarkMcCaskey merged 16 commits into
doldecomp:masterfrom
MarkMcCaskey:match-gm-1832
Sep 3, 2026
Merged

Match, split, and link gm_1832#3303
MarkMcCaskey merged 16 commits into
doldecomp:masterfrom
MarkMcCaskey:match-gm-1832

Conversation

@MarkMcCaskey

Copy link
Copy Markdown
Collaborator

No description provided.

Delete a duplicate unused "ScItrAllstar_scene_data" array, move the "IrRdMap" definition ahead of the first " " literal, and order the .sbss statics by their DOL addresses. .data and .sdata now match byte-for-byte and every data symbol lands at its target offset.
@MarkMcCaskey MarkMcCaskey added the ai-assisted Utilizes a LLM to do the heavy lifting label Sep 3, 2026
@decomp-dev

decomp-dev Bot commented Sep 3, 2026

Copy link
Copy Markdown

Report for GALE01 (8107feb - 76227fd)

📈 Matched code: 95.43% (+0.04%, +1368 bytes)
📈 Linked code: 86.80% (+0.54%, +20984 bytes)
📈 Matched data: 99.39% (+0.14%, +1672 bytes)
📈 Linked data: 90.10% (+0.19%, +2336 bytes)

✅ 33 new matches
Unit Item Bytes Before After
main/melee/gm/gm_186E fn_80186F6C +1156 0.00% 100.00%
main/melee/gm/gm_1879 gm_Scene_IntroNormal_OnEnter +1052 0.00% 100.00%
main/melee/gm/gm_186E .data +696 0.00% 100.00%
main/melee/gm/gm_1879 fn_80187CF4 +596 0.00% 100.00%
main/melee/gm/gm_186E fn_801874FC +536 0.00% 100.00%
main/melee/gm/gm_1879 fn_80187AB4 +488 0.00% 100.00%
main/melee/gm/gm_1879 fn_80187910 +420 0.00% 100.00%
main/melee/gm/gm_186E gm_Scene_IntroAllstar_OnEnter +360 0.00% 100.00%
main/melee/gm/gm_1879 .data +216 0.00% 100.00%
main/melee/gm/gm_186E fn_801873F0 +164 0.00% 100.00%
main/melee/gm/gm_186E fn_80186EFC +112 0.00% 100.00%
main/melee/gm/gm_186E fn_80187494 +104 0.00% 100.00%
main/melee/gm/gm_1879 .sdata +104 0.00% 100.00%
main/melee/gm/gm_1879 gm_801883C0 +92 0.00% 100.00%
main/melee/gm/gm_186E fn_80187714 +88 0.00% 100.00%
main/melee/gm/gm_1879 fn_80187C9C +88 0.00% 100.00%
main/melee/gm/gm_1879 .bss +64 0.00% 100.00%
main/melee/gm/gm_186E gm_Scene_IntroAllstar_OnFrame +60 0.00% 100.00%
main/melee/gm/gm_1879 gm_8018841C +56 0.00% 100.00%
main/melee/gm/gm_1879 gm_Scene_IntroNormal_OnFrame +52 0.00% 100.00%
main/melee/gm/gm_1879 gm_Scene_IntroNormal_OnLeave +40 0.00% 100.00%
main/melee/gm/gm_186E .sdata2 +32 0.00% 100.00%
main/melee/gm/gm_186E .sdata +24 0.00% 100.00%
main/melee/gm/gm_186E .bss +16 0.00% 100.00%
main/melee/gm/gm_186E .sbss +16 0.00% 100.00%
main/melee/gm/gm_1879 .sdata2 +16 0.00% 100.00%
main/melee/gm/gm_1879 .sbss +8 0.00% 100.00%
main/melee/gm/gm_1832 fn_801851C0 +3 99.37% 100.00%
main/melee/gm/gm_1832 .sbss -24 100.00% 100.00%
main/melee/gm/gm_1832 .sdata2 -56 100.00% 100.00%

...and 3 more new matches

🥀 16 broken matches
Unit Item Bytes Before After
main/melee/gm/gm_1832 fn_80186F6C -1156 100.00% 0.00%
main/melee/gm/gm_1832 fn_80187CF4 -596 100.00% 0.00%
main/melee/gm/gm_1832 fn_801874FC -536 100.00% 0.00%
main/melee/gm/gm_1832 fn_80187AB4 -488 100.00% 0.00%
main/melee/gm/gm_1832 fn_80187910 -420 100.00% 0.00%
main/melee/gm/gm_1832 gm_Scene_IntroAllstar_OnEnter -360 100.00% 0.00%
main/melee/gm/gm_1832 fn_801873F0 -164 100.00% 0.00%
main/melee/gm/gm_1832 fn_80186EFC -112 100.00% 0.00%
main/melee/gm/gm_1832 fn_80187494 -104 100.00% 0.00%
main/melee/gm/gm_1832 gm_801883C0 -92 100.00% 0.00%
main/melee/gm/gm_1832 fn_80187714 -88 100.00% 0.00%
main/melee/gm/gm_1832 fn_80187C9C -88 100.00% 0.00%
main/melee/gm/gm_1832 gm_Scene_IntroAllstar_OnFrame -60 100.00% 0.00%
main/melee/gm/gm_1832 gm_8018841C -56 100.00% 0.00%
main/melee/gm/gm_1832 gm_Scene_IntroNormal_OnFrame -52 100.00% 0.00%
main/melee/gm/gm_1832 gm_Scene_IntroNormal_OnLeave -40 100.00% 0.00%
📈 1 improvement in an unmatched item
Unit Item Bytes Before After
main/melee/gm/gm_1884 fn_801891F4 +1 99.51% 99.52%
📉 2 regressions in unmatched items
Unit Item Bytes Before After
main/melee/gm/gm_1832 gm_Scene_IntroNormal_OnEnter -1033 98.28% 0.00%
main/melee/gm/gm_1884 .sdata2 +3 95.00% 90.48%

The 115-float blob at 0x803D9248 is exactly one ClassicCharData (scale[28], offset[28], samus_extra), so define it with that type instead of casting an f32 array. Byte-identical .data, and fn_801851C0 is unchanged.
gm_1884's fn_801891F4 is the only referrer of that .sdata2 entry, and an MWCC literal pool is per-translation-unit, so it cannot belong to gm_1832. The split boundary put it in gm_1832, which a MUST_MATCH seed then reproduced; flipping gm_1832 to Matching therefore failed to link with "undefined: 'lbl_804DA5F8'". Move the boundary and drop the seed. The DOL stays byte-identical.
The .sdata pool holds two copies each of "jobj.h", "jobj" and "IrAls", and .data holds two copies of "ScItrAllstar_scene_data" — with -str reuse a single TU cannot emit any of those twice. The .sbss also has 4-byte holes at 0x804D660C and 0x804D6624 that are exactly the 8-byte inter-unit alignment padding, and each intro scene owns a disjoint .bss object.

Split at the scene boundaries: gm_1832.c keeps Classic/Easy, gm_186E.c takes All-Star, gm_1879.c takes Normal. This drops the duplicate-literal arrays and most of the .sdata2 ordering seeds that only existed to fake a merged pool, and every section is byte-exact against its new split range. The DOL is unchanged.
All eight All-Star intro functions and every data section match, so flip the unit to Matching and record the compiler's literal-pool names from `ninja apply`. The DOL stays byte-identical.
The split unit needs 24 bytes of padding, not 16, to reach retail's 0x48 frame.
The All-Star unit inherited the merged file's full include list; drop the twelve headers it does not need (object stays byte-identical). Reading the late stage index through a pooled `&data->x36` also recovers retail's addressing there, leaving gm_Scene_IntroNormal_OnEnter differing only in register assignment.
The 0x1CC blob at 0x803D9248 is three adjacent statics — a 28-entry scale table, a 28-entry offset table and Samus's extra offset — not one struct behind a pointer. Spelled that way MWCC roots every access at the first array with the field offsets as displacements, which is retail's addressing, and the address web then ranks below the .bss root instead of above it.

Flip the unit to Matching; the DOL stays byte-identical and `ninja apply` records the compiler's literal-pool names.
The camera setup was split into a helper inline that retail does not have; expanding it and declaring gobj before cobj takes gm_Scene_IntroNormal_OnEnter from 98.28% to 99.73%, leaving twelve rows that differ only in register assignment.
The 0xD8 blob at 0x803D9750 was declared as one char* array, which forced `&table[48]`, `table[stage_index + 12]` and `((u64*) &table[24])[stage_index]` at the use sites and spelled "ScItrNormal_scene_data" out as six (char*) word casts. It is four objects: twelve archive names, twelve bgm ids, twelve u64 audio masks and the scene-data name. Byte-identical .data and identical code.
Reading it into a block-local for the archive/BGM group instead of reusing the outer local matches retail's register assignment there; five rows left.
`x0` was declared `DynamicModelDesc***` and then cast to `SceneDesc*` for its camera and light lists; it is a SceneDesc, and `models` sits at offset 0 so `(*x0)[i]` and `x0->models[i]` compile identically. `x4` is likewise one SceneCameraDesc, whose `desc` and `anims` the old `*x4` / `*(HSD_CameraAnim**) x4[1]` spellings were reaching by offset. Every object is unchanged.
The first intro model's anim setup is expanded at its call site rather than
routed through fn_80187AB4_LoadAnim, so its locals live in the caller's
block scope instead of the inline's temp band.
clang-tidy's misc-include-cleaner is enabled repository-wide and the CI hook runs with --fix, so an unused include fails the Ninja (GALE01, clang) job.
@MarkMcCaskey
MarkMcCaskey marked this pull request as ready for review September 3, 2026 23:37
@MarkMcCaskey MarkMcCaskey changed the title Work on gm_1832 Match, split, and link gm_1832 Sep 3, 2026
@MarkMcCaskey
MarkMcCaskey merged commit a3ee42b into doldecomp:master Sep 3, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Utilizes a LLM to do the heavy lifting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant