RT-INPUT-SCRIPT-NO-SDL3: scripted input in builds without SDL3 #1843

Manually merged
github merged 1 commit from gh-pr/1843/head into gh-pr/1843/base 2026-11-26 10:08:03 +00:00
Owner

@⁠aslan2142 on GitHub · 2026-11-25 12:59 UTC · original
aslan2142:rt-input-script-no-sdl3 → main · +1174 −149 · 10 files · 1 commits · merged 2026-11-25 13:15 UTC

Claim: RT-INPUT-SCRIPT-NO-SDL3 (#1608)

What and why

A build without SDL3, such as the CI's Windows artifacts and offline builds, served GameInput with no devices. The title therefore waited at its first "press A" prompt forever; cxchhh's and slauko's findings in #14 describe this. This complements #1528 (INPUT-OUT-OF-THE-BOX), which makes SDL3 the default for make_game.py builds. This PR covers the builds that still lack SDL3.

  • One scripted pad: with LEONIDA_INPUT_SCRIPT set, runtime/shims/gameinput_no_sdl.cpp serves one pad.
    • It is found by device enumeration (blocking, async, dispatcher) and by FindDeviceFromId.
    • GetCurrentReading/GetNextReading/GetPreviousReading return gamepad and UI-navigation state that follows the script.
    • With the variable unset, nothing changes. Controllers and the keyboard pad still need SDL3.
  • Shared script code: the parser, the timeline, the button names and the log lines move into runtime/shims/gameinput_script.h, shared by both shims. Nothing in it needs SDL. gameinput.cpp checks the SDL button numbers at compile time.
  • Docs: runtime/README.md, docs/gameinput.md, docs/linux_proton.md and docs/README.md.

Tested

  • New CTest gameinput_no_sdl_script: fake clock, device callbacks, readings at chosen times, history.
  • Full Windows suite under Wine without SDL3 (clang-cl build, llvmpipe and an RDNA2 iGPU): no test goes from pass to fail. On an SDL3 build, gameinput and gameinput_script still pass after the refactor.
  • Repository checks: the docs and writer tests, CI and ctest registration, and check_no_game_data.py all pass.
  • On the retail game, with a build without SDL3 (RX 7900 XTX, RADV, Wine 11.22, Arch Linux): a@40,a@70,a@100 logged three presses, and the title went from its landing page into its first-run settings pages.
  • A separate issue: these runs, and a control run of plain main with SDL3 and the same script, end on their own a few minutes later with exit 0 and no runtime message. It is being looked at separately.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 12:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1843) `aslan2142:rt-input-script-no-sdl3` → `main` · +1174 −149 · 10 files · 1 commits · merged 2026-11-25 13:15 UTC Claim: `RT-INPUT-SCRIPT-NO-SDL3` (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why A build without SDL3, such as the CI's Windows artifacts and offline builds, served GameInput with no devices. The title therefore waited at its first "press A" prompt forever; cxchhh's and slauko's findings in #14 describe this. This complements #1528 (`INPUT-OUT-OF-THE-BOX`), which makes SDL3 the default for `make_game.py` builds. This PR covers the builds that still lack SDL3. - **One scripted pad:** with `LEONIDA_INPUT_SCRIPT` set, `runtime/shims/gameinput_no_sdl.cpp` serves one pad. - It is found by device enumeration (blocking, async, dispatcher) and by `FindDeviceFromId`. - `GetCurrentReading`/`GetNextReading`/`GetPreviousReading` return gamepad and UI-navigation state that follows the script. - With the variable unset, nothing changes. Controllers and the keyboard pad still need SDL3. - **Shared script code:** the parser, the timeline, the button names and the log lines move into `runtime/shims/gameinput_script.h`, shared by both shims. Nothing in it needs SDL. `gameinput.cpp` checks the SDL button numbers at compile time. - **Docs:** `runtime/README.md`, `docs/gameinput.md`, `docs/linux_proton.md` and `docs/README.md`. ### Tested - **New CTest `gameinput_no_sdl_script`:** fake clock, device callbacks, readings at chosen times, history. - **Full Windows suite under Wine without SDL3** (clang-cl build, llvmpipe and an RDNA2 iGPU): no test goes from pass to fail. On an SDL3 build, `gameinput` and `gameinput_script` still pass after the refactor. - **Repository checks:** the docs and writer tests, CI and ctest registration, and `check_no_game_data.py` all pass. - **On the retail game,** with a build without SDL3 (RX 7900 XTX, RADV, Wine 11.22, Arch Linux): `a@40,a@70,a@100` logged three presses, and the title went from its landing page into its first-run settings pages. - **A separate issue:** these runs, and a control run of plain `main` with SDL3 and the same script, end on their own a few minutes later with exit 0 and no runtime message. It is being looked at separately. AI-assisted (Claude Code, Claude Opus 5.5).
A build without SDL3 answered GameInputCreate with no devices and E_NOTIMPL
for every other slot, so the title waited at its first "press A" prompt
forever: no CI artifact or offline build could get past it.

With LEONIDA_INPUT_SCRIPT set, gameinput_no_sdl.cpp now serves one scripted
pad (an Xbox One gamepad) driven by the script alone: device enumeration
through RegisterDeviceCallback (blocking, async, dispatcher), FindDeviceFromId,
and GetCurrentReading/GetNextReading/GetPreviousReading whose gamepad and UI
navigation state follow the script. Readings are taken when the title asks,
so no thread polls. Without the variable it behaves as before.

The parser, the 300 ms timeline, the button names, the press log lines and
the UI navigation mapping move from gameinput.cpp into gameinput_script.h,
which both shims use; nothing in it needs SDL. gameinput.cpp checks the
shared SDL button numbers against SDL_GamepadButton at compile time.

gameinput_no_sdl_test --input-script (CTest gameinput_no_sdl_script) checks
the scripted pad on a fake clock. Docs: runtime/README.md, docs/gameinput.md,
docs/linux_proton.md, docs/README.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:08:02 +00:00
github manually merged commit c68f494160 into gh-pr/1843/base 2026-11-26 10:08:03 +00:00
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-25 13:15 UTC · original

Merged: builds without SDL3 (CI's Windows artifacts, offline builds) can now get past the title's landing page with LEONIDA_INPUT_SCRIPT.

  • With the variable set, the no-SDL path serves one scripted pad (device enumeration, FindDeviceFromId, readings that follow the script); unset, nothing changes. Controllers and the keyboard pad still need SDL3, which #1528 makes the default for make_game.py builds.
  • The script parser, timeline, button names and log lines are shared by both shims in runtime/shims/gameinput_script.h.
  • Tested: the new gameinput_no_sdl_script CTest; the full Windows suite under Wine without SDL3 with no test going from pass to fail; gameinput and gameinput_script on an SDL3 build; on the retail game without SDL3, three scripted presses reached the title and moved it past the landing page.
  • Checked on main 98c2f7777 + c68f49416: it merges cleanly; the semantic suite passes (489 files, 6,288 tests, 0 files failed); the 14 docs and writer tests pass; check_no_game_data.py is clean on the 10 changed files.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠aslan2142** on GitHub · 2026-11-25 13:15 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1843#issuecomment-7163524945) Merged: builds without SDL3 (CI's Windows artifacts, offline builds) can now get past the title's landing page with `LEONIDA_INPUT_SCRIPT`. - With the variable set, the no-SDL path serves one scripted pad (device enumeration, `FindDeviceFromId`, readings that follow the script); unset, nothing changes. Controllers and the keyboard pad still need SDL3, which #1528 makes the default for `make_game.py` builds. - The script parser, timeline, button names and log lines are shared by both shims in `runtime/shims/gameinput_script.h`. - Tested: the new `gameinput_no_sdl_script` CTest; the full Windows suite under Wine without SDL3 with no test going from pass to fail; `gameinput` and `gameinput_script` on an SDL3 build; on the retail game without SDL3, three scripted presses reached the title and moved it past the landing page. - **Checked on `main` `98c2f7777` + `c68f49416`:** it merges cleanly; the semantic suite passes (489 files, 6,288 tests, 0 files failed); the 14 docs and writer tests pass; `check_no_game_data.py` is clean on the 10 changed files. AI-assisted (Claude Code, Claude Opus 5.5).
This discussion has been locked. Commenting is limited to contributors.
No description provided.