Decompile system sound initialization #706

Merged
coah80 merged 1 commits from agent/bittle/system-sound-init-cpp into main 2026-10-02 01:07:39 +00:00
coah80 commented 2026-10-02 01:05:56 +00:00 (Migrated from github.com)

Replace System::constructSND_'s compiler-specific assembly branch with ordinary C++. Preserve the resource-buffer load before querying the sound heap's allocatable size, then initialize sound and set the loaded flag. The former non-MW fallback becomes the single implementation with explicit locals.

One source file only; no headers, metadata or compiler flags changed.

Fresh verification on f36411d4:

  • constructSND_: 29/29 instructions, ctxdiff 0; 116 bytes converted from assembly to C++
  • String pool 52/52 identical
  • Full all_source/progress/report/ok passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
  • Every unit/global report measure unchanged versus freshly built main; no score gain claimed
  • Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20; diff/worktree checks pass
  • Previously disclosed local ctxdiff compatibility adapter
  • Remote tree bb974103fb equals tested local tree

Left for Cole's review and merge.

Note

Decompile ipl::System::constructSND_ sound-system initialization

Replaces the PowerPC assembly and __MWERKS__ conditional compilation in ipl::System::constructSND_ with a single C++ implementation. It reads the SOUND resource buffer, computes the 32-byte-aligned heap allocation size, calls initOnMemory, and marks sound resources as loaded.

Risk: MWERKS builds now run the C++ path instead of the assembly path; check iplSystem.cpp if sound init behavior differs.

Macroscope summarized 8bd0e5b.

Replace System::constructSND_'s compiler-specific assembly branch with ordinary C++. Preserve the resource-buffer load before querying the sound heap's allocatable size, then initialize sound and set the loaded flag. The former non-MW fallback becomes the single implementation with explicit locals. One source file only; no headers, metadata or compiler flags changed. Fresh verification on f36411d4: - constructSND_: 29/29 instructions, ctxdiff 0; 116 bytes converted from assembly to C++ - String pool 52/52 identical - Full all_source/progress/report/ok passes; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d - Every unit/global report measure unchanged versus freshly built main; no score gain claimed - Workflow tests 7/7, pool tests 8/8, jump-table tests 20/20; diff/worktree checks pass - Previously disclosed local ctxdiff compatibility adapter - Remote tree bb974103fbc4324f91ff66198a6d5fb4da136360 equals tested local tree 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 `ipl::System::constructSND_` sound-system initialization > Replaces the PowerPC assembly and `__MWERKS__` conditional compilation in `ipl::System::constructSND_` with a single C++ implementation. It reads the SOUND resource buffer, computes the 32-byte-aligned heap allocation size, calls initOnMemory, and marks sound resources as loaded. > > Risk: MWERKS builds now run the C++ path instead of the assembly path; check [iplSystem.cpp](https://github.com/coah80/wii-ipl/pull/706/files#diff-4e1f0367e13ba9ed986fa7cd454ba96cf556f8995e8f4e5a00fe2f9604586196) if sound init behavior differs. > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 8bd0e5b.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
coah80 commented 2026-10-02 01:07:36 +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.