Decompile hardware keyboard input dispatch #701

Merged
coah80 merged 1 commits from agent/bittle/hw-input-cpp into main 2026-10-02 00:51:53 +00:00
coah80 commented 2026-10-02 00:48:40 +00:00 (Migrated from github.com)

Replace the 122-instruction hardware-keyboard updateInput assembly with readable C++. It checks sign-window activity, processes control-key OK/cancel shortcuts, then repeat/trigger/shift-tapping handlers and shift state. The existing controlKeyTriggeredHandler declaration is corrected to return bool and accept HKBManager by reference, matching its inlined use. Remove nine obsolete assembly-only extern aliases.

Shared header: include/keyboard/tiHwKeyboard.h changes only that private nonvirtual helper declaration. No field layout or virtual ordering changes. The helper is a normal inline C++ implementation; no assembly, forced-register or undefined-value workaround added.

Fresh verification on 3c9af06f (includes #700):

  • updateInput: 122/122 instructions, ctxdiff 0; 488 bytes converted to C++
  • Unit remains 10/10 exact functions and fully linked
  • Clean rebuilt every source object after header changes; all unit/global report measures identical to fresh main
  • Full all_source/progress/report/ok and DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
  • Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20; diff/worktree checks pass
  • Local ctxdiff compatibility adapter as previously disclosed
  • Tested local/remote tree 23d48effe31967f16b0195fe6f0c916bee851f04

No aggregate matching/link score gain claimed because the prior assembly was already exact; data-score caveat remains as documented in #698. Left for Cole's review and merge.

Note

Decompile HWKeyboard::updateInput and control key dispatch to C++

  • Replaces the PowerPC assembly implementation of HWKeyboard::updateInput with a C++ member definition that processes control keys, repeated keys, and triggered keys in order, and uses tapping-shift only when those paths do not handle input
  • Adds HWKeyboard::controlKeyTriggeredHandler, which maps keys 0x28/0x58 to toolbar OK and 0x29/0x2A to toolbar cancel, and reports whether an action was handled
  • Risk: updateInput is defined with a boolean return in tiHwKeyboard.cpp but still declared void in tiHwKeyboard.h, so the shown code does not compile as a consistent class definition

Macroscope summarized fb2b605.

Replace the 122-instruction hardware-keyboard updateInput assembly with readable C++. It checks sign-window activity, processes control-key OK/cancel shortcuts, then repeat/trigger/shift-tapping handlers and shift state. The existing controlKeyTriggeredHandler declaration is corrected to return bool and accept HKBManager by reference, matching its inlined use. Remove nine obsolete assembly-only extern aliases. Shared header: include/keyboard/tiHwKeyboard.h changes only that private nonvirtual helper declaration. No field layout or virtual ordering changes. The helper is a normal inline C++ implementation; no assembly, forced-register or undefined-value workaround added. Fresh verification on 3c9af06f (includes #700): - updateInput: 122/122 instructions, ctxdiff 0; 488 bytes converted to C++ - Unit remains 10/10 exact functions and fully linked - Clean rebuilt every source object after header changes; all unit/global report measures identical to fresh main - Full all_source/progress/report/ok and DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d - Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20; diff/worktree checks pass - Local ctxdiff compatibility adapter as previously disclosed - Tested local/remote tree 23d48effe31967f16b0195fe6f0c916bee851f04 No aggregate matching/link score gain claimed because the prior assembly was already exact; data-score caveat remains as documented in #698. Left for Cole's review and merge. <!-- Macroscope's pull request summary starts here --> <!-- Macroscope will only edit the content between these invisible markers, and the markers themselves will not be visible in the GitHub rendered markdown. --> <!-- If you delete either of the start / end markers from your PR's description, Macroscope will append its summary at the bottom of the description. --> > [!NOTE] > ### Decompile `HWKeyboard::updateInput` and control key dispatch to C++ > - Replaces the PowerPC assembly implementation of `HWKeyboard::updateInput` with a C++ member definition that processes control keys, repeated keys, and triggered keys in order, and uses tapping-shift only when those paths do not handle input > - Adds `HWKeyboard::controlKeyTriggeredHandler`, which maps keys 0x28/0x58 to toolbar OK and 0x29/0x2A to toolbar cancel, and reports whether an action was handled > - Risk: `updateInput` is defined with a boolean return in [tiHwKeyboard.cpp](https://github.com/coah80/wii-ipl/pull/701/files#diff-8cb43f83ff067681621db42405d3d111f67a100a45a59f5de0c354bbb8857879) but still declared void in [tiHwKeyboard.h](https://github.com/coah80/wii-ipl/pull/701/files#diff-69fa1d2d9d3ac165f31d7b6cbcad709704a966e41e619b31d83d17f75941c9cd), so the shown code does not compile as a consistent class definition > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized fb2b605.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 00:51:28 +00:00 (Migrated from github.com)

Rebased unchanged patch onto 426555a3 after main advanced during publication. Fresh full all_source/progress/report/ok and DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d pass; all unit/global measures identical to fresh main. New head fb2b60534b, tested tree 70a766569b.

Rebased unchanged patch onto 426555a3 after main advanced during publication. Fresh full all_source/progress/report/ok and DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d pass; all unit/global measures identical to fresh main. New head fb2b60534ba864b86d64e175b599ebe274375318, tested tree 70a766569ba19717e6b8cf9bf683b6a7a3a21b84.
coah80 commented 2026-10-02 00:51:50 +00:00 (Migrated from github.com)

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.

Reviewed and merged: rebased on main, full build ok, DOL sha1 26116613f624061ba99c8d1a299aaa6efa85670d, 0 regressions, 0 forbidden patterns.
Sign in to join this conversation.