diff options
| author | andretuta <andreviniciusmerlia@gmail.com> | 2026-11-24 03:53:37 -0300 |
|---|---|---|
| committer | andretuta <andreviniciusmerlia@gmail.com> | 2026-11-24 03:53:37 -0300 |
| commit | cfcedb58e2802c5cd38afd1cbde877ae9d71c2a5 (patch) | |
| tree | aa73abcbd3f2fb1685127392ad8716717831c725 /runtime/xma_decoder/README.md | |
| parent | 12536c2ab33072b8f49a8d012c970093c90c0866 (diff) | |
acphal: decode XMA contexts with runtime/xma_decoder when cargo is available
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 <noreply@anthropic.com>
Diffstat (limited to 'runtime/xma_decoder/README.md')
| -rw-r--r-- | runtime/xma_decoder/README.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/runtime/xma_decoder/README.md b/runtime/xma_decoder/README.md index 4a6d5fb10..5ef66abbc 100644 --- a/runtime/xma_decoder/README.md +++ b/runtime/xma_decoder/README.md | |||
| @@ -17,3 +17,9 @@ cargo build --manifest-path runtime/xma_decoder/Cargo.toml --locked | |||
| 17 | ``` | 17 | ``` |
| 18 | 18 | ||
| 19 | The C++ smoke test is run by the xma2-decoder workflow with MSVC. It links ws2_32, userenv, and ntdll for Rust's Windows standard library. | 19 | The C++ smoke test is run by the xma2-decoder workflow with MSVC. It links ws2_32, userenv, and ntdll for Rust's Windows standard library. |
| 20 | |||
| 21 | ## Use in the runtime | ||
| 22 | |||
| 23 | `runtime/CMakeLists.txt` builds this crate at configure time when `cargo` is on `PATH` (the first build fetches the pinned `xma` git dependency) and links it into `gta6rt` and `acphal_test` with `LEONIDA_HAVE_XMA2_DECODER` defined. `runtime/shims/acphal.cpp` calls `leonida_xma2_decoder_create_hardware` once per XMA context and decodes whole 2048-byte packets, so loop points are rounded to packets. | ||
| 24 | |||
| 25 | Without `cargo`, when that build fails, or with the cl.exe fallback of `scripts/build_runtime.ps1`, XMA voices output silence. | ||