Restore SD memory dialog-state dispatch mapping #637

Merged
coah80 merged 1 commits from agent/bittle/sd-memory-dispatch into main 2026-10-01 23:21:37 +00:00
coah80 commented 2026-10-01 23:18:52 +00:00 (Migrated from github.com)

Actual dispatch correction

The reconstructed SDMemory::calc instruction stream was exact, but seven case values selected the wrong instruction blocks in jumptable_816566BC.

Restore the original mapping without moving any handler block:

  • State 19 uses the block formerly labelled 13.
  • States 13–18 use the blocks formerly labelled 14–19, respectively.

The existing onDialogStateNN helper names are retained; their numeric suffixes came from the prior reconstruction's block labels. No symbol rename is bundled here.

  • Table destinations/addends/types: 19/26 → 26/26 exact (104 bytes).
  • Exactly seven .data relocations changed, all within this table.
  • Entire compiled .text is byte-for-byte unchanged; ctxdiff 154/154 instructions, zero differences.
  • String pool 90/90 identical; other unit data and code mismatches remain untouched.

Validation on freshly rebuilt efda1f00: full all_source, report and build/43U/ok pass; DOL SHA-1 26116613f624061ba99c8d1a299aaa6efa85670d. Workflow guards 7/7, pool tests 8/8, diff/worktree checks pass. Entire source .text and global report measures are unchanged; no aggregate percentage-gain claim. Unit remains NonMatching, so the linked DOL still uses the original object. No metadata, header, padding, forced-data or new-assembly changes. Left for Cole's review and merge.

Note

Restore SD memory dialog-state dispatch mapping for states 13-19

Changes the switch mapping in the SDMemory dialog-state dispatcher in iplSDMemory.cpp so states 13-19 route through a shifted handler mapping: states 13-18 now use the handler of the next state, and state 19 uses the former state-13 handler.

  • Behavioral Change: every dialog state 13-19 in SDMemory now invokes a different handler than before; check the switch cases in iplSDMemory.cpp if any dialog behaves differently.

Macroscope summarized 9c7fc43.

## Actual dispatch correction The reconstructed `SDMemory::calc` instruction stream was exact, but seven case values selected the wrong instruction blocks in **jumptable_816566BC**. Restore the original mapping without moving any handler block: - State **19** uses the block formerly labelled 13. - States **13–18** use the blocks formerly labelled 14–19, respectively. The existing `onDialogStateNN` helper names are retained; their numeric suffixes came from the prior reconstruction's block labels. No symbol rename is bundled here. - Table destinations/addends/types: **19/26 → 26/26 exact** (104 bytes). - Exactly **seven `.data` relocations changed**, all within this table. - Entire compiled `.text` is byte-for-byte unchanged; ctxdiff **154/154 instructions, zero differences**. - String pool **90/90 identical**; other unit data and code mismatches remain untouched. Validation on freshly rebuilt **efda1f00**: full `all_source`, report and `build/43U/ok` pass; DOL SHA-1 **26116613f624061ba99c8d1a299aaa6efa85670d**. Workflow guards **7/7**, pool tests **8/8**, diff/worktree checks pass. Entire source `.text` and global report measures are unchanged; no aggregate percentage-gain claim. Unit remains NonMatching, so the linked DOL still uses the original object. No metadata, header, padding, forced-data or new-assembly changes. 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 SD memory dialog-state dispatch mapping for states 13-19 > Changes the switch mapping in the SDMemory dialog-state dispatcher in [iplSDMemory.cpp](https://github.com/coah80/wii-ipl/pull/637/files#diff-b691a7e12d395598c85b32332e8aafb8c480896ce64f6bf0105e794571b68b9c) so states 13-19 route through a shifted handler mapping: states 13-18 now use the handler of the next state, and state 19 uses the former state-13 handler. > - Behavioral Change: every dialog state 13-19 in SDMemory now invokes a different handler than before; check the switch cases in `iplSDMemory.cpp` if any dialog behaves differently. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 9c7fc43.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-01 23:21:35 +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.