Repository navigation
gameinput: a scripted press can be held longer, button@seconds:hold (INPUT-SCRIPT-HOLD) - #2144
Conversation
c85ed70 to
de5df03
Compare
At world-start frame rates the retail title reads its pad every few seconds, so a 0.3 s scripted press falls between two reads and never arrives. An entry may now give its own hold time; without one the press stays 0.3 s. Holds of 0 or less, over 600 s or that are not a number reject the entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ProjectLeonida#2098 gave the SDL path its own loop (held 300 ms, then until the title has read the pads six times, at most 5 s), which ignored button@seconds:hold. A press now lasts its own hold, then the read latch, and never past 5 s or its hold if longer. The long-script test checks both: X kept past 300 ms until six reads, Y kept for its 0.6 s after them. It fails on the old loop. Found by AndreiKocherzhinskiiA on ProjectLeonida#1608. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
de5df03 to
1ce6055
Compare
|
Useful and mergeable, with two small documentation points. It is still needed after #2098 for any build without SDL3, and it adds a longer hold for SDL3 builds too. Its no-SDL3 test fails on main's source and passes with it. The SDL3 half of the PR was not built or run here. Independent test report for this PR at head Configuration: Windows 11 Pro 10.0.26300, MSVC 19.44 (VS 2022), CMake + Ninja, RelWithDebInfo. Only the Counts
Mutation (the PR's tests against main's source)
Reading
Suggestions (non-blocking)
Not covered: the SDL3 keyboard-pad path (see Counts). No retail boot with this PR, and no check that AI-assisted: yes (Claude Code, Claude Sonnet 5.5, built and ran the tests; a second agent checked this text) |
…mment Review follow-up (MoonEyes): the InputScript help in boot.ps1 now says each press is held 300 ms and that button@seconds:hold holds it longer. The header comment in gameinput_script.h is wrapped at 120 like the rest of the file. Comments only; no code change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @MoonEyes for the independent run and the mutation check. Both suggestions are in 7bd4cec (comments only, no code change):
The SDL3 path ( AI-assisted (Claude Code). |
Claimed in the coordination issue as: INPUT-SCRIPT-HOLD (claim)
What and why
A
LEONIDA_INPUT_SCRIPTpress is held for 0.3 s. The retail title reads its pad once a frame, and from the world start on a frame takes seconds here, so a 0.3 s press can start and end between two reads and never arrive. On an RTX 3060 Ti the title shows a "Couldn't autosave" prompt (Retry A / Got it B) about 1,000 s into a boot from a save:bpresses at 1080, 1140 and 1200 s did nothing in 30 minutes (run r11);An entry can now give its own hold,
button@seconds:hold:b@1100:4holds B for 4 s. Without:holda press stays 0.3 s, so every existing script means what it did.A hold of 0 or less, more than 600 s, or one that isn't a number (
a@0:,a@0:x,a@0:inf,a@0:1tail) rejects the entry and is counted like any other rejected entry. The 600 s cap keeps a typo such asb@10:1100from holding a button for the rest of the run. Right-stick throws (rsup,rsdown) take the same suffix. The parser is shared, so the SDL3 keyboard pad and the scripted pad of a build without SDL3 both get it. Since #2098 the SDL3 keyboard pad has its own loop: a press is held for 0.3 s, then until the title has read the pads six times, and never past 5 s. That loop now uses the entry's hold in place of the 0.3 s, and its 5 s limit becomes the hold when the hold is longer. Without:holdit behaves exactly as before. (Found by AndreiKocherzhinskiiA on #1608.)Tested
Windows 11 26200, MSVC 19.44,
maina73a57e13plus the two commits.gameinput_test --input-script(SDL3 build): 12 checks, 0 failures. New:y@0:0.6is held with X at the first poll. Past 0.3 s, X is still held because the title has read the pads fewer than six times. After six more reads X ends while Y is still held for its 0.6 s. Y is released 0.4 s later. Seven malformed holds hold nothing. With the SDL3 loop ingameinput.cppreverted to main's, 1 of these checks fails (Y ends with X).gameinput_no_sdl_test --input-script(build without SDL3): 0 failures. New:b@3:0.8holds B at 3.05 s and 3.7 s and releases it by 3.85 s; four malformed holds are rejected. With the header reverted, 2 fail.gameinput_testandgameinput_no_sdl_testwithout the script argument: 364 checks and 0 failures respectively, unchanged.scripts/windows-boot/boot.ps1from a save, scripta@120:2,a@150:2,a@180:2,b@1100:4,b@1130:4,b@1160:4):Three 4 s presses do what took 120 short ones.
python -I scripts/check_no_game_data.pyon the 6 changed files: no hits.git diff --check: clean.GPUs tested: NVIDIA GeForce RTX 3060 Ti (Ampere), driver 621.14, Windows 11 26200.
AI-assisted: yes (Claude Code; run and measured on the machine above)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed: n/a (input shim, no translator change).🤖 Generated with Claude Code