Generate hardware keyboard vtable from C++ declarations #704

Merged
coah80 merged 1 commits from agent/bittle/hw-native-vtable into main 2026-10-02 00:59:33 +00:00
coah80 commented 2026-10-02 00:58:16 +00:00 (Migrated from github.com)

Remove HWKeyboard's hand-authored function-pointer vtable and its assembly-style extern aliases. Correct the TIHWKEYBOARD_IMPLEMENTATION class view so the compiler emits the original table itself:

  • Treat updateInput(int,...) as nonvirtual, matching the existing TIMANAGER/MYTIMANAGER views; the actual table's final slot is updateInput(HKBManager&)
  • Preserve the destructor's inline declaration in this view, as already declared for TIMANAGER; its definition remains in tiKeyboard.cpp

These shared-header changes affect declaration/code emission, with original layout and vtable slots verified from relocations. A first trial without the inline destructor declaration correctly failed to emit the vtable; the retained declarations emit it naturally.

Fresh verification on f4795462 (after #703):

  • Compiler-generated .data 288/288 bytes, all 70 relocation types/targets/addends exact, including all seven vtable function entries
  • Generated punctuation jump table 63/63 destinations exact
  • All existing function bodies and offsets unchanged; compiler emits one additional 4-byte STB_WEAK updateFromReceiver body, deduplicated at link
  • Unit retains 10/10 exact functions and full linking; all unit/global measures unchanged versus fresh main
  • Clean rebuilt every source object after header changes; full all_source/progress/report/ok passes
  • DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
  • Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20, diff/worktree checks pass
  • Tested local/remote tree 88cf825036

No score gain claimed and the existing data-report discrepancy remains. No fabricated padding, symbol-extent changes or new assembly. Left for Cole's review and merge.

Note

Generate hardware keyboard vtable from C++ declarations

Removes the manually emitted HWKeyboard vtable and its section-placement pragmas from tiHwKeyboard.cpp. The vtable is now produced from the class declaration in tiHwKeyboard.h. Also drops unused C-linkage declarations for HWKeyboard, Base, and CommandSender functions, plus the unused KeyboardDataFunction typedef.

  • Behavioral Change: under TIHWKEYBOARD_IMPLEMENTATION the destructor is now declared inline and the raw-input updateInput overload is non-virtual, changing the build/ABI layout.

Macroscope summarized 6df9b94.

Remove HWKeyboard's hand-authored function-pointer vtable and its assembly-style extern aliases. Correct the TIHWKEYBOARD_IMPLEMENTATION class view so the compiler emits the original table itself: - Treat updateInput(int,...) as nonvirtual, matching the existing TIMANAGER/MYTIMANAGER views; the actual table's final slot is updateInput(HKBManager&) - Preserve the destructor's inline declaration in this view, as already declared for TIMANAGER; its definition remains in tiKeyboard.cpp These shared-header changes affect declaration/code emission, with original layout and vtable slots verified from relocations. A first trial without the inline destructor declaration correctly failed to emit the vtable; the retained declarations emit it naturally. Fresh verification on f4795462 (after #703): - Compiler-generated .data 288/288 bytes, all 70 relocation types/targets/addends exact, including all seven vtable function entries - Generated punctuation jump table 63/63 destinations exact - All existing function bodies and offsets unchanged; compiler emits one additional 4-byte STB_WEAK updateFromReceiver body, deduplicated at link - Unit retains 10/10 exact functions and full linking; all unit/global measures unchanged versus fresh main - Clean rebuilt every source object after header changes; full all_source/progress/report/ok passes - DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d - Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20, diff/worktree checks pass - Tested local/remote tree 88cf825036f10f6d4fb479b381cead8fd271f3c1 No score gain claimed and the existing data-report discrepancy remains. No fabricated padding, symbol-extent changes or new assembly. 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] > ### Generate hardware keyboard vtable from C++ declarations > Removes the manually emitted `HWKeyboard` vtable and its section-placement pragmas from [tiHwKeyboard.cpp](https://github.com/coah80/wii-ipl/pull/704/files#diff-8cb43f83ff067681621db42405d3d111f67a100a45a59f5de0c354bbb8857879). The vtable is now produced from the class declaration in [tiHwKeyboard.h](https://github.com/coah80/wii-ipl/pull/704/files#diff-69fa1d2d9d3ac165f31d7b6cbcad709704a966e41e619b31d83d17f75941c9cd). Also drops unused C-linkage declarations for `HWKeyboard`, `Base`, and `CommandSender` functions, plus the unused `KeyboardDataFunction` typedef. > - Behavioral Change: under `TIHWKEYBOARD_IMPLEMENTATION` the destructor is now declared inline and the raw-input `updateInput` overload is non-virtual, changing the build/ABI layout. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 6df9b94.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 00:59:31 +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.