Restore hardware-keyboard rodata table order #493

Merged
coah80 merged 1 commits from agent/bittle/hw-keyboard-data-order into main 2026-10-01 21:57:52 +00:00
coah80 commented 2026-10-01 21:54:23 +00:00 (Migrated from github.com)

Evidence

Follow-up to merged #486. The remaining hardware-keyboard .rodata mismatch is real source-token emission order: the two 12-byte country maps precede the 16-byte character-input template in source output, whereas the original puts the template first.

Move the existing country-map definitions after updateTriggerKey_ and before controlKeys. Keep their existing external symbol names with C linkage inside the namespace. No table values, function bodies or assembly change. This naturally emits the original order:

  • 16-byte typed KeyInputData initializer at 0x81616BC8
  • 12-byte maps at 0x81616BD8 and 0x81616BE4
  • 136-byte control-key map at 0x81616BF0

Fresh verification

Rebased on a348c977 (rebased again after concurrent main merges; includes #483, #485, #486 and #487). Independently rebuilt the owned source object, full 43U target and report against a fresh main report.

  • .rodata 176/176 bytes identical, score 90.909096% → 100%.
  • Unit matched data 296 → 472 / 504 bytes (58.73016% → 93.650795%).
  • All 10/10 functions, 4,596/4,596 code bytes remain exact in objdiff.
  • Affected consumers now also agree on actual relocation offsets: ctxdiff 405/405 (updateTriggerKey_) and 14/14 (setLanguage), both zero differences.
  • Global matched data 1,672,676 → 1,672,852 (+176); totals and link metrics unchanged. No previously exact-function or matched-data regression across the report.
  • Empty string pools identical; workflow guards 7/7, pool tests 8/8, diff/worktree checks pass.
  • Full build and build/43U/ok pass; SHA-1 26116613f624061ba99c8d1a299aaa6efa85670d.

Remains NonMatching. The remaining BSS/weak-static and sdata2 symbol-boundary issues are separate; an exploratory Matching flip did not pass the DOL gate and was reverted. No padding, forced data, weak-vtable removal, original binaries, or new assembly. Left for Cole's review and merge.

Note

Restore rodata table order for hardware keyboard controlKeys

Moves the definitions of lbl_81616BD8 and lbl_81616BE4 in tiHwKeyboard.cpp so they sit right before controlKeys, matching their original rodata layout. Both labels now use extern "C" linkage; their byte contents are unchanged. Behavioral Change: the two globals are emitted with C linkage names instead of C++ linkage names.

Macroscope summarized 8f216f4.

## Evidence Follow-up to merged #486. The remaining hardware-keyboard `.rodata` mismatch is real source-token emission order: the two 12-byte country maps precede the 16-byte character-input template in source output, whereas the original puts the template first. Move the existing country-map definitions after `updateTriggerKey_` and before `controlKeys`. Keep their existing external symbol names with C linkage inside the namespace. No table values, function bodies or assembly change. This naturally emits the original order: - 16-byte typed `KeyInputData` initializer at **0x81616BC8** - 12-byte maps at **0x81616BD8** and **0x81616BE4** - 136-byte control-key map at **0x81616BF0** ## Fresh verification Rebased on **a348c977** (rebased again after concurrent main merges; includes #483, #485, #486 and #487). Independently rebuilt the owned source object, full 43U target and report against a fresh main report. - `.rodata` **176/176 bytes identical**, score **90.909096% → 100%**. - Unit matched data **296 → 472 / 504 bytes** (**58.73016% → 93.650795%**). - All **10/10 functions, 4,596/4,596 code bytes** remain exact in objdiff. - Affected consumers now also agree on actual relocation offsets: ctxdiff **405/405** (`updateTriggerKey_`) and **14/14** (`setLanguage`), both **zero differences**. - Global matched data **1,672,676 → 1,672,852** (+176); totals and link metrics unchanged. No previously exact-function or matched-data regression across the report. - Empty string pools identical; workflow guards **7/7**, pool tests **8/8**, diff/worktree checks pass. - Full build and `build/43U/ok` pass; SHA-1 **26116613f624061ba99c8d1a299aaa6efa85670d**. Remains NonMatching. The remaining BSS/weak-static and sdata2 symbol-boundary issues are separate; an exploratory Matching flip did not pass the DOL gate and was reverted. No padding, forced data, weak-vtable removal, original binaries, 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] > ### Restore rodata table order for hardware keyboard `controlKeys` > Moves the definitions of `lbl_81616BD8` and `lbl_81616BE4` in [tiHwKeyboard.cpp](https://github.com/coah80/wii-ipl/pull/493/files#diff-8cb43f83ff067681621db42405d3d111f67a100a45a59f5de0c354bbb8857879) so they sit right before `controlKeys`, matching their original rodata layout. Both labels now use `extern "C"` linkage; their byte contents are unchanged. Behavioral Change: the two globals are emitted with C linkage names instead of C++ linkage names. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 8f216f4.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-01 21:57:49 +00:00 (Migrated from github.com)

Reviewed and merged. Clean rebuild: DOL sha1 unchanged, tiHwKeyboard 10/10 with matched data 472/504, .rodata order now real. Nice follow-up to #486. One note for later: the two maps still carry the pre-existing lbl_81616BD8/lbl_81616BE4 names; once nothing else depends on those exact names, giving them real ones (e.g. the country it maps) would be a good cleanup.

Reviewed and merged. Clean rebuild: DOL sha1 unchanged, tiHwKeyboard 10/10 with matched data 472/504, .rodata order now real. Nice follow-up to #486. One note for later: the two maps still carry the pre-existing lbl_81616BD8/lbl_81616BE4 names; once nothing else depends on those exact names, giving them real ones (e.g. the country it maps) would be a good cleanup.
Sign in to join this conversation.