Skip to content

Grind main/menu_compa: 95.749% -> 95.864% (cast-faithfulness)#17664

Merged
asmithbot merged 1 commit into
mainfrom
pr/menu_compa/emp28
Jun 14, 2026
Merged

Grind main/menu_compa: 95.749% -> 95.864% (cast-faithfulness)#17664
asmithbot merged 1 commit into
mainfrom
pr/menu_compa/emp28

Conversation

@asmithbot

Copy link
Copy Markdown
Collaborator

Summary

CompaDraw line 295 SetColor passed the alpha as static_cast<signed char>, but the target binary emits a clrlwi r7, r0, 24 (unsigned-byte zero-extend) before the CColor(Uc,Uc,Uc,Uc) constructor call. Changing it to static_cast<unsigned char> reproduces that byte-mask.

Faithfulness: Ghidra ground truth (resources/ghidra-decomp-1-31-2026/80160edc_CompaDraw__8CMenuPcsFv.c) passes the alpha to __ct__6CColorFUcUcUcUc (4 unsigned-char params), and the sibling SetColor at line 341 already uses static_cast<unsigned char>. This makes the two consistent.

Gate

  • CompaDraw misalign 23 -> 21 (gate A: drops)
  • main/menu_compa unit fuzzy_match_percent 95.74943 -> 95.86367 (gate B: rises)
  • No other function regressed (CompaCtrl 15, CompaClose/Open 0, CompaInit 0 unchanged).

🤖 Generated with Claude Code

…rlwi byte-mask)

Line 295 SetColor passed the alpha as static_cast<signed char>, but the
target emits a clrlwi r7,r0,24 (unsigned-byte zero-extend) before the
CColor(Uc,Uc,Uc,Uc) constructor call (Ghidra 80160edc row ~571,
__ct__6CColorFUcUcUcUc 4th arg). The sibling SetColor at line 341 already
uses static_cast<unsigned char>; making line 295 consistent matches the
byte-mask the original emitted.

CompaDraw misalign 23 -> 21; unit fuzzy 95.749 -> 95.864.

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 (7fd58d6 - 9aca65a)

📈 1 improvement in an unmatched item
Unit Item Bytes Before After
main/menu_compa CMenuPcs::CompaDraw() +6 95.68% 95.88%

@asmithbot asmithbot merged commit 3a718db into main Jun 14, 2026
2 checks passed
@asmithbot asmithbot deleted the pr/menu_compa/emp28 branch June 14, 2026 19:45
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