Skip to content

gm_1832#2329

Merged
ribbanya merged 59 commits intodoldecomp:masterfrom
jurrejelle:jj/gm_1832
Mar 24, 2026
Merged

gm_1832#2329
ribbanya merged 59 commits intodoldecomp:masterfrom
jurrejelle:jj/gm_1832

Conversation

@jurrejelle
Copy link
Copy Markdown
Collaborator

Tracking PR as per usual

sysop and others added 16 commits March 19, 2026 15:50
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Manages player count for classic mode - adding and removing players
from the player init data array. Only real difference is one extra
mr instruction from MWCC register allocation.

Also fixes lbl_804735E8 struct size with padding and adds mn/types.h
include for PlayerInitData access.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resets classic mode player state: saves count, sets to 1, resets
player 0 position/damage/facing, removes extra players and re-adds
slot 1, clears score tracking fields.

Resizes lbl_80473700 to 200 ints to cover all known offsets (up to 0x310).
Adds ifstatus.h include.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sets up classic mode opponent characters from enter data. Iterates
through right-side characters, configuring each player slot with
character kind, costume, facing direction, model scale, and proc.

Adds ClassicProcArray typedef and lbl_803B7C40 extern for const
proc table data.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ing)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Camera animation state machine with 3 cases:
- Case 0: animation completion → load next anim from DynamicModelDesc table
- Case 1: flash effect trigger → advance state
- Case 2: animation done → remove GObj

Changed lbl_804736C0.x36 and x37 to native bitfield structs for rlwimi codegen.
Added x37_state_bits typedef. gm_8018838C_OnFrame now 100%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Camera animation state machine using x37 lower 2 bits (state2 field).
4 cases: intro animation → advance → button press → remove.
Very similar structure to fn_80187AB4 but uses bits 0-1 instead of 2-3.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@decomp-dev
Copy link
Copy Markdown

decomp-dev bot commented Mar 19, 2026

Report for GALE01 (802c37b - 2f0587a)

📈 Matched code: 59.50% (+0.05%, +1932 bytes)

✅ 5 new matches
Unit Item Bytes Before After
main/melee/gm/gm_1832 fn_801861B8 +584 0.00% 100.00%
main/melee/gm/gm_1832 fn_8018A364 +432 0.00% 100.00%
main/melee/gm/gm_1832 fn_80188D3C +428 0.00% 100.00%
main/melee/gm/gm_1832 fn_8018504C +372 0.00% 100.00%
main/melee/gm/gm_1832 gm_80186E30_OnEnter +204 0.00% 100.00%
🥀 1 broken match
Unit Item Bytes Before After
main/melee/gm/gm_1832 fn_801884F8 -1 100.00% 99.82%
📈 30 improvements in unmatched items
Unit Item Bytes Before After
main/melee/gm/gm_1832 fn_8018325C +3631 0.00% 95.47%
main/melee/gm/gm_1832 fn_801891F4 +2380 0.00% 97.08%
main/melee/gm/gm_1832 fn_80184138 +2144 0.00% 96.78%
main/melee/gm/gm_1832 fn_80186634 +1858 0.00% 93.29%
main/melee/gm/gm_1832 .data +1327 0.00% 47.84%
main/melee/gm/gm_1832 fn_80184AB8 +1309 0.00% 91.70%
main/melee/gm/gm_1832 fn_80186F6C +1153 0.00% 99.78%
main/melee/gm/gm_1832 gm_80187F48_OnEnter +954 0.00% 90.77%
main/melee/gm/gm_1832 fn_80185A0C +817 0.00% 95.50%
main/melee/gm/gm_1832 gm_80189CDC +721 0.00% 89.72%
main/melee/gm/gm_1832 fn_80188EE8 +637 0.00% 81.75%
main/melee/gm/gm_1832 fn_80187CF4 +576 0.00% 96.77%
main/melee/gm/gm_1832 fn_80188910 +527 0.00% 94.89%
main/melee/gm/gm_1832 fn_801857C4 +512 0.00% 99.35%
main/melee/gm/gm_1832 fn_80188B3C +482 0.00% 94.22%
main/melee/gm/gm_1832 fn_80187AB4 +448 0.00% 91.83%
main/melee/gm/gm_1832 fn_80188738 +443 0.00% 93.98%
main/melee/gm/gm_1832 fn_80187910 +397 0.00% 94.72%
main/melee/gm/gm_1832 fn_8018A000 +342 0.00% 97.30%
main/melee/gm/gm_1832 fn_801851C0 +313 0.00% 99.37%
main/melee/gm/gm_1832 fn_80186080 +311 0.00% 99.99%
main/melee/gm/gm_1832 fn_80189B88 +306 0.00% 90.14%
main/melee/gm/gm_1832 fn_80185E34 +295 0.00% 99.93%
main/melee/gm/gm_1832 fn_80185F5C +286 0.00% 98.07%
main/melee/gm/gm_1832 fn_80188644 +243 0.00% 99.82%
main/melee/gm/gm_1832 fn_80188550 +232 0.00% 95.44%
main/melee/gm/gm_1832 .sdata +129 19.82% 84.27%
main/melee/gm/gm_1832 .sdata2 +43 46.20% 61.57%
main/melee/gm/gm_1832 .sbss +24 43.75% 81.82%
main/melee/gm/gm_1832 .rodata +7 0.00% 3.33%
📉 1 regression in an unmatched item
Unit Item Bytes Before After
main/melee/gm/gm_1832 .bss -137 36.27% 25.62%

