fix(keyboard): recover original cursor query evaluation order #1018

Merged
coah80 merged 1 commits from agent/bittle/cursor-query-order into main 2026-10-03 02:01:53 +00:00
coah80 commented 2026-10-03 02:01:30 +00:00 (Migrated from github.com)

Reconstruction

Use explicit cursor-Y and font-height locals for two onCursor expressions, preserving the original query order and floating-point operand order.

Independent evidence

Original DOL function base 0x8141FD14: calls at +0x334 and +0x5C0 target GetCursorY (0x8151813C); +0x340 and +0x5CC target GetFontHeight (0x81517EE8). The previous compiled source reverses each pair despite a 100% instruction score.

Parent independently verified:

  • All allocated code/data payload bytes identical; exactly four resolved call relocations corrected, after normalizing local symbol section/offset identities
  • Complete objdiff report unchanged, with no exact-code/data regressions
  • Both call sequences and FP operand order agree with original ELF and independently decoded DOL
  • 144 bounded compiled-sequence cases and 96 modeled callback distinctions
  • Native font-height implementation reads font state; no observed retail bug, arbitrary callback behavior or Wii runtime equivalence claim
  • Full 43U all_source/report/progress/DOL and worktree/diff checks pass

This is a source-correctness fix, not a percentage gain. No header/configuration/linking changes.

Base: e9c8986139
Tested tree: 6d39706c95
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d

No merge performed or requested by this author.

Note

Fix cursor query evaluation order in Base::onCursor

Restores the original evaluation order of the cursor-position query in Base::onCursor in tiInputForm.cpp. The bottom-edge expression in both the candidate-background and kana-background paths is split into cursor-Y and font-height locals that are then added together, producing the same value.

Macroscope summarized 2a55051.

## Reconstruction Use explicit cursor-Y and font-height locals for two onCursor expressions, preserving the original query order and floating-point operand order. ## Independent evidence Original DOL function base 0x8141FD14: calls at +0x334 and +0x5C0 target GetCursorY (0x8151813C); +0x340 and +0x5CC target GetFontHeight (0x81517EE8). The previous compiled source reverses each pair despite a 100% instruction score. Parent independently verified: - All allocated code/data payload bytes identical; exactly four resolved call relocations corrected, after normalizing local symbol section/offset identities - Complete objdiff report unchanged, with no exact-code/data regressions - Both call sequences and FP operand order agree with original ELF and independently decoded DOL - 144 bounded compiled-sequence cases and 96 modeled callback distinctions - Native font-height implementation reads font state; no observed retail bug, arbitrary callback behavior or Wii runtime equivalence claim - Full 43U all_source/report/progress/DOL and worktree/diff checks pass This is a source-correctness fix, not a percentage gain. No header/configuration/linking changes. Base: e9c89861396e5fc1fe79b84c74f3a79fd03237f0 Tested tree: 6d39706c950864b6959d40642a8c8d9003b40870 DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d No merge performed or requested by this author. <!-- 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] > ### Fix cursor query evaluation order in `Base::onCursor` > Restores the original evaluation order of the cursor-position query in `Base::onCursor` in [tiInputForm.cpp](https://github.com/coah80/wii-ipl/pull/1018/files#diff-35206cad0cbb3d42d7f5c03ef80e2d5f014b18d63e0bbff2d9f16111742ce06a). The bottom-edge expression in both the candidate-background and kana-background paths is split into cursor-Y and font-height locals that are then added together, producing the same value. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 2a55051.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 02:01:51 +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.