Skip to content

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

Merged
aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
aslan2142:rt-input-script-no-sdl3
Nov 25, 2026
Merged

aslan2142 merged 1 commit into
ProjectLeonida:mainfrom
aslan2142:rt-input-script-no-sdl3

Conversation

@aslan2142

Copy link
Copy Markdown
Collaborator

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

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 <noreply@anthropic.com>
@aslan2142
aslan2142 merged commit 384abe5 into ProjectLeonida:main Nov 25, 2026
2 of 5 checks passed
@aslan2142

Copy link
Copy Markdown
Collaborator Author

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 make_game, gameinput: controller, keyboard and mouse input out of the box (INPUT-OUT-OF-THE-BOX) #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).

kawaii-shakal added a commit to kawaii-shakal/leonida that referenced this pull request Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant