Decompile hardware keyboard language selection #700

Merged
coah80 merged 1 commits from agent/bittle/hw-language-cpp into main 2026-10-02 00:43:23 +00:00
coah80 commented 2026-10-02 00:41:05 +00:00 (Migrated from github.com)

Replace HWKeyboard::setLanguage's 14-instruction assembly implementation with a typed C++ method selecting the existing EU/non-EU country map and calling HKBManager::SetCountry. Remove the two obsolete assembly-only extern aliases.

Shared-header changes are explicit: expose the existing HWKeyboard::setLanguage declaration to TIHWKEYBOARD_IMPLEMENTATION, and add the already-existing nonvirtual HKBManager::SetCountry(u8) declaration to the consumer-side class view. No layout, virtual ordering or method signature changes.

Verification, rebased on 824fe9fc:

  • Exact function: 14/14 instructions, ctxdiff 0; 56 code bytes now expressed in C++
  • Unit retains 10/10 exact functions and full linking
  • Clean rebuilt all source objects after the header changes; every unit's report measures remain identical to fresh main (zero regressions or score gains)
  • Full all_source/progress/report/ok; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
  • Empty string pools identical; .data 288/288 bytes and all 70 relocations exact
  • Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20; worktree and diff checks pass
  • Tested tree 5658d0337e equals remote tree

The existing data-report discrepancy remains disclosed by #698; no metadata or padding changes. Uses the previously disclosed local ctxdiff adapter. Left for Cole's review and merge.

Note

Decompile HWKeyboard::setLanguage PowerPC assembly to C++

Replaces the assembly stub for HWKeyboard::setLanguage in tiHwKeyboard.cpp with C++ logic: it picks the EU or non-EU country map based on DST_EU, indexes it by language, and calls the new public HKBManager::SetCountry with the result. Adds the SetCountry declaration to tiHKBManager.h and widens the preprocessor guard around setLanguage in tiHwKeyboard.h. Removes the obsolete external declarations for the mangled SetCountry and the HKBManager singleton.

Macroscope summarized e280c18.

Replace HWKeyboard::setLanguage's 14-instruction assembly implementation with a typed C++ method selecting the existing EU/non-EU country map and calling HKBManager::SetCountry. Remove the two obsolete assembly-only extern aliases. Shared-header changes are explicit: expose the existing HWKeyboard::setLanguage declaration to TIHWKEYBOARD_IMPLEMENTATION, and add the already-existing nonvirtual HKBManager::SetCountry(u8) declaration to the consumer-side class view. No layout, virtual ordering or method signature changes. Verification, rebased on 824fe9fc: - Exact function: 14/14 instructions, ctxdiff 0; 56 code bytes now expressed in C++ - Unit retains 10/10 exact functions and full linking - Clean rebuilt all source objects after the header changes; every unit's report measures remain identical to fresh main (zero regressions or score gains) - Full all_source/progress/report/ok; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d - Empty string pools identical; .data 288/288 bytes and all 70 relocations exact - Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20; worktree and diff checks pass - Tested tree 5658d0337e39108ead4357a0581d04c06d1129e7 equals remote tree The existing data-report discrepancy remains disclosed by #698; no metadata or padding changes. Uses the previously disclosed local ctxdiff adapter. 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::setLanguage` PowerPC assembly to C++ > Replaces the assembly stub for `HWKeyboard::setLanguage` in [tiHwKeyboard.cpp](https://github.com/coah80/wii-ipl/pull/700/files#diff-8cb43f83ff067681621db42405d3d111f67a100a45a59f5de0c354bbb8857879) with C++ logic: it picks the EU or non-EU country map based on `DST_EU`, indexes it by language, and calls the new public `HKBManager::SetCountry` with the result. Adds the `SetCountry` declaration to [tiHKBManager.h](https://github.com/coah80/wii-ipl/pull/700/files#diff-b72215db3bebc6cbf14fcbf7c06bf14a5f61645f8c7b2d95c624c2176463423c) and widens the preprocessor guard around `setLanguage` in [tiHwKeyboard.h](https://github.com/coah80/wii-ipl/pull/700/files#diff-69fa1d2d9d3ac165f31d7b6cbcad709704a966e41e619b31d83d17f75941c9cd). Removes the obsolete external declarations for the mangled `SetCountry` and the `HKBManager` singleton. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized e280c18.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 00:43:21 +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.