Skip to content

mesmenu: 95.61% -> 97.00% - #17671

Open
SirEnkido wants to merge 4 commits into
zcanann:mainfrom
SirEnkido:agent/mesmenu
Open

mesmenu: 95.61% -> 97.00%#17671
SirEnkido wants to merge 4 commits into
zcanann:mainfrom
SirEnkido:agent/mesmenu

Conversation

@SirEnkido

Copy link
Copy Markdown

What changed

All within CMesMenu::onDraw (src/mesmenu.cpp):

  • unsigned → signed conversion for the icon frame index
  • rewrote the branchless bit-mask frame-offset math as the ternary selects the target codegen implies — keeping the exact mix of condition forms that matches ((frameMask & 2) ? … vs ((frameMask & 2) != 0) ? …); the inconsistency is what the target emits, not a style choice
  • split the fused wave-drift expression into named driftX/driftY temporaries
  • converted the end-of-function state check to a switch (single-case; the if-form does not reproduce the target's dispatch shape — this was measured, not guessed)
  • follow-up commit: replaced the raw (char*)this + 0x3CB8/0x3CBC/0x3D34/0x3D3C/0x3D40 casts in the state-1 DrawRect with real member access (m_mes.mBaseX/mBaseY/mRubyHeight/mRubyY/mRubySpacing), enabled by friend class CMesMenu; in include/ffcc/mes.h — verified byte-identical (DOL sha1 unchanged)

Evidence

  • main/mesmenu fuzzy (report.json): 95.61% → 97.00% (96.996864)
  • build/GCCP01/ok passes; DOL sha1 matches config/GCCP01/build.sha1
  • Rebuilt in a clean worktree and independently re-verified before submission

Notes for review

  • The friend declaration touches the shared include/ffcc/mes.h; codegen impact is zero (byte-identical DOL). Inline accessors were the alternative but are more invasive.
  • Pre-existing raw this-offset accesses remain in a different function of this file (~lines 1037–1113, several reaching into m_mes); left for a follow-up to keep this PR reviewable.

Produced by Claude agents following AGENTS.md / WORK_SPLIT.md, operated by @SirEnkido. Every intermediate score in the commit messages was verified against report.json at commit time; the final state was re-verified independently.

🤖 Generated with Claude Code

SirEnkido and others added 4 commits July 17, 2026 21:20
…masks, de-fused wave drift, state switch)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…vs !=0)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s (friend CMesMenu; 97.00% unchanged, DOL byte-identical)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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