feat(libScePad): script timed pad input with APS5_PAD_SCRIPT and APS5_PAD_SCRIPT_LIVE #22064
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22064"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by nicolasabosch on 2026-11-17T03:54:27Z.
What
Adds timed pad input for reproducible unattended runs, such as performance traces and regression runs of a scene behind menus, with no controller and no window focus.
APS5_PAD_SCRIPTreads a text file of events (buttons with a start time and hold time, repeated presses, stick positions) that are OR-ed with real input for user 0, timed from the first pad read;APS5_PAD_SCRIPT_LIVEschedules lines appended to a file while the title runs;APS5_PAD_SCRIPT_LOOP_MSrestarts the script after its last event. Port 0 stays connected while a script is configured, each fired event is logged to stderr, and a malformed line stops the title with an error naming the file and line.APS5_PAD_INPUT_FILE,APS5_PAD_RECORDandAPS5_PAD_REPLAYare unchanged; the script is a hand-written, human-readable schedule rather than a recording of states.Overlap: #18783 adds
ENVIRONMENT.mdrows next to the ones added here (APS5_PAD_*); the conflict is textual, and whichever PR merges second will be rebased.Tested
Windows 11, MinGW (GCC, Release), no title.
ctest -R '^(pad_input_script|pad_command_file|pad_recording|guest_pad)'passed (20/20):pad_input_scriptparses and samples scripts (holds, repeats, sticks, loop, live appends and malformed lines); the other pad tests cover the shared input path. After review (a4cd6e6ddc): astickevent overrides only the stick it names (the injected input carries a per-stick mask, and the other stick keeps the controller's position); a live poll that cannot read the file is retried at the next poll; live errors name the line in the whole file, counting the lines present at startup; and the live list refuses lines that would leave more than 20000 events pending.pad_input_scriptchecks the stick mask, the line numbers across polls and from startup, and the cap. The per-stick merge into the controller state inPadState.cpphas no test of its own.Also used in a title: a seven-line
APS5_PAD_SCRIPTtook EA SPORTS UFC 6 (PPSA23566, 01.004.000) from boot through its menus to the same gameplay scene (the first practice fight of the tutorial) in every unattended run of the performance captures attached to theperf(agc),perf(shader)andperf(libkernel)PRs opened with this one.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T12:27:35Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
84e86118e4, base main. No merged-preview check.Results
Unedited reader output
Lines 12–15 and 35–40 of Port0Presence.hpp were read with
cat.Mode::Defaultmakescommittedtrue inPresence.Findings
Blocking
None.
Non-blocking
core/libs/prx/libScePad/include/InputScript.hpp:301startslineat 0 on every poll, and:308reports it. An error on the 40th appended line is reported as "line 1" of that chunk. Keep a running line count on the live state.core/libs/prx/libScePad/include/InputScript.hpp:316pushes without thekMaxEntriescheck that the file path applies. Entries are removed only a second after they end. A fast appender can grow the list without bound.core/libs/prx/libSceVideoOut/src/PadInput.cpp:93never readsANYPS5_PAD_PORT0_STATEwhile a script is set, socontrolleris ignored and an invalid value is not reported. Say so in ENVIRONMENT.md, or report the variable as well.docs/dev/ENVIRONMENT.md:631and:704change "stops the game" to "stops the title" in rows this PR does not touch. The checklist asks for one topic per PR. Drop these lines here, or move them to their own PR.Sources
Not verified
pad_input_scriptresults (20/20, Windows 11, MinGW Release) are the author's report.Script()declaration and definition in the same namespace, C++20std::erase_if, and theadd_test_executabletarget.To get this to a good state
Nothing is required. The optional points are findings 1 to 4 above. No commands need rerunning on the new head unless those changes are made.