sysop and others added 13 commits March 19, 2026 20:07
…iffs)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…46C)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… target is leaf)

The target is a leaf function using only r3/r5/r6/r7 with no prologue.
Our compiler generates stmw/lmw due to BSS-relative addressing for
lbl_80473700, which requires caching the base address in callee-saved
registers. Structure and logic are correct - all differences are
register allocation and BSS offset constants.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Updates training mode HUD: animation counters, score displays,
stage name text, item/CPU level indicators. Uses u8* base pointer
at lbl_80473700+0x114 for all field accesses.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ine diffs)

Creates 10 SObj sprites in a grid pattern with random jitter for
1P mode splash effects. Exposed xD0/xDC fields in lbl_804735E8 pad.
Added #pragma dont_inline on for fn_801855BC to prevent auto-inlining.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Creates text objects for left/right character names on the splash
screen. Two loops: xEF for left side, xF0 for right side. Special
case xE4==4 adds 340.0f x-offset and returns immediately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sets up SObj rendering, creates display GObjs, initializes image
descriptors for capture buffers, fills zigzag pattern for xD0 image
indices, creates camera and splash effect GObjs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Scene setup function that loads archives, creates camera/light/fog
GObjs, loads JObj models, and branches based on game type (xE4).
Each switch case duplicates camera/jobj/fog setup with different
ending calls. Stack copy pattern for archive name selection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Positions character model JObj using adjustment table per character ID.
Gets translate from child JObj, applies offset table values (-7.0 to x),
sets scale per character. Also positions second player entity relative
to the first (+3x, +4y, -5z) with same scale.

Remaining diffs are systemic (data section base, SDA offsets, 4-byte stack shift).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…teams)

Positions character models based on team lineup and game type.
Gets translate from lbl_804735A8.x4[1], adjusts X/Y/Z position using
archive data indexed by character ID and team size. Sets scale based
on game type (xE4==2 uses per-char scale, else uses lineup table).
Copies position and scale to companion entities.

Remaining diffs are systemic (BSS/data section base, SDA offsets,
extra register from BSS base caching).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Positions left-side character models for classic mode intro. Similar to
fn_80184138 but uses x4[0] as source JObj, xF1 (left char IDs), xEF
(left char amt). Switch on arg1: case 1 shifts Z-10 and sets arrows at
x4[2], case 2 shifts Z-30 and sets arrows at x4[3]. When xE4==2, uses
different archive offset tables (0x6A8/0x630 vs 0x6C/-0xC).

Remaining diffs are systemic (BSS/data/SDA offsets, extra f30 callee save).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remaining diffs are systemic (BSS base offset, add operand order,
SDA offset for assert string relocation).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jurrejelle jurrejelle marked this pull request as ready for review March 23, 2026 20:28
@jurrejelle
Copy link
Copy Markdown
Collaborator Author

Lots of fuzzy matches, not a lot of 100% ones, I still believe this is an improvement :)

@jurrejelle
Copy link
Copy Markdown
Collaborator Author

The function that broke is data / offset stuff, will be resolved when linking

@ribbanya ribbanya enabled auto-merge (squash) March 24, 2026 11:26
@ribbanya ribbanya merged commit c010b1f into doldecomp:master Mar 24, 2026
7 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.

2 participants