Skip to content

Grind main/menu_item: 97.234% -> 97.350% (cast/schedule named-temp)#17666

Merged
asmithbot merged 1 commit into
mainfrom
pr/menu_item/emp29
Jun 14, 2026
Merged

Grind main/menu_item: 97.234% -> 97.350% (cast/schedule named-temp)#17666
asmithbot merged 1 commit into
mainfrom
pr/menu_item/emp29

Conversation

@asmithbot

Copy link
Copy Markdown
Collaborator

Summary

ItemDraw: factor (float)(1.0/duration) into a named local widthFrac before multiplying by (float)entry->w.

This mirrors the Ghidra ground truth (80159df4_ItemDraw__8CMenuPcsFv.c lines 134-135):

in_f29 = (double)((float)(DOUBLE_80332e68 / (local_b0 - DOUBLE_80332ea0)) *
                  (float)(local_b8 - DOUBLE_80332ea0));

The named temp forces the division/frsp to be materialized before the w-bias fsubs, matching the target instruction schedule. Value-identical, behavior-safe.

Gate

  • ItemDraw misalign 9 -> 7 (matched rows realigned: frsp/fsubs order)
  • unit main/menu_item fuzzy_match_percent 97.234 -> 97.350
  • No function regressed (ItemInit 13, ItemCtrlCur 2, ItemInit1 1, others 0 all unchanged)

🤖 Generated with Claude Code

Factor (float)(1.0/duration) into a named local widthFrac before the
multiply by (float)entry->w, mirroring Ghidra ItemInit/ItemDraw ground
truth (80159df4_ItemDraw line 134-135): in_f29 = (float)(DOUBLE_80332e68 /
(local_b0 - DOUBLE_80332ea0)) * (float)(local_b8 - DOUBLE_80332ea0).
The named temp forces the division/frsp to be materialized before the
w-bias subtract, matching the target schedule.
ItemDraw misalign 9 -> 7; unit fuzzy 97.234 -> 97.350.

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

decomp-dev Bot commented Jun 14, 2026

Copy link
Copy Markdown

Report for GCCP01 (3a718db - 86a4207)

📈 1 improvement in an unmatched item
Unit Item Bytes Before After
main/menu_item CMenuPcs::ItemDraw() +9 97.03% 97.35%

@asmithbot asmithbot merged commit 9521ac4 into main Jun 14, 2026
2 checks passed
@asmithbot asmithbot deleted the pr/menu_item/emp29 branch June 14, 2026 20:11
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