Match ODH flash buffer #33

Merged
coah80 merged 1 commits from codex/worker-odh-flash-buffer-20260921 into main 2026-09-21 21:53:59 +00:00
coah80 commented 2026-09-21 21:53:48 +00:00 (Migrated from github.com)

Adds the source-level ODH bit-buffer flush implementation and the missing master fields it uses.

Validation against current origin/main:

  • cdj_c_flashBuffer: 188/188 exact bytes, 100.0% objdiff
  • ctxdiff: 47/47 instructions, 0 differences
  • Full 43U build passed
  • DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
  • ODH exact code: 444/14684 -> 632/14684 bytes, 7/28 -> 8/28 functions

Note

Add cdj_c_flashBuffer to flush ODH compressed bit-buffer output

  • Adds four 32-bit fields (bit buffer, bit count, output position, remaining output capacity) to SArCDJ_OdhMaster in odh.cpp, replacing part of the opaque padding
  • Implements CArGBAOdh::cdj_c_flashBuffer, which appends seven set bits to the master bit buffer, emits buffered bytes while the bit count is ≤ 0x18, and pads output to a four-byte boundary with 0xFF
  • Returns ODH_ERROR_80000004 when output capacity reaches zero during emission

Macroscope summarized 2d3dee5.

Adds the source-level ODH bit-buffer flush implementation and the missing master fields it uses. Validation against current origin/main: - `cdj_c_flashBuffer`: 188/188 exact bytes, 100.0% objdiff - `ctxdiff`: 47/47 instructions, 0 differences - Full 43U build passed - DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d` - ODH exact code: 444/14684 -> 632/14684 bytes, 7/28 -> 8/28 functions <!-- 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] > ### Add `cdj_c_flashBuffer` to flush ODH compressed bit-buffer output > - Adds four 32-bit fields (`bit buffer`, `bit count`, `output position`, `remaining output capacity`) to `SArCDJ_OdhMaster` in [odh.cpp](https://github.com/coah80/wii-ipl/pull/33/files#diff-b4f1b2d49e5f2d6b0344fe0cf5528d2c74bc8636b899f934fb61d6ad06d091c4), replacing part of the opaque padding > - Implements `CArGBAOdh::cdj_c_flashBuffer`, which appends seven set bits to the master bit buffer, emits buffered bytes while the bit count is ≤ 0x18, and pads output to a four-byte boundary with `0xFF` > - Returns `ODH_ERROR_80000004` when output capacity reaches zero during emission > > <!-- Macroscope's review summary starts here --> > > <sup><a href="https://app.macroscope.com">Macroscope</a> summarized 2d3dee5.</sup> > <!-- Macroscope's review summary ends here --> > <!-- Macroscope's pull request summary ends here -->
Sign in to join this conversation.