[PR #1843] [MERGED] RT-INPUT-SCRIPT-NO-SDL3: scripted input in builds without SDL3 #1855

Closed
opened 2026-11-26 21:19:11 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1843
Author: @aslan2142
Created: 11/25/2026
Status: ✅ Merged
Merged: 11/25/2026
Merged by: @aslan2142

Base: main ← Head: rt-input-script-no-sdl3


📝 Commits (1)

  • c68f494 RT-INPUT-SCRIPT-NO-SDL3: serve LEONIDA_INPUT_SCRIPT without SDL3

📊 Changes

10 files changed (+1174 additions, -149 deletions)

View changed files

📝 docs/README.md (+1 -1)
📝 docs/gameinput.md (+45 -5)
📝 docs/linux_proton.md (+6 -3)
📝 runtime/CMakeLists.txt (+4 -1)
📝 runtime/README.md (+7 -1)
📝 runtime/shims/gameinput.cpp (+47 -124)
📝 runtime/shims/gameinput_no_sdl.cpp (+641 -3)
➕ runtime/shims/gameinput_no_sdl.h (+12 -0)
➕ runtime/shims/gameinput_script.h (+180 -0)
📝 runtime/test/gameinput_no_sdl_test.cpp (+231 -11)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1843 **Author:** [@aslan2142](https://github.com/aslan2142) **Created:** 11/25/2026 **Status:** ✅ Merged **Merged:** 11/25/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `rt-input-script-no-sdl3` --- ### 📝 Commits (1) - [`c68f494`](https://github.com/ubiquitarianism/leonida/commit/c68f494160c8e79c76bfa109b2e99571a5c11358) RT-INPUT-SCRIPT-NO-SDL3: serve LEONIDA_INPUT_SCRIPT without SDL3 ### 📊 Changes **10 files changed** (+1174 additions, -149 deletions) <details> <summary>View changed files</summary> 📝 `docs/README.md` (+1 -1) 📝 `docs/gameinput.md` (+45 -5) 📝 `docs/linux_proton.md` (+6 -3) 📝 `runtime/CMakeLists.txt` (+4 -1) 📝 `runtime/README.md` (+7 -1) 📝 `runtime/shims/gameinput.cpp` (+47 -124) 📝 `runtime/shims/gameinput_no_sdl.cpp` (+641 -3) ➕ `runtime/shims/gameinput_no_sdl.h` (+12 -0) ➕ `runtime/shims/gameinput_script.h` (+180 -0) 📝 `runtime/test/gameinput_no_sdl_test.cpp` (+231 -11) </details> ### 📄 Description 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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:19:11 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1855
No description provided.