diff options
| author | aslan2142 <jan.trencansky@protonmail.com> | 2026-11-25 14:15:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-25 14:15:49 +0100 |
| commit | 384abe5b06d08e349f4b4e4394c68f036da47dc7 (patch) | |
| tree | 6e608825aba65b0cad8776badce77ee58a31e67c /docs | |
| parent | 98c2f7777276f83eb90b491a51721ef90a43ea73 (diff) | |
| parent | c68f494160c8e79c76bfa109b2e99571a5c11358 (diff) | |
Merge pull request #1843 from aslan2142/rt-input-script-no-sdl3
RT-INPUT-SCRIPT-NO-SDL3: scripted input in builds without SDL3
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/README.md | 2 | ||||
| -rw-r--r-- | docs/gameinput.md | 50 | ||||
| -rw-r--r-- | docs/linux_proton.md | 9 |
3 files changed, 52 insertions, 9 deletions
diff --git a/docs/README.md b/docs/README.md index 63d0860ac..d6bca1754 100644 --- a/docs/README.md +++ b/docs/README.md | |||
| @@ -88,7 +88,7 @@ method, scope and caveats. No game data is included. | |||
| 88 | | [directstorage.md](directstorage.md) | Console DirectStorage: the DLL and ABI the title is expected to use (`DStorageGetFactory`, `dstorage_xs`, `XCRDAPI`), how sure that is and the evidence for it, and what `runtime/shims/dstorage.cpp` serves on the PC. The executable's own imports are unmeasured. | | 88 | | [directstorage.md](directstorage.md) | Console DirectStorage: the DLL and ABI the title is expected to use (`DStorageGetFactory`, `dstorage_xs`, `XCRDAPI`), how sure that is and the evidence for it, and what `runtime/shims/dstorage.cpp` serves on the PC. The executable's own imports are unmeasured. | |
| 89 | | [cpu_features.md](cpu_features.md) | CPU instructions in the executable a desktop CPU may lack (`tools/cpu_feature_scan.py`): 19 SSE4a, 10 CLZERO and 4 MONITORX/MWAITX sites (AMD only) and 8 CLWB sites (Intel since Ice Lake), all real code; `#UD` on hosts without them. | | 89 | | [cpu_features.md](cpu_features.md) | CPU instructions in the executable a desktop CPU may lack (`tools/cpu_feature_scan.py`): 19 SSE4a, 10 CLZERO and 4 MONITORX/MWAITX sites (AMD only) and 8 CLWB sites (Intel since Ice Lake), all real code; `#UD` on hosts without them. | |
| 90 | | [xcl_compare.md](xcl_compare.md) | XCL's synthetic test title under `gta6rt --run` and under XCL (`tools/xcl_compare.py`): 5 of 50 checks pass here, both hangs are the documented manual-queue terminate deadlock, and each other difference mapped to an open item or a lead. | | 90 | | [xcl_compare.md](xcl_compare.md) | XCL's synthetic test title under `gta6rt --run` and under XCL (`tools/xcl_compare.py`): 5 of 50 checks pass here, both hangs are the documented manual-queue terminate deadlock, and each other difference mapped to an open item or a lead. | |
| 91 | | [gameinput.md](gameinput.md) | The GameInput shim on SDL3: `GameInputCreate` and the v0 `IGameInput`/`IGameInputDevice`/`IGameInputReading`/`IGameInputDispatcher` surface on any SDL gamepad, DualSense adaptive-trigger approximation and lightbar, force-feedback motors and trigger haptics through SDL's haptic API; 261 checks on virtual joysticks and a fake haptic backend; by hand on an Xbox Series X pad (Bluetooth) and a DualSense (USB). 261 checks on virtual joysticks and a fake haptic backend, not yet tried on a real pad. | | 91 | | [gameinput.md](gameinput.md) | The GameInput shim on SDL3: `GameInputCreate` and the v0 `IGameInput`/`IGameInputDevice`/`IGameInputReading`/`IGameInputDispatcher` surface on any SDL gamepad, DualSense adaptive-trigger approximation and lightbar, force-feedback motors and trigger haptics through SDL's haptic API; without SDL3, one scripted pad for `LEONIDA_INPUT_SCRIPT`; 261 checks on virtual joysticks and a fake haptic backend; by hand on an Xbox Series X pad (Bluetooth) and a DualSense (USB). 261 checks on virtual joysticks and a fake haptic backend, not yet tried on a real pad. | |
| 92 | | [saves.md](saves.md) | Save containers: `JSAV` (index + JSON story save, byte-exact rebuild), `ASAV` header, `SLAYER1` packed copy (not decoded); `tools/saves.py` and import into the offline `XGameSave` folder; key hashes are case-sensitive joaat (`tools/save_keys.py`). | | 92 | | [saves.md](saves.md) | Save containers: `JSAV` (index + JSON story save, byte-exact rebuild), `ASAV` header, `SLAYER1` packed copy (not decoded); `tools/saves.py` and import into the offline `XGameSave` folder; key hashes are case-sensitive joaat (`tools/save_keys.py`). | |
| 93 | | [pipeline_check.md](pipeline_check.md) | Driver-level corpus check: the full corpus, 26,503 of 26,503 modules and pipelines, 0 failures (RTX 4060 Ti); an earlier 10/12-shard run, 22,092 modules and 2,217 compute pipelines, also had 0 failures. Driver-level corpus check: 10/12 shards, 22,092 modules, 2,217 compute pipelines, 0 failures. | | 93 | | [pipeline_check.md](pipeline_check.md) | Driver-level corpus check: the full corpus, 26,503 of 26,503 modules and pipelines, 0 failures (RTX 4060 Ti); an earlier 10/12-shard run, 22,092 modules and 2,217 compute pipelines, also had 0 failures. Driver-level corpus check: 10/12 shards, 22,092 modules, 2,217 compute pipelines, 0 failures. | |
| 94 | | [multi_gpu_validation.md](multi_gpu_validation.md) | Running disjoint shards on eight identical RDNA1/RADV GPUs: PCI-BDF pinning, base controls, per-card logs, the V540 farm's aggregate results and its known driver limitations. | | 94 | | [multi_gpu_validation.md](multi_gpu_validation.md) | Running disjoint shards on eight identical RDNA1/RADV GPUs: PCI-BDF pinning, base controls, per-card logs, the V540 farm's aggregate results and its known driver limitations. | |
diff --git a/docs/gameinput.md b/docs/gameinput.md index feed39153..06c2013a5 100644 --- a/docs/gameinput.md +++ b/docs/gameinput.md | |||
| @@ -37,10 +37,42 @@ SDL3 is available in one of these ways: | |||
| 37 | - **A local copy of that tarball**: extract it and pass `-DFETCHCONTENT_SOURCE_DIR_SDL3=<path to SDL3-3.4.20>`; it is | 37 | - **A local copy of that tarball**: extract it and pass `-DFETCHCONTENT_SOURCE_DIR_SDL3=<path to SDL3-3.4.20>`; it is |
| 38 | built the same way, without a download. | 38 | built the same way, without a download. |
| 39 | 39 | ||
| 40 | Without any of these, or with `-DLEONIDA_SDL3=OFF`, configure prints a message and `gta6rt` is built without the shim: | 40 | Without any of these, or with `-DLEONIDA_SDL3=OFF`, configure prints a message and `gta6rt` is built without the SDL3 |
| 41 | it has no `GameInputCreate`, as before, so the loader binds it to the host's `GameInput.dll` or the unimplemented | 41 | shim. It links `runtime/shims/gameinput_no_sdl.cpp` instead, which still serves `GameInputCreate` (by name and as |
| 42 | thunk. `gameinput_test` and `gameinput_probe` are not built, and CTest lists `gameinput` as not run (disabled) rather | 42 | `gameinput.dll!#1`): with no devices, or with `LEONIDA_INPUT_SCRIPT` set with one scripted pad (see |
| 43 | than failing. | 43 | [Scripted input without SDL3](#scripted-input-without-sdl3)). `gameinput_test` and `gameinput_probe` are not built, |
| 44 | and CTest lists `gameinput` and `gameinput_script` as not run (disabled) rather than failing; `gameinput_no_sdl` and | ||
| 45 | `gameinput_no_sdl_script` run instead. | ||
| 46 | |||
| 47 | ### Scripted input without SDL3 | ||
| 48 | |||
| 49 | The Windows artifacts of CI and offline builds have no SDL3. Without a device, the title waits at its first "press A" | ||
| 50 | prompt forever, so no headless or CI run could get past it. With `LEONIDA_INPUT_SCRIPT` set, such a build serves one | ||
| 51 | scripted pad, driven by the script alone: | ||
| 52 | |||
| 53 | - **The device:** an Xbox One gamepad named `Scripted pad (Leonida)`, connected from the first `GameInputCreate`. It | ||
| 54 | is reported by `RegisterDeviceCallback` enumeration (blocking on the caller's thread, async from a thread of the | ||
| 55 | shim, or through `IGameInputDispatcher::Dispatch` once the title made a dispatcher) and found by `FindDeviceFromId`. | ||
| 56 | It is already connected, so a callback registered without enumeration hears nothing. | ||
| 57 | - **The readings:** `GetCurrentReading`, `GetNextReading` and `GetPreviousReading`, with gamepad, UI navigation, | ||
| 58 | controller axis and controller button state. A reading is taken when the title asks for one and the script's state | ||
| 59 | has changed since the last, so no thread polls; the history keeps the last 64 readings. | ||
| 60 | - **The timeline:** the same as with SDL3 (`runtime/shims/gameinput_script.h` holds the parser, the timeline and the | ||
| 61 | log lines for both): seconds from the first `GameInputCreate`, each press held 300 ms, then released. | ||
| 62 | - **Not served:** reading callbacks, aggregate devices, rumble and every other device. Those slots answer `E_NOTIMPL` | ||
| 63 | and log the slot once. Controllers and the [keyboard pad](#keyboard-pad) still need SDL3. | ||
| 64 | |||
| 65 | The start of the run logs one line with the counts, and each press logs the same lines as with SDL3: | ||
| 66 | |||
| 67 | ```text | ||
| 68 | [rt] gameinput: served without SDL3: one scripted pad for LEONIDA_INPUT_SCRIPT (3 scripted press(es), 0 rejected); controllers and the keyboard pad need SDL3 | ||
| 69 | [rt] gameinput: scripted press of button 0 at 40.0 s | ||
| 70 | [rt] gameinput: press a@40.0 (Scripted pad (Leonida)) | ||
| 71 | ``` | ||
| 72 | |||
| 73 | A press is logged when the title reads it, so a press the title never reads is not logged. `LEONIDA_INPUT_LOG=0` | ||
| 74 | turns the `press` lines off. Without `LEONIDA_INPUT_SCRIPT`, the shim serves no devices and answers `E_NOTIMPL` for | ||
| 75 | every slot past `Release`, as before. | ||
| 44 | 76 | ||
| 45 | `scripts/build_runtime.ps1` (what `make_game.py` runs) builds the shim only on its CMake path, when Visual Studio's | 77 | `scripts/build_runtime.ps1` (what `make_game.py` runs) builds the shim only on its CMake path, when Visual Studio's |
| 46 | C++ CMake tools are installed. Its direct-`cl.exe` fallback compiles a fixed file list without the shim and warns | 78 | C++ CMake tools are installed. Its direct-`cl.exe` fallback compiles a fixed file list without the shim and warns |
| @@ -302,7 +334,7 @@ line is logged when it takes effect); tracking goes on underneath, so clearing i | |||
| 302 | | `LEONIDA_PROMPTS_SWITCH_MS` | `300` | shortest time between two changes of the active input family, 0..2000 ms | | 334 | | `LEONIDA_PROMPTS_SWITCH_MS` | `300` | shortest time between two changes of the active input family, 0..2000 ms | |
| 303 | | `LEONIDA_GAMEINPUT_THREAD` | `1` | `0` stops the background poll thread; only `rt::gameinput::poll()` then reads the pads (tests) | | 335 | | `LEONIDA_GAMEINPUT_THREAD` | `1` | `0` stops the background poll thread; only `rt::gameinput::poll()` then reads the pads (tests) | |
| 304 | | `LEONIDA_KEYBOARD_PAD` | `off` | `1` adds the [keyboard pad](#keyboard-pad), read while this process has focus; `always` reads keys whatever has focus | | 336 | | `LEONIDA_KEYBOARD_PAD` | `off` | `1` adds the [keyboard pad](#keyboard-pad), read while this process has focus; `always` reads keys whatever has focus | |
| 305 | | `LEONIDA_INPUT_SCRIPT` | unset | With the keyboard pad enabled, set comma-separated `button@seconds` entries, e.g. `a@2,a@4,start@6`. The first pad update reads the script once at startup and starts the clock. `reload_config()` does not reread it. Each press lasts 300 ms. Buttons are `a b x y start back lb rb up down left right`. Spaces around entries are allowed. Empty entries, unknown buttons and invalid times (including negative or non-finite values) are counted and ignored. | | 337 | | `LEONIDA_INPUT_SCRIPT` | unset | Comma-separated `button@seconds` entries, e.g. `a@2,a@4,start@6`. With SDL3 they drive the keyboard pad, which has to be enabled; without SDL3 they drive [one scripted pad](#scripted-input-without-sdl3), the only device. The first pad update (without SDL3, the first `GameInputCreate`) reads the script once at startup and starts the clock. `reload_config()` does not reread it. Each press lasts 300 ms. Buttons are `a b x y start back lb rb up down left right`. Spaces around entries are allowed. Empty entries, unknown buttons and invalid times (including negative or non-finite values) are counted and ignored. | |
| 306 | | `LEONIDA_MOUSE_SENSITIVITY` | `1` | scales how far the mouse moves the keyboard pad's right stick, 0.1..10 | | 338 | | `LEONIDA_MOUSE_SENSITIVITY` | `1` | scales how far the mouse moves the keyboard pad's right stick, 0.1..10 | |
| 307 | 339 | ||
| 308 | SDL's own hints (`SDL_JOYSTICK_*`, see SDL's `SDL_hints.h`) also apply, for example `SDL_JOYSTICK_HIDAPI_PS5=0` to | 340 | SDL's own hints (`SDL_JOYSTICK_*`, see SDL's `SDL_hints.h`) also apply, for example `SDL_JOYSTICK_HIDAPI_PS5=0` to |
| @@ -457,6 +489,14 @@ rests on a transcription rather than on a side-by-side compile. | |||
| 457 | button, the touchpad, a trigger or a stick, stick drift and a one-count mouse jitter ignored, a real mouse movement | 489 | button, the touchpad, a trigger or a stick, stick drift and a one-count mouse jitter ignored, a real mouse movement |
| 458 | counted, the 300 ms window on the real clock, and `LEONIDA_PROMPTS` forcing, changing, ignoring an unknown value | 490 | counted, the 300 ms window on the real clock, and `LEONIDA_PROMPTS` forcing, changing, ignoring an unknown value |
| 459 | and clearing. | 491 | and clearing. |
| 492 | - `gameinput_no_sdl_test` (CTest, only in a build without SDL3, no controller): `gameinput_no_sdl` checks the | ||
| 493 | identity-only object (both names served, `AddRef`/`Release`, `E_NOTIMPL` without touching the out-parameter). | ||
| 494 | `gameinput_no_sdl_script` sets `LEONIDA_INPUT_SCRIPT` with overlapping presses, a mixed-case name, `rsup` and three | ||
| 495 | rejected entries, puts the shim on a fake clock and checks the scripted pad: blocking, async and dispatcher | ||
| 496 | enumeration (and none without enumeration, for another status or another kind), the device info, `FindDeviceFromId`, | ||
| 497 | the buttons, UI navigation and right stick read at chosen times (held for 0.3 s, a later press of the same button | ||
| 498 | not cut short, nothing after the script), no new reading without a change, `GetPreviousReading` and | ||
| 499 | `GetNextReading`, no motion, and reading callbacks answering `E_NOTIMPL`. | ||
| 460 | - `gameinput_test` (CTest, no controller): turns SDL's real backends off and drives the shim through | 500 | - `gameinput_test` (CTest, no controller): turns SDL's real backends off and drives the shim through |
| 461 | `rt::shims::find` with SDL virtual joysticks, an Xbox-style pad with trigger motors, a DualSense (Sony | 501 | `rt::shims::find` with SDL virtual joysticks, an Xbox-style pad with trigger motors, a DualSense (Sony |
| 462 | `054c:0ce6`) and a pad without trigger motors. It checks enumeration and device callbacks, the button, stick, | 502 | `054c:0ce6`) and a pad without trigger motors. It checks enumeration and device callbacks, the button, stick, |
diff --git a/docs/linux_proton.md b/docs/linux_proton.md index c792a550d..de4760d70 100644 --- a/docs/linux_proton.md +++ b/docs/linux_proton.md | |||
| @@ -53,12 +53,15 @@ the layout the comments at their top describe (`/opt/leonida` for traces, overla | |||
| 53 | `__GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1`. | 53 | `__GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1`. |
| 54 | - **Input:** a pad through GameInput/SDL3, or the keyboard pad (`LEONIDA_KEYBOARD_PAD=always`), or a script: | 54 | - **Input:** a pad through GameInput/SDL3, or the keyboard pad (`LEONIDA_KEYBOARD_PAD=always`), or a script: |
| 55 | `LEONIDA_INPUT_SCRIPT=a@210,a@240` presses A at those seconds (any length since this branch; it was cut at 63 | 55 | `LEONIDA_INPUT_SCRIPT=a@210,a@240` presses A at those seconds (any length since this branch; it was cut at 63 |
| 56 | characters before). | 56 | characters before). The script also works in a build without SDL3, where it drives one scripted pad |
| 57 | ([docs/gameinput.md](gameinput.md#scripted-input-without-sdl3)); pads and the keyboard pad need SDL3. | ||
| 57 | - **Window:** frames are presented in the title's own window; `LEONIDA_PRESENT_WINDOW=own|hidden` chooses otherwise. | 58 | - **Window:** frames are presented in the title's own window; `LEONIDA_PRESENT_WINDOW=own|hidden` chooses otherwise. |
| 58 | 59 | ||
| 59 | Three setup mistakes each give a blank or empty picture without an error: the executable's embedded shaders missing | 60 | Three setup mistakes each give a blank or empty picture without an error: the executable's embedded shaders missing |
| 60 | from the library (`exe/index.json`), a build without SDL3 (no pad), and a BCPack predictor file that was never | 61 | from the library (`exe/index.json`), a build without SDL3 and without `LEONIDA_INPUT_SCRIPT` (no pad, so nothing |
| 61 | generated (`tools/build_dstorage_history.py`; without it the loading art and most BC7 textures stay empty). | 62 | gets past the first prompt; set a script, or build with SDL3 for a pad or the keyboard pad), and a BCPack predictor |
| 63 | file that was never generated (`tools/build_dstorage_history.py`; without it the loading art and most BC7 textures | ||
| 64 | stay empty). | ||
| 62 | 65 | ||
| 63 | ## Running the game under Wine with one command | 66 | ## Running the game under Wine with one command |
| 64 | 67 | ||