After the merge the tree held this branch's older states of files main maintains. Run against main's code,
tests/test_acphal_abi.py and 11 of the 15 translator tests that differed failed, and the C++ runtime would have
been built from two generations of its sources. So that the merge cannot break what main builds and tests:
- runtime/ is main's, file for file (68 files only this branch had are not carried over);
- every file under tools/, tests/ and docs/ that both sides have is main's (80 files);
- ten translator tests only this branch has, which test rules main's translator does not have, and their
fixtures are left out.
What main gains: d3d12/ (the Rust D3D12 runtime), its launchers and helpers (Launcher.bat, scripts/play*.ps1,
play-linux.sh, port_ctl.py, smooth-motion.ps1, fetch_vkd3d_proton.py, sync_victory.py), mods/example_lua, eleven
notes under docs/, seven tools and the tests that pass with main's code, the README's sections and credits, and
the "Runtime traps" section of AGENTS.md. Everything left out here is on the branch port/d3d12-nvidia.
Checked: compileall; make_game.py --help; check_no_game_data.py over every file this adds to main; the
line-ending, docs-encoding, CI-registration and docs tests; each test file that differs from main, on its own.
Not run: the whole translator suite, the C++ build, cargo over d3d12/ after the merge (d3d12/ is byte for byte the
branch's), CI.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ported from VIctory (victory/crates/victory-hle/src/modules/apu.rs, dsp.rs,
audio.rs; victory-formats/src/xma.rs), GPL-3.0-or-later, Marvisak and
contributors (DexNom fork), keeping its measured ABI: XApu records
(CommandId 0x18, Activate 0x38, Process 0x40, ApuResult 0x50), command
kinds, options and HRESULTs; XDsp StreamDesc 0x1c, Status 16, Command
0x20; IAcpHal slot order, 28-byte messages, command ids 1-3, 5-8, 18;
SHAPE_CONTEXTS 0x60.
- shims/xapu.cpp (xapu.dll): queues and results are real. PLACEHOLDER
decoding: no Opus decoder is in the repository (VIctory uses the
opus-pure crate), so a process command parses its packet
(src/opus_packet.h, RFC 6716 framing as libopus checks it) for its
frame count, output length and errors, and writes silence. Malformed
packets fail with BAD_PACKET; rate conversion stays E_NOTIMPL.
- shims/chad_dsp.cpp (chad.dll): completion (status words, tickets) is
real; convolutions and transforms output silence, as in VIctory.
- shims/acphal.cpp: the coprocessor acknowledges commands with VIctory's
messages (fmod waits for the first in System_Create; the old stub never
answered), sets notification words, and decodes enabled XMA contexts on
a thread into their rings. Context arrays get device addresses that map
back. Fixes: SHAPE_CONTEXTS is 0x60 (APU addresses are 32-bit; 120
bytes wrote 24 past the title's structure); AcpHalReleaseShapeContexts
writes nothing through its argument (the title passes a handle); the
non-cached heap's device addresses start on a 64 KiB boundary; state
the decoding thread reads is immortal.
- src/xma_decode.*, src/xma_tables.h: real XMA2 decoding (VIctory's port
of FFmpeg's WMA Pro decoder) with four fixes from VIctory's history
that the DexNom snapshot lacks (ba42db643, d4d182204, 03a6f2290,
4eb0898b3); src/xma_context.*: the context machine, with three more
(7a5d85e6a, 1054fe87d, 985d8d4b0).
Host output is unchanged: the title's middleware opens WASAPI through
COM (com_shim.cpp forwards CoCreateInstance to the host), as in VIctory.
Tests (CPU only, no game data, in CTest): xma (decoder against a
direct-sum IMDCT, VIctory's frame walk, noise and ring tests), xapu,
chad_dsp, and acphal extended (messages, notification words, the
decoding thread filling a ring). gta6rt --dry-run on 1.0.2.1 binds all
ten xapu/chad imports (unimplemented 11 -> 1: DStorageGetFactory).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>