Skip to content

more mndiagram#2141

Draft
itsgrimetime wants to merge 9 commits intodoldecomp:masterfrom
itsgrimetime:pr/mndiagram-module
Draft

more mndiagram#2141
itsgrimetime wants to merge 9 commits intodoldecomp:masterfrom
itsgrimetime:pr/mndiagram-module

Conversation

@itsgrimetime
Copy link
Contributor

@itsgrimetime itsgrimetime commented Jan 27, 2026

still WIP

some more matches + documentation in mndiagram & mndiagram2. start matching mndiagram3 as well

itsgrimetime and others added 9 commits January 27, 2026 14:14
Replace goto-based spaghetti with mnDiagram_GetNextNameIndex helper
in name mode right arrow section. Simpler, more readable code.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add docstring for mnDiagram_802417D0 explaining directional arrow logic
- Fix swapped comments: jobjs[4] is Up arrow, jobjs[5] is Left arrow
- Clarify cursor_pos encoding is (col << 8 | row) for scroll offset
- Update mnDiagram_UpdateScrollArrowVisibility docstring with jobj mappings
- Fix types.h comments for fighter_cursor_pos and name_cursor_pos

Validated via runtime debugging with Dolphin memory inspection.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rename address-based functions to descriptive names based on code analysis:

Initialization:
- mnDiagram_802437E8 → mnDiagram_Init (entry point, loads DAT)
- mnDiagram_80243434 → mnDiagram_Setup (creates main GObj)
- mnDiagram_8023FA6C → mnDiagram_SortFightersByKOs
- mnDiagram_8023FC28 → mnDiagram_SortNamesByKOs

Grid display:
- mnDiagram_80241730 → mnDiagram_UpdateGridDisplay (orchestrates refresh)
- mnDiagram_80241668 → mnDiagram_ClearGridContent
- mnDiagram_8024227C → mnDiagram_DrawGridCells
- mnDiagram_80241E78 → mnDiagram_DrawCellNumber

Headers:
- mnDiagram_802427B4 → mnDiagram_DrawNameHeaders
- mnDiagram_80242C0C → mnDiagram_DrawFighterHeaders
- mnDiagram_80242B38 → mnDiagram_CreateFighterIcon

Navigation:
- mnDiagram_802417D0 → mnDiagram_UpdateScrollArrows
- mnDiagram_802433AC → mnDiagram_CreateCursor

Popup:
- mnDiagram_80241310 → mnDiagram_CreatePopup
- mnDiagram_80240D94 → mnDiagram_PopupSetupText

Also adds docstrings with @brief/@param documentation and renames
parameters from generic arg0/arg1/arg2 to descriptive names.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add u8 variant of CheckAllZeroPlayTime inline to handle different
codegen requirements when parameter type is u8 vs int. The u8 version
requires the `int i = 0; int offset = i;` pattern to force correct
register allocation order.

Also simplified the int version of CheckAllZeroPlayTime by removing
the unused offset variable (was a fakematch).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rewrote the input processing function for VS Records diagram menu.
Handles A button (popup), B button (exit), L/R (screen switch),
toggle mode, and D-pad navigation for both fighter and name modes.

Remaining differences are register allocation (8 vs 9 callee-saved).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix sign extension: use u32 for result instead of int
- Remove unused variables (var_r6)
- Simplify mode toggle using ternary expression
- Add PAD_STACK(40) for correct stack frame size

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@decomp-dev
Copy link

decomp-dev bot commented Jan 27, 2026

Report for GALE01 (ec603e3 - 0876f9e)

📈 Matched code: 50.91% (+0.01%, +560 bytes)

✅ 5 new matches
Unit Item Bytes Before After
main/melee/mn/mndiagram3 mnDiagram3_80247008 +324 0.00% 100.00%
main/melee/mn/mndiagram3 mnDiagram3_80246D40 +196 0.00% 100.00%
main/melee/mn/mndiagram3 fn_80246E64 +168 0.00% 100.00%
main/melee/mn/mndiagram mnDiagram_PopupInputProc +53 68.00% 100.00%
main/melee/mn/mndiagram mnDiagram_GetLeastPlayedFighter +13 96.88% 100.00%
💔 4 broken matches
Unit Item Bytes Before After
main/melee/mn/mndiagram mnDiagram_80242B38 -212 100.00% 0.00%
main/melee/mn/mndiagram mnDiagram_80241668 -200 100.00% 0.00%
main/melee/mn/mndiagram mnDiagram_80241730 -160 100.00% 0.00%
main/melee/mn/mndiagram mnDiagram_802433AC -136 100.00% 0.00%
📈 9 improvements in unmatched functions
Unit Item Bytes Before After
main/melee/mn/mndiagram mnDiagram_InputProc +1954 21.85% 84.09%
main/melee/mn/mndiagram3 mnDiagram3_80245BA4 +1231 0.00% 78.95%
main/melee/mn/mndiagram3 fn_802461BC +1015 0.00% 34.43%
main/melee/mn/mndiagram3 mnDiagram3_8024714C +855 0.00% 96.33%
main/melee/mn/mndiagram3 mnDiagram3_80246F2C +196 0.00% 89.25%
main/melee/mn/mndiagram3 fn_80246E04 +91 0.00% 95.62%
main/melee/mn/mndiagram3 .sdata2 +21 0.00% 53.57%
main/melee/mn/mndiagram2 mnDiagram2_HandleInput +16 88.42% 89.46%
main/melee/mn/mndiagram3 .sbss +4 0.00% 50.00%
📉 11 regressions in unmatched functions
Unit Item Bytes Before After
main/melee/mn/mndiagram mnDiagram_8024227C -1016 76.05% 0.00%
main/melee/mn/mndiagram mnDiagram_80241E78 -942 91.71% 0.00%
main/melee/mn/mndiagram mnDiagram_80241310 -848 99.11% 0.00%
main/melee/mn/mndiagram mnDiagram_802417D0 -770 97.32% 0.00%
main/melee/mn/mndiagram mnDiagram_80240D94 -728 51.87% 0.00%
main/melee/mn/mndiagram mnDiagram_80242C0C -696 65.20% 0.00%
main/melee/mn/mndiagram mnDiagram_80243434 -637 67.25% 0.00%
main/melee/mn/mndiagram mnDiagram_802437E8 -502 84.38% 0.00%
main/melee/mn/mndiagram mnDiagram_8023FA6C -358 80.82% 0.00%
main/melee/mn/mndiagram mnDiagram_8023FC28 -328 76.00% 0.00%
main/melee/mn/mndiagram mnDiagram_802427B4 -319 35.46% 0.00%

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