The title's own command line, and XMA2 source voices in XAudio2 #830
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/830"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 0xkn0wh3r3 on 2026-11-28T07:28:24Z.
Two gaps found by a stand-in title that checks the console runtime against what a retail Series X|S returns (vapordrive-probe: 100 checks, no game needed). Against
mainit matched 98 of 100 on both console models:GetCommandLineWgavevictory.exe's own line (victory run <exe> --execute ...). The C runtime's argv was already the title's, but a title that parses the command line itself, or takesWinMain'slpCmdLine, read our arguments instead of its own.XAUDIO2_E_INVALID_CALL):xaudio2_9.dllpasses through to the host's XAudio2, which has no XMA2.What changes
kernel:GetCommandLineW/A,_get_wide/_get_narrow_winmain_command_lineand__p__wcmdln/__p__acmdlngive a line made from the same list as argv, quoted so the MSVC runtime parses it back to that list. The processenvironment api-set is now served by the kernel module (only these two functions; the rest still pass through).xaudio2module:XAudio2Create(name and ordinal 1) andXAudio2CreateWithVersionInforeturn the host's engine with a copy of its vtable in whichCreateSourceVoiceis ours. A one-stream (mono or stereo) XMA2 voice becomes a 16-bit PCM voice of the same channels and rate, and itsSubmitSourceBufferdecodes each buffer withvictory_formats::xma(the same frame walk as the decoder's reference tests), keeps play and loop regions inside the decoded length, and submits the PCM. Decoded buffers are freed onceGetStatesays the host is done with them, or atDestroyVoice. Everything else, including the host's own virtual calls, reaches the host's functions.Tested
cargo test -p victory-hle: all pass, with new tests for the command line (parsed back with the MSVC rules: quotes, backslashes before quotes, empty arguments, a program path with spaces) and the XMA2 format checks.cargo xtask policypasses.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.