fix(ezitext): restore Chinese user-dictionary address contract #1046

Merged
coah80 merged 1 commits from agent/bittle/chinese-uwd-review into main 2026-10-03 04:55:35 +00:00
coah80 commented 2026-10-03 04:53:05 +00:00 (Migrated from github.com)

Source contract

Align the Chinese caller with exact Zi8GetZHuwdPtr: ziU32 return and ziU32* address output, local native address word, byte-pointer views at three real reads, and explicit byte status narrowing. Preserve the existing +3 entry advance and all control flow. The accepted one-key caller already uses this same native address contract.

Original callee writes a word through r3, a halfword through r4, and takes workspace in r5. The Chinese call passes stack+0x10c, stack+0x9a and workspace, then explicitly narrows the returned status. Independent original disassembly confirms these fixed-register roles and the callee's 56/56 exact instructions. No fuzzy percentage gain is claimed.

Independent verification

Rebased and tested on 140117ea91.

  • Full43U build/progress/report/DOL passed
  • Entire owned object byte-identical, including all symbols/relocations; all1,027 report units unchanged
  • All1,027 allocated object payloads/canonical relocations unchanged
  • Unit5/8 exact,4168/47816 matched code,144/536 matched data preserved
  • Pool empty/identical; literal audit all8 functions,0arguments,no skips/candidates/errors
  • DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
  • Worktree/diff checks pass; tested tree63f23b301c23b2eee79f038b0ac79384362e5602

Detailed evidence: tools/decomp-assist/allhands-ezitext-chinese-uwd-contract.attempts.md. No shared headers, extra locals, linking flags or other regions changed.

Note

Fix 32-bit Chinese user-dictionary address contract in zi8cgetc.c

Corrects the Zi8GetZHuwdPtr extern declaration to return a 32-bit unsigned value and take a pointer to a 32-bit address word. Inside zi8InternalGetZH, the user-dictionary address is now a 32-bit word; byte-pointer views are used only when reading entry bytes and the entry flag, and the per-entry increment stays at three bytes. Adds a report in allhands-ezitext-chinese-uwd-contract.attempts.md documenting the contract and validation. Risk: the public signature of Zi8GetZHuwdPtr changed, so any caller matching the old 8-bit/byte-pointer form must be updated.

Macroscope summarized 57874c0.

## Source contract Align the Chinese caller with exact Zi8GetZHuwdPtr: ziU32 return and ziU32* address output, local native address word, byte-pointer views at three real reads, and explicit byte status narrowing. Preserve the existing +3 entry advance and all control flow. The accepted one-key caller already uses this same native address contract. Original callee writes a word through r3, a halfword through r4, and takes workspace in r5. The Chinese call passes stack+0x10c, stack+0x9a and workspace, then explicitly narrows the returned status. Independent original disassembly confirms these fixed-register roles and the callee's 56/56 exact instructions. No fuzzy percentage gain is claimed. ## Independent verification Rebased and tested on 140117ea91c738e3f728883b0ca0d72e090fdd43. - Full43U build/progress/report/DOL passed - Entire owned object byte-identical, including all symbols/relocations; all1,027 report units unchanged - All1,027 allocated object payloads/canonical relocations unchanged - Unit5/8 exact,4168/47816 matched code,144/536 matched data preserved - Pool empty/identical; literal audit all8 functions,0arguments,no skips/candidates/errors - DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d - Worktree/diff checks pass; tested tree63f23b301c23b2eee79f038b0ac79384362e5602 Detailed evidence: tools/decomp-assist/allhands-ezitext-chinese-uwd-contract.attempts.md. No shared headers, extra locals, linking flags or other regions changed. <!-- 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 32-bit Chinese user-dictionary address contract in `zi8cgetc.c` > Corrects the `Zi8GetZHuwdPtr` extern declaration to return a 32-bit unsigned value and take a pointer to a 32-bit address word. Inside `zi8InternalGetZH`, the user-dictionary address is now a 32-bit word; byte-pointer views are used only when reading entry bytes and the entry flag, and the per-entry increment stays at three bytes. Adds a report in [allhands-ezitext-chinese-uwd-contract.attempts.md](https://github.com/coah80/wii-ipl/pull/1046/files#diff-f7e4ecb22c2c31f5223b93492b152e9503cd9f631fbd3456541bbeb0a9fb4ea0) documenting the contract and validation. Risk: the public signature of `Zi8GetZHuwdPtr` changed, so any caller matching the old 8-bit/byte-pointer form must be updated. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 57874c0.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-03 04:55:33 +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.