<feed xmlns='http://www.w3.org/2005/Atom'>
<title>npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/runtime/shims/acphal.cpp, branch feat/acphal-xma2-decoder</title>
<subtitle>[no description]</subtitle>
<id>https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=feat%2Facphal-xma2-decoder</id>
<link rel='self' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/atom?h=feat%2Facphal-xma2-decoder'/>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/'/>
<updated>2026-11-24T09:47:57+00:00</updated>
<entry>
<title>acphal: stabilize APU mappings and reuse XMA PCM storage</title>
<updated>2026-11-24T09:47:57+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T09:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=713eec5031a6a7d1b1626f090d742531007b28e5'/>
<id>urn:sha1:713eec5031a6a7d1b1626f090d742531007b28e5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>acphal: isolate voice failures and keep input transitions ordered</title>
<updated>2026-11-24T09:21:32+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T09:21:32+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=4e9407a409641b644393a66b41d35e431f1c5ddb'/>
<id>urn:sha1:4e9407a409641b644393a66b41d35e431f1c5ddb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>acphal: recover SHAPE allocation and preserve XMA stream state</title>
<updated>2026-11-24T08:27:55+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T08:27:55+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=0fe9c0bdfb844678209c0d0ffdd37d2533d1f57e'/>
<id>urn:sha1:0fe9c0bdfb844678209c0d0ffdd37d2533d1f57e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>acphal: synchronize XMA context words and bound the output ring</title>
<updated>2026-11-24T07:29:18+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T07:29:18+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=e02ec36bf315de960a9db244e971bf00cfd66406'/>
<id>urn:sha1:e02ec36bf315de960a9db244e971bf00cfd66406</id>
<content type='text'>
</content>
</entry>
<entry>
<title>acphal: preserve XMA packet chains and context lifetime</title>
<updated>2026-11-24T07:03:38+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T07:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=a99a3fb6ad419bf7f0a255d8b31fbd8112da1b39'/>
<id>urn:sha1:a99a3fb6ad419bf7f0a255d8b31fbd8112da1b39</id>
<content type='text'>
</content>
</entry>
<entry>
<title>acphal: decode XMA contexts with runtime/xma_decoder when cargo is available</title>
<updated>2026-11-24T06:53:37+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T06:53:37+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=cfcedb58e2802c5cd38afd1cbde877ae9d71c2a5'/>
<id>urn:sha1:cfcedb58e2802c5cd38afd1cbde877ae9d71c2a5</id>
<content type='text'>
Replace the hand-written C++ XMA2/WMA Pro decoder with the Rust decoder
already on main. runtime/CMakeLists.txt builds it at configure time when
cargo is on PATH and links it into gta6rt and acphal_test
(LEONIDA_HAVE_XMA2_DECODER); without cargo, if that build fails, or with
the cl.exe fallback, XMA voices output silence for each packet's frame
count.

The ring engine decodes whole 2048-byte packets: the read offset and the
loop points are used per packet, so a loop plays its end packet in full
and restarts with a fresh decoder at the packet holding the loop start.
The C ABI gains leonida_xma2_decoder_create_hardware (no first-frame drop,
no 64-sample start skip), since the context carries its own skip.

Tested: acphal_test 129 checks (silence) and 125 checks (Rust decoder,
gnullvm build), 0 failures, 3 runs each, clang 23 / mingw x64; cargo fmt
and cargo test (gnullvm); pytest build/docs suites 204 passed.

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>acphal: stop the XMA worker it was meant to stop</title>
<updated>2026-11-24T06:15:02+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T06:15:02+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=12536c2ab33072b8f49a8d012c970093c90c0866'/>
<id>urn:sha1:12536c2ab33072b8f49a8d012c970093c90c0866</id>
<content type='text'>
stop_worker set a shared stopping_ flag, moved the thread out and joined it
after releasing worker_mutex_. A wake in that window reset stopping_ and
started a second worker, so the old one kept running and the join could hang.
Each worker is now a std::jthread with its own stop_token (waits use
condition_variable_any with the token), so a stop only reaches its own thread.

acphal_test races 20000 context alloc/release rounds against ENABLE_XMA on a
second thread (the unfixed code hung there intermittently).

AI-assisted. Tested: acphal_test 115 checks, 0 failures, repeated runs
(clang 23 / mingw x64).

Co-Authored-By: Claude Opus 5.5 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>acphal: add portable XMA2 decoder, ACP message queue, and SHAPE XMA worker</title>
<updated>2026-11-24T04:44:00+00:00</updated>
<author>
<name>andretuta</name>
<email>andreviniciusmerlia@gmail.com</email>
</author>
<published>2026-11-24T04:44:00+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=4750df6a06e68c05343c5895f1d6dcddf61e38c3'/>
<id>urn:sha1:4750df6a06e68c05343c5895f1d6dcddf61e38c3</id>
<content type='text'>
- Add portable C++20 XMA2 packet parser and WMA Pro frame decoder
  (runtime/src/xma2_decoder.{h,cpp}, following FFmpeg wmaprodec.c /
  wmaprodata.h LGPL-2.1-or-later under Leonida's GPL-3.0-or-later)
  with cross-platform xma2_decoder_test.
- Implement IAcpHal command/message queue protocol (REGISTER_MESSAGES,
  UNREGISTER_MESSAGES, LOAD_FLOWGRAPH, COMMAND_COMPLETED, DISCONNECTED,
  queue-full dropped counters, and APU notification word writes) in
  runtime/shims/acphal.cpp.
- Wire a lazily-started, cleanly-joined background XMA2 decoder thread
  pumping enabled SHAPE_XMA_CONTEXT output rings in APU memory.
</content>
</entry>
<entry>
<title>runtime: give acphal's SHAPE contexts their GDK trailing words</title>
<updated>2026-11-24T00:29:22+00:00</updated>
<author>
<name>ExCorvus</name>
<email>73470689+ExCorvus@users.noreply.github.com</email>
</author>
<published>2026-11-24T00:29:22+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=db761be31041e1f9985d920a687e9e6952779fe9'/>
<id>urn:sha1:db761be31041e1f9985d920a687e9e6952779fe9</id>
<content type='text'>
ccd36246f added the GDK size checks, but the published field lists leave
SHAPE_XMA_CONTEXT at 60 bytes and SHAPE_PCM_CONTEXT at 28, so acphal.cpp fails
its static_asserts (C2338) and the runtime does not build. Each context has one
trailing reserved word in the GDK layout that the list omits: reserved[11] takes
the XMA context to 64 bytes and reserved[2] the PCM context to 32.

Tests: gta6rt links.

AI-assisted: DeepSeek V4.1 Flash 1017 (Alibaba Token Plan); coordinated by Qwen4 Max Preview.
</content>
</entry>
<entry>
<title>runtime: acphal.dll shim with APU heap management and SHAPE context allocation (RT-5, ASSET-587)</title>
<updated>2026-11-23T21:19:47+00:00</updated>
<author>
<name>Tortoche</name>
<email>corentinjanin31@gmail.com</email>
</author>
<published>2026-11-23T21:19:47+00:00</published>
<link rel='alternate' type='text/html' href='https://upleb.uk/npub1w4dsu3e6hzjehh7l3c9njhtwwtgk9g209ylqf4tvdn2m07xjq06se9ett9/Leonida/commit/?id=ccd36246f7f50dc6a5f1f30ff76418d570f12fa2'/>
<id>urn:sha1:ccd36246f7f50dc6a5f1f30ff76418d570f12fa2</id>
<content type='text'>
- Resolve Stop 28 boot blocker preventing GTA 6 from launching: acphal.dll!ApuCreateHeap and AcpHalAllocateShapeContexts.
- Implement genuine APU physical memory management (ApuCreateHeap, ApuAlloc, ApuFree, ApuIsVirtualAddressValid, ApuMapApuAddress, ApuMapVirtualAddress):
  - Support cached and non-cached heap allocations with flags routing (flags=2 to non-cached, flags=1/0 to cached).
  - Genuine block tracking allowing proper memory reclamation and reuse upon ApuFree.
  - Disjoint APU 32-bit physical address space mapping with round-trip address conversions.
- Implement IAcpHal interface in AcpHalCreate:
  - Slot 0 (connect): S_OK.
  - Slot 1 (disconnect): S_OK.
  - Slot 2 (submit_command): S_OK (unblocks fatal int3 at +0x43ad94e at boot).
  - Slots 3 and 4 (pop_message, get_num_messages): return 0.
  - Slot 5 (release): releases object.
- Implement GDK SHAPE_CONTEXTS and exact layout:
  - Six context counts and arrays: SRC, EQCOMP, FILTVOL, DMA, XMA, PCM.
  - Structure alignment with xmaContextArray at offset +0x38, matching retail executable measurement (350 contexts x 64 bytes).
  - AcpHalReleaseShapeContexts releases allocated context arrays.
- Classify acphal.dll HRESULT imports in registry.cpp and update unimplemented_policy_test.cpp.
- Add acphal_test in runtime/CMakeLists.txt and python verification test tests/test_acphal_abi.py.
- Update fallback file list in scripts/build_runtime.ps1.

No game data. AI-assisted.
</content>
</entry>
</feed>
