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

Merged
aslan2142 merged 1 commit from upstream-pr/1843 into main 2026-11-25 13:15:50 +00:00
aslan2142 commented 2026-11-25 12:59:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T12:59:26Z.


Claim: RT-INPUT-SCRIPT-NO-SDL3 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162247285)

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).

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5491797305 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1843). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T12:59:26Z. --- Claim: `RT-INPUT-SCRIPT-NO-SDL3` (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162247285) ### 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 commented 2026-11-25 13:15:52 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-11-25T13:15:52Z.


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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7163524945 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1843#issuecomment-7163524945). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-11-25T13:15:52Z. --- 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).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1843
No description provided.