From 99c98749dcf74fc8d4036e2f72a0a254e5bdfff7 Mon Sep 17 00:00:00 2001 From: Mike7581 <168859477+Mike7581@users.noreply.github.com> Date: Wed, 25 Nov 2026 00:00:02 -0300 Subject: [PATCH 1/4] runtime/README: AcpHal, chad, xapu and XCRDAPI have shims; DStorage decodes BCPack (DOC-RUNTIME-README-SHIMS) The compat-modules section still said those four console DLLs have no shim here, and the DirectStorage entry said BCPack, swizzle and physical-page requests are not done. shims/acphal.cpp, chad.cpp, xapu.cpp and dstorage.cpp exist, and docs/directstorage.md describes the BCPack decoder, macro-unshuffle and xmem physical-page resolution. The 867d922 measurement is kept and marked as taken before those shims. Co-Authored-By: Claude Opus 5.5 --- runtime/README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/runtime/README.md b/runtime/README.md index fadaa47ef..93bd42533 100644 --- a/runtime/README.md +++ b/runtime/README.md @@ -114,9 +114,11 @@ folder that Windows refuses to load stops the run with the error code. Unset or loaded for the process lifetime. Only static imports go through this step; a run-time `LoadLibrary` of the same name does not yet. -It exists for drop-in implementations of console DLLs that have no shim here, such as the `AcpHal`, `chad`, `xapu` -and `XCRDAPI` crates of [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator) (GPL-3.0-or-later). -Measured on the 1.0.2.1 executable at `867d922`: without the folder, `--dry-run` leaves 20 imports unimplemented +It exists for drop-in implementations of console DLLs, such as the `AcpHal`, `chad`, `xapu` and `XCRDAPI` crates +of [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator) (GPL-3.0-or-later). All four modules now +have a shim here as well (`shims/acphal.cpp`, `shims/chad.cpp`, `shims/xapu.cpp`, and `shims/dstorage.cpp` for +`xcrdapi.dll`); a DLL in the folder replaces its module's shim, as above. Measured on the 1.0.2.1 executable at +`867d922`, before those shims: without the folder, `--dry-run` leaves 20 imports unimplemented (AcpHal 9, chad 5, xapu 5, XCRDAPI 1); with those four DLLs built from `f89e410`, it leaves 0, with the four package DLLs still mapped (`module=72`). Those DLLs run static initializers when Windows loads them, and with the defaults one of them hooks the process: the package DLLs mapped after it then fail to map. With @@ -275,7 +277,9 @@ Current limits, by design: (`shims/dstorage.cpp`, declarations in `shims/dstorage_xs_abi.h`). Files open through the `GAME:` mapping and the overlay; each queue reads file or memory ranges into memory in order on its own worker thread, inflating zlib requests (RFC 1950, `src/shader_library.h`'s inflater), and reports through status arrays, `ID3D12Fence` signals - and events. BCPack, swizzle and physical-page requests are not done yet. + and events. BCPack requests are decoded by `src/bcpack.cpp` (BC1, BC3, BC4, BC5, BC6H and BC7; BC2 has no decoder + yet and returns `E_NOTIMPL`), followed by the optional macro-unshuffle (swizzle), and physical page numbers resolve + through `xmem` when the request runs. See [docs/directstorage.md](../docs/directstorage.md) for the ABI evidence and what is unverified. - `gameinput.dll` / `xgameruntime.dll` — `GameInputCreate`: the v0 GameInput API for gamepads on SDL3 From 4ad6d3f5ea92ebe9758af671e5a3d8bb03a6c2f8 Mon Sep 17 00:00:00 2001 From: Mike7581 <168859477+Mike7581@users.noreply.github.com> Date: Wed, 25 Nov 2026 14:24:36 -0300 Subject: [PATCH 2/4] runtime/README: xapu and chad are served by shims/xapu_chad.cpp; note LEONIDA_DSTORAGE_EXTENDED=0 Review follow-up for #1517: the runtime target links shims/xapu_chad.cpp for both xapu.dll and chad.dll (shims/xapu.cpp and shims/chad.cpp only build for their ABI tests), and LEONIDA_DSTORAGE_EXTENDED=0 makes BCPack, swizzle and physical-page requests return E_NOTIMPL (shims/dstorage.cpp validate_request). --- runtime/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/runtime/README.md b/runtime/README.md index 93bd42533..751f4b875 100644 --- a/runtime/README.md +++ b/runtime/README.md @@ -116,9 +116,9 @@ does not yet. It exists for drop-in implementations of console DLLs, such as the `AcpHal`, `chad`, `xapu` and `XCRDAPI` crates of [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator) (GPL-3.0-or-later). All four modules now -have a shim here as well (`shims/acphal.cpp`, `shims/chad.cpp`, `shims/xapu.cpp`, and `shims/dstorage.cpp` for -`xcrdapi.dll`); a DLL in the folder replaces its module's shim, as above. Measured on the 1.0.2.1 executable at -`867d922`, before those shims: without the folder, `--dry-run` leaves 20 imports unimplemented +have a shim here as well (`shims/acphal.cpp`, `shims/xapu_chad.cpp` for both `xapu.dll` and `chad.dll`, and +`shims/dstorage.cpp` for `xcrdapi.dll`); a DLL in the folder replaces its module's shim, as above. Measured on the +1.0.2.1 executable at `867d922`, before those shims: without the folder, `--dry-run` leaves 20 imports unimplemented (AcpHal 9, chad 5, xapu 5, XCRDAPI 1); with those four DLLs built from `f89e410`, it leaves 0, with the four package DLLs still mapped (`module=72`). Those DLLs run static initializers when Windows loads them, and with the defaults one of them hooks the process: the package DLLs mapped after it then fail to map. With @@ -279,7 +279,8 @@ Current limits, by design: requests (RFC 1950, `src/shader_library.h`'s inflater), and reports through status arrays, `ID3D12Fence` signals and events. BCPack requests are decoded by `src/bcpack.cpp` (BC1, BC3, BC4, BC5, BC6H and BC7; BC2 has no decoder yet and returns `E_NOTIMPL`), followed by the optional macro-unshuffle (swizzle), and physical page numbers resolve - through `xmem` when the request runs. + through `xmem` when the request runs. These paths are on by default; `LEONIDA_DSTORAGE_EXTENDED=0` makes requests + that use BCPack, swizzle or physical page lists return `E_NOTIMPL`. See [docs/directstorage.md](../docs/directstorage.md) for the ABI evidence and what is unverified. - `gameinput.dll` / `xgameruntime.dll` — `GameInputCreate`: the v0 GameInput API for gamepads on SDL3 From 1f8ccc6ff4da45c831bd0095ecebd38985f3704d Mon Sep 17 00:00:00 2001 From: Mike7581 <168859477+Mike7581@users.noreply.github.com> Date: Wed, 25 Nov 2026 14:35:49 -0300 Subject: [PATCH 3/4] runtime/README: DStorage requests fail with E_NOTIMPL when the queue processes them EnqueueRequest returns void; validate_request runs on the queue worker (execute_request and prepare_in_background), so BC2 and, with LEONIDA_DSTORAGE_EXTENDED=0, BCPack, swizzle and page-list requests fail there rather than returning the error. --- runtime/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/runtime/README.md b/runtime/README.md index 751f4b875..4e2ddd872 100644 --- a/runtime/README.md +++ b/runtime/README.md @@ -277,10 +277,11 @@ Current limits, by design: (`shims/dstorage.cpp`, declarations in `shims/dstorage_xs_abi.h`). Files open through the `GAME:` mapping and the overlay; each queue reads file or memory ranges into memory in order on its own worker thread, inflating zlib requests (RFC 1950, `src/shader_library.h`'s inflater), and reports through status arrays, `ID3D12Fence` signals - and events. BCPack requests are decoded by `src/bcpack.cpp` (BC1, BC3, BC4, BC5, BC6H and BC7; BC2 has no decoder - yet and returns `E_NOTIMPL`), followed by the optional macro-unshuffle (swizzle), and physical page numbers resolve - through `xmem` when the request runs. These paths are on by default; `LEONIDA_DSTORAGE_EXTENDED=0` makes requests - that use BCPack, swizzle or physical page lists return `E_NOTIMPL`. + and events. BCPack requests are decoded by `src/bcpack.cpp` (BC1, BC3, BC4, BC5, BC6H and BC7; BC2 requests fail + with `E_NOTIMPL` because no decoder is available yet), followed by the optional macro-unshuffle (swizzle), and + physical page numbers resolve through `xmem` when the request runs. These paths are on by default; with + `LEONIDA_DSTORAGE_EXTENDED=0`, requests that use BCPack, swizzle or physical page lists fail with `E_NOTIMPL` + when the queue processes them. See [docs/directstorage.md](../docs/directstorage.md) for the ABI evidence and what is unverified. - `gameinput.dll` / `xgameruntime.dll` — `GameInputCreate`: the v0 GameInput API for gamepads on SDL3 From c8fabf8fb40ff13612929f927fe65593c303c806 Mon Sep 17 00:00:00 2001 From: Mike7581 <168859477+Mike7581@users.noreply.github.com> Date: Thu, 26 Nov 2026 16:24:06 -0300 Subject: [PATCH 4/4] runtime/README: xapu.dll is served by shims/xapu_queue.cpp, chad.dll by shims/xapu_chad.cpp Since #1144 merged (via #2350), xapu_chad.cpp serves only chad.dll and xapu.dll comes from xapu_queue.cpp, which runtime/CMakeLists.txt links into gta6rt and build_runtime.ps1's cl.exe fallback compiles. Wording from nicoco23's review. --- runtime/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/README.md b/runtime/README.md index 4e2ddd872..c99411660 100644 --- a/runtime/README.md +++ b/runtime/README.md @@ -116,12 +116,12 @@ does not yet. It exists for drop-in implementations of console DLLs, such as the `AcpHal`, `chad`, `xapu` and `XCRDAPI` crates of [omonkeyz/xbox-emulator](https://github.com/omonkeyz/xbox-emulator) (GPL-3.0-or-later). All four modules now -have a shim here as well (`shims/acphal.cpp`, `shims/xapu_chad.cpp` for both `xapu.dll` and `chad.dll`, and -`shims/dstorage.cpp` for `xcrdapi.dll`); a DLL in the folder replaces its module's shim, as above. Measured on the -1.0.2.1 executable at `867d922`, before those shims: without the folder, `--dry-run` leaves 20 imports unimplemented -(AcpHal 9, chad 5, xapu 5, XCRDAPI 1); with those four DLLs built from `f89e410`, it leaves 0, with the four -package DLLs still mapped (`module=72`). Those DLLs run static initializers when Windows loads them, and with the -defaults one of them hooks the process: the package DLLs mapped after it then fail to map. With +have a shim here as well (`shims/acphal.cpp`, `shims/xapu_queue.cpp` for `xapu.dll`, `shims/xapu_chad.cpp` for +`chad.dll`, and `shims/dstorage.cpp` for `xcrdapi.dll`); a DLL in the folder replaces its module's shim, as above. +Measured on the 1.0.2.1 executable at `867d922`, before those shims: without the folder, `--dry-run` leaves 20 +imports unimplemented (AcpHal 9, chad 5, xapu 5, XCRDAPI 1); with those four DLLs built from `f89e410`, it leaves 0, +with the four package DLLs still mapped (`module=72`). Those DLLs run static initializers when Windows loads them, +and with the defaults one of them hooks the process: the package DLLs mapped after it then fail to map. With `TOMBOX_GDK_EARLY=0 TOMBOX_GDK_RUNTIME=0 TOMBOX_OSHOST=0 TOMBOX_PAD=0 TOMBOX_TIMER_1MS=0` they map; their network guard stays on and denies all traffic. `loader_test` covers the step with a synthetic DLL (no game data).