upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTortoche <corentinjanin31@gmail.com>2026-11-23 22:19:47 +0100
committerTortoche <corentinjanin31@gmail.com>2026-11-23 22:19:47 +0100
commitccd36246f7f50dc6a5f1f30ff76418d570f12fa2 (patch)
treee848016ed4bf9f6de308faa16f84a50f6a681e6e /scripts
parent5d74c272363f2703265d44e6aaab1a1df8ddfaf3 (diff)
runtime: acphal.dll shim with APU heap management and SHAPE context allocation (RT-5, ASSET-587)
- 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.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build_runtime.ps14
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/build_runtime.ps1 b/scripts/build_runtime.ps1
index 2fd5120cc..324e0ea48 100644
--- a/scripts/build_runtime.ps1
+++ b/scripts/build_runtime.ps1
@@ -1,4 +1,4 @@
1# Builds runtime\build\gta6rt.exe with MSVC at BelowNormal priority, on half the cores by default. 1# Builds runtime\build\gta6rt.exe with MSVC at BelowNormal priority, on half the cores by default.
2# Uses VS's CMake + Ninja when the "C++ CMake tools" component is installed (or native Windows cmake + ninja on PATH), 2# Uses VS's CMake + Ninja when the "C++ CMake tools" component is installed (or native Windows cmake + ninja on PATH),
3# otherwise calls cl.exe directly. 3# otherwise calls cl.exe directly.
4# The GameInput controller shim (SDL3, docs/gameinput.md) is built only on the CMake path: with an installed SDL3, or 4# The GameInput controller shim (SDL3, docs/gameinput.md) is built only on the CMake path: with an installed SDL3, or
@@ -81,7 +81,7 @@ $build || exit /b 1
81 Write-Warning "CMake and Ninja weren't found (neither VS C++ CMake tools nor native PATH tools): building with cl.exe directly, without the GameInput shim (SDL3). Install CMake + Ninja or VS's CMake tools component to get it." 81 Write-Warning "CMake and Ninja weren't found (neither VS C++ CMake tools nor native PATH tools): building with cl.exe directly, without the GameInput shim (SDL3). Install CMake + Ninja or VS's CMake tools component to get it."
82 $xtaskqueueDir = Join-Path $root "third_party\xtaskqueue" 82 $xtaskqueueDir = Join-Path $root "third_party\xtaskqueue"
83 $xtaskqueueFiles = "Source\Task\TaskQueue.cpp", "Source\Task\AsyncLib.cpp", "Source\Task\ThreadPool_win32.cpp", "Source\Task\WaitTimer_win32.cpp" | ForEach-Object { "`"$xtaskqueueDir\$_`"" } 83 $xtaskqueueFiles = "Source\Task\TaskQueue.cpp", "Source\Task\AsyncLib.cpp", "Source\Task\ThreadPool_win32.cpp", "Source\Task\WaitTimer_win32.cpp" | ForEach-Object { "`"$xtaskqueueDir\$_`"" }
84 $files = "src\main.cpp", "src\pe_loader.cpp", "shims\registry.cpp", "shims\file_system.cpp", "shims\xmem.cpp", "shims\d3d12_xs.cpp", "shims\d3d12_xs_device.cpp", "shims\d3d12_xs_rootsig.cpp", "shims\xgameruntime.cpp", "shims\xgameruntime_user.cpp", "shims\xgameruntime_gamesave.cpp", "shims\xgameruntime_store.cpp", "shims\xgameruntime_offline.cpp", "shims\winhttp_offline.cpp", "shims\library_loader.cpp", "shims\process.cpp" | ForEach-Object { "`"$src\$_`"" } 84 $files = "src\main.cpp", "src\pe_loader.cpp", "shims\registry.cpp", "shims\file_system.cpp", "shims\xmem.cpp", "shims\xg_xs.cpp", "shims\acphal.cpp", "shims\d3d12_xs.cpp", "shims\d3d12_xs_device.cpp", "shims\d3d12_xs_rootsig.cpp", "shims\xgameruntime.cpp", "shims\xgameruntime_user.cpp", "shims\xgameruntime_gamesave.cpp", "shims\xgameruntime_store.cpp", "shims\xgameruntime_offline.cpp", "shims\winhttp_offline.cpp", "shims\library_loader.cpp", "shims\process.cpp" | ForEach-Object { "`"$src\$_`"" }
85 $includes = "/I `"$src\src`" /I `"$src\shims`" /I `"$src\shims\xtaskqueue`" /I `"$xtaskqueueDir\Include`" /I `"$xtaskqueueDir\Source\Task`" /I `"$xtaskqueueDir\Source\Common`"" 85 $includes = "/I `"$src\src`" /I `"$src\shims`" /I `"$src\shims\xtaskqueue`" /I `"$xtaskqueueDir\Include`" /I `"$xtaskqueueDir\Source\Task`" /I `"$xtaskqueueDir\Source\Common`""
86 $opt = if ($Debug) { "/Od /MDd" } else { "/O2 /MD" } 86 $opt = if ($Debug) { "/Od /MDd" } else { "/O2 /MD" }
87 $body = @" 87 $body = @"