Repository navigation
Conversation
|
A review note on the AcpHal hardware object, from facts in sammwyy/xvalkyrie (GPL-3.0;
AI-assisted. |
|
Thanks, taken in 280ee42: slots 3 and 4 now return 0 instead of
Not run against the retail executable. AI-assisted (Claude Code). |
|
Tested on Windows 11 26300, MSVC 14.44, RelWithDebInfo, CPU only, no game files. Results
1.
Checked with a scratch guest that calls the registered function on a 0x40-byte block followed by 16 guard bytes, with the fifth count set to 350:
Writing 2. The branch also carries AI-assisted (Claude Code). |
|
Static check of the call sites at
That matches the PR's "What the call sites show" section. I cannot run the Windows ctest here, so this is a static confirmation only; the 28-check run remains the runtime evidence. No game data: counts, offsets and RVAs only. AI-assisted. |
devnull34
left a comment
There was a problem hiding this comment.
Hardware & Environment
- Host: Windows 11 Build 26300 x64
- Toolchain: MSVC 19.44 (Visual Studio 2022), CMake 4.4, Python 3.15
Verification Summary
Targets compiled with MSVC 19.44 and executed natively:
-
**\�cphal_test.exe**:
- Passed with 28 checks, 0 failures.
- Verified audio heap creation (\ApuCreateHeap), aligned allocations (\ApuAlloc), address validity checks, 32-bit APU-to-virtual address translations (\ApuMapVirtualAddress\ / \ApuMapApuAddress), shape context allocation/release, and no-op \AcpHalCreate\ object lifecycle (with message poll slots 3 and 4 answering 0 when empty).
-
**\xgameruntime_offline_test.exe\ & \xgameruntime_test.exe**:
- Passed with 143 checks OK.
- Verified \XAccessibilityImpl\ (closed captions, high contrast, synthesizer voice enumeration / creation stubs) and \XLauncherImpl\ (URI and title launches) offline interfaces.
-
CTest & Regression Tests:
- \�cphal: Passed (0.01s)
- \xgameruntime_offline: Passed (0.01s)
- \xgameruntime_offline_hdr: Passed (0.01s)
- Total: 3/3 passed (100%).
- \ ests/test_gdk_runtime_calls.py: 22/22 tests passed.
-
Hygiene & Compliance:
- Clean-room compliant: pure synthetic unit tests; zero game assets or proprietary code.
- \git diff origin/main..HEAD --check: Clean (0 whitespace/formatting defects).
LGTM!
280ee42 to
4bc4661
Compare
|
Thanks, both points were right and are fixed at
Tested on Windows 11, MSVC 19.44 (AMD Radeon RX 9070 XT, driver 32.0.32029.2010; no GPU used). Not run against the retail executable. AI-assisted (Claude Code). |
…g and a no-op hardware object
…l reads no message
shayderrr
left a comment
There was a problem hiding this comment.
Summary
Adds runtime/shims/acphal.cpp and runtime/test/acphal_test.cpp: nine AcpHal.dll imports (APU heap allocation/mapping, shape contexts, and a no-op AcpHal object) are registered, wired into CMake, and covered by tests. Also adds offline XAccessibilityImpl and XLauncherImpl classes, updates the shim registry and feature table, and documents all of it.
Why merge
This fills concrete executable imports that otherwise fail at runtime, modeling the APU heap and audio object with call shapes read from the executable while dropping commands on a PC. The companion offline GDK classes let early boot calls succeed, and both paths ship with dedicated tests and documentation.
Verdict: Approve
SummaryAdds Why mergeThis fills concrete executable imports that otherwise fail at runtime, modeling the APU heap and audio object with call shapes read from the executable while dropping commands on a PC. The companion offline GDK classes let early boot calls succeed, and both paths ship with dedicated tests and documentation. Verdict: Approve |
4bc4661 to
df9745b
Compare
|
Rebased onto main AI-assisted (Claude Code). |
|
Tested The rebase to
|
|
Tested
|
|
Wine data point for #6885: pass. Built
All nine Full Nothing from the executable was run: |
|
Tested
|
…it merges with main's xmem notes
|
New head
Not run against the retail executable. AI-assisted (Claude Code). |
Item:
AcpHal.dllshim (RT-5 follow-up), claimed in #6750 (comment)What the imports are for
AcpHal.dllis the console's audio hardware layer. The game executable imports nine functions from it (the list in #6715). TheApu*functions manage a heap of memory the audio processor reads, with 32-bit APU addresses for it.AcpHalCreatereturns the object the game sends commands through, andAcpHalAllocateShapeContextshands out the per-voice context records.What the call sites show (static read of the executable, nothing executed or mapped)
Each import has one thunk. There are 16 call sites in all:
ApuCreateHeap(1): a size in MiB shifted left by 20, then a byte count. The result is tested for failure, and failure stops the game.ApuAlloc(1): five arguments. The output pointer comes first. The APU-address out pointer is NULL, the alignment is 0x800 and the flags are 2. The result is not tested; the caller reads the output pointer straight after the call. The size is the non-cached heap size minus 16 KiB.ApuFree(1): one pointer, as a tail call at shutdown. The result is ignored.ApuIsVirtualAddressValid(4): a pointer and an alignment of 0x40, 0x80 or 0x800. The result is a bool in AL.ApuMapVirtualAddress(4): a pointer in, and a 32-bit value out that goes into a context field. One site can pass NULL.ApuMapApuAddress(2): a 32-bit value in, and a pointer out. The pointer is tested for NULL and then written through.AcpHalAllocateShapeContexts(1): one pointer to a struct. The caller zeroes six dwords and sets the fifth to 350. After the call it reads a pointer at +0x38 and clears count × 64 bytes there. No other code in the image touches the struct. Failure stops the game.AcpHalCreate(1): one out pointer. Failure stops the game. The game calls four vtable slots on the object:AcpHalReleaseShapeContexts(1): no argument registers are set up. The result is ignored.What each function does now
ApuCreateHeapcommits one block of ordinary memory for both sizes. A PC has no cached/non-cached split.ApuAllocandApuFreemanage that block first fit. A new allocation is zeroed. An APU address is a fixed nonzero base plus the offset into the block.ApuMapVirtualAddressandApuMapApuAddressconvert between the two by arithmetic. Anything outside the heap maps to 0 or NULL.ApuIsVirtualAddressValidreturns TRUE only for an address inside a live block whose APU address is a multiple of the alignment.AcpHalAllocateShapeContextsgives each nonzero count zeroed memory of count × 64 bytes and writes a NULL pointer for each zero count.AcpHalReleaseShapeContextsfrees that memory.AcpHalCreatereturns an object:Hypotheses:
Tests
acphal_test(new, ctestacphal): 29 checks, 28 pass. It resolves every export throughrt::shims::find. It calls them in the shapes and order of the call sites, and it calls the object through raw vtable slots 0, 2, 3, 4, 1 and 5.ctest -R "^(acphal|xmem|unimplemented_policy|pe_loader)$": 4 of 4 pass, run after the rebase on548ac1032.gta6rtbuilds with the new table.python -I tests/test_docs_repo_paths.py: OK.python -I scripts/check_no_game_data.py: exit 0.Not tested: it has not been run against the retail executable. No audio output either, because there is none.
Tested on Windows 11, MSVC 19.44.
AI-assisted (Claude Code).