-
Notifications
You must be signed in to change notification settings - Fork 105
gr: some Icicle Mountain functions #2027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
itsgrimetime
wants to merge
24
commits into
doldecomp:master
Choose a base branch
from
itsgrimetime:pr/gr-icemt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+299
−105
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Match Icicle Mountain stage functions: - grIceMt_801F85C4 (100%) - Stage update calling animation/state functions - grIceMt_801F87FC (94.8%) - Loop over 5 GObj pointers calling grMaterial_801C8CDC Note: grIceMt_801F87FC uses raw pointer math for array access at offset 0xF8. This could be improved with proper struct field definitions if the array purpose is understood. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Report for GALE01 (ae5ac00 - 3eec275)📈 Matched code: 47.86% (+0.01%, +216 bytes) ✅ 2 new matches
📈 13 improvements in unmatched functions
|
Replace raw pointer math `(u8*)gp + 0xF8 + i * 4` with proper struct field access `gp->gv.icemt.xF4[i + 1]`. Also document the xF4 field's mixed-type usage: - xF4[0] stores IceMountainParams* - xF4[1-5] store HSD_GObj* for material updates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace raw pointer math `(u8*)gp + 0xF8 + i * 4` with proper struct field access `gp->gv.icemt.xF4[i + 1]`. Document xF4 field's mixed-type usage: - xF4[0] stores IceMountainParams* - xF4[1-5] store Item_GObj* for grMaterial cleanup Add @todo for future renaming once row 5's purpose is understood. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
itsgrimetime
commented
Dec 30, 2025
This flag was inadvertently included in the grIceMt commit. The upstream melee repo doesn't want this change - the --valid-syntax flag should only be used in the local decomp.me instance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
r-burns
reviewed
Dec 31, 2025
itsgrimetime
added a commit
to itsgrimetime/melee
that referenced
this pull request
Jan 2, 2026
- Add padding fields xE8 and xEC to grIceMt_GroundVars to fix struct offset - Use proper struct access gp->gv.icemt.xF4[] instead of pointer arithmetic - grIceMt_801F85C4: 99.1% (register allocation diff only) - grIceMt_801F87FC: 99.7% (uses inline assignment for better codegen) Addresses r-burns feedback on PR doldecomp#2027. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addresses r-burns feedback on PR doldecomp#2027: - Add padding fields xE8 and xEC to grIceMt_GroundVars for correct offset - Use gp->gv.icemt.xF4[] struct access instead of pointer arithmetic - grIceMt_801F85C4: 99.1% (register allocation diff only) - grIceMt_801F87FC: 99.7% (uses inline assignment for better codegen) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address review feedback: Split void* xF4[6] into IceMountainParams* xF4 and HSD_GObj* xF8[5] for clearer type semantics. Update accessor code in grIceMt_801F85C4, grIceMt_801F87FC, and grIceMt_801F75FC accordingly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix xC4/xC6 types from HSD_GObj* to s16 (assembly shows sth/lha) - Add xF0 padding field to align xF4 to correct offset - Define IceMtRowData struct for grIm_803E4068 (12-byte elements) - Improve grIceMt_801F75FC match using s16 pointer arithmetic (75.6%) The xF4 memory area is interpreted as s16 indices during initialization but later treated as pointers by other functions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add proper bitfield check at start of function - checks and clears bit 6 of icemt2.xC4 (interpreted as byte flags) before doing cleanup. Uses pointer array for sequential HSD_JObj access. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Fixes typedef-redefinition error by moving the forward declaration to gr/forward.h where other forward declarations live, avoiding conflict with the full definition in gricemt.h. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The typedef is already in forward.h, so we only need the struct definition here. Having both causes a "typedef redefinition" error in C90/C99 mode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Match grIceMt_801F8CDC to 93.4% (material item creation for Ice Mountain) - Fix header signature mismatches for void-returning functions - Define const floats locally instead of extern declarations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add padding fields xE8 and xEC to grIceMt_GroundVars to fix struct offset - Use proper struct access gp->gv.icemt.xF4[] instead of pointer arithmetic - grIceMt_801F85C4: 99.1% (register allocation diff only) - grIceMt_801F87FC: 99.7% (uses inline assignment for better codegen) Addresses r-burns feedback on PR doldecomp#2027. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The cherry-pick of 401daef57 inadvertently reverted the struct changes from 4e1ab96. Restore the correct layout: - Add u32 xF0 padding field - Split void* xF4[6] into IceMountainParams* xF4 + HSD_GObj* xF8[5] Update function code to use xF8[i] instead of xF4[i+1]. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
itsgrimetime
commented
Jan 2, 2026
… calls - Implement grIceMt_801F785C using struct access where possible - Use M2C_FIELD macro for xAC offset access - Fix grIceMt_801FA0BC calls to pass address instead of value - Both grIceMt_801F75FC and grIceMt_801F785C now use (int)&gp->gv.icemt.xC4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Based on assembly analysis: - Change IceMountainParams.xAC from HSD_GObj* to s16* (array of row indices) - Change IceMtRowData.gobj to IceMtRowData.id (s32 identifier) - Update grIceMt_801F785C to use xAC[0]/xAC[1] array access - Fix fn_801F91A8 to properly read xAC[gp->xE0] (80% match, was 10.6%) - Remove M2C_FIELD usage now that types are correct 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add missing 4th call to grIceMt_801F993C using field28 - Fix y_pos accumulation pattern to match target - Update grIceMt_801F993C signature from UNK_PARAMS to (s32, s32) -> f32 - Remove volatile/void workaround for field28 since it's now used - Move grIm_804DB570 extern to header 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…Vars The xF4 field was incorrectly typed as IceMountainParams* but is never dereferenced as a pointer. Analysis shows it's used as an s16 array for slot initialization, with indices 0-5 overflowing into adjacent xF8. Changes: - types.h: IceMountainParams* xF4 -> s16 xF4[2] - gricemt.c: Replace pointer arithmetic with clean array access grIceMt_801F75FC now matches at 99.9% (was 89.2% with pointer arithmetic). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The function returns -1 as a sentinel pointer value. Cast through s32 (same size as pointer) to avoid -Wint-to-pointer-cast warning while preserving the correct return value. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace M2C_FIELD offset access with proper struct array indexing: - archive->unk4->unk8[7].unk0 instead of M2C_FIELD(..., 0x16C) - Use string literals for __assert instead of char pointer math Match improved from 93.08% to 99.45%. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Split from #2024 - focused PR for Icicle Mountain stage matches.
Methods
I spent a few hours in the dolphin debugger setting different breakpoints and tracing some of the contents in memory, mostly trying to figure out exactly how
grIceMt_GroundVars.xF8[5]is used/what it is. I'm still not 100% sure (should become clearer with more matches in this file & a bit more debugging) but it seems to be related to keeping track of the set of platforms or breakable ice blocks that can spawn within a "row" of icicle mountain.I've got some more matches queued up for this but wanted to keep this one from getting too big. There's a lot of goofy-feeling casts still I'd like to work out, but I've cleaned up all the pointer arithmetic in the original draft, and think I've landed on the right structs.
I also am a bit skeptical that there'd be two of these "GroundVars" structs - followup PR will focus on validating that and will probably come with a bit more certainty around naming/usage.