-
Notifications
You must be signed in to change notification settings - Fork 109
bump ifStatus_802F4EDC to ~ 70% match #2145
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
base: master
Are you sure you want to change the base?
bump ifStatus_802F4EDC to ~ 70% match #2145
Conversation
Implements ~35% of the 3180-byte function. This is the largest stubbed function in the codebase. Implemented: - Player state lookup via bdnz loop - Death animation early return - Animation status flag handling - Digit visibility based on damage value (hide tens/hundreds) - JObj position calculations for digit "1" spacing - Shake animation trigger - Final scale adjustment Still missing (~65%): - TObj texture animation setup (HSD_TObjAddAnimAll chains) - Color interpolation based on damage percentage - Detailed JObj/TObj pointer chain traversals
Implement ~66% of the 3180-byte function (largest in codebase). Implemented: - Player state lookup loop (bdnz pattern attempt) - Death animation check and early return - Animation status flags and setup - TObj texture animations for all digits - Digit visibility logic (hide tens/hundreds when < 10/100) - Color interpolation based on damage percentage - Stamina mode: 0-100% range with inverted lerp - Normal mode: 0-300% range with direct lerp - JObj position tracking during animations - Digit "1" spacing adjustments (0.5069F offset) - Shake timer and final scale Still needs work: - Loop counter structure (not generating bdnz) - Register allocation differences (r24+ vs r23+) - Some TObj animation chain navigation details
Partial decompilation of the largest stubbed function in ifstatus.c (3180 bytes). Changes include: - Proper stack frame with PAD_STACK(96) - HudIndex* hud variable for register allocation - HSD_MatAnimJoint** anim_base caching - Player search loop with goto pattern - Mat_anim chain access via ->child->next->next - Digit TObj animation setup - Color interpolation for damage display - JObj position updates with jobj_flagCheckSetMtxDirtySub Remaining issues: - Loop generates addic./bne instead of mtctr/bdnz - Code 416 bytes shorter than target - Register allocation differences
ribbanya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems quite acceptable as a first pass. Function needs to be broken up into inline calls, like the found_player control flow. There's probably a missing struct on the stack that's causing the insane padding value. jobj.h asserts are inlines which can easily be found by line number in jobj.h.
|
Let me have a go at that, one sec. |
Nevermind:
|
- Fix translation_x vs translation_y bug in position calculations - Convert reading loop to use pointer increments (matches target pattern) - Remove tex_anim caching in first animation block (reduces register pressure)
Improves match from 71.52% to 71.83%
Improves match from 71.83% to 71.92%
Had claude work on the largest portion of unmatched code to see how it'd do. Here's the result. Did it do an acceptable job? It couldn't push it over 71% without doing fake black magic code patterns, this is the best "honest" attempt.
Claude: