Skip to content

feat(pad): inject touch coordinates through command files - #11715

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
danielcadev:feat/pad-file-touch-coordinates
Oct 28, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
danielcadev:feat/pad-file-touch-coordinates

Conversation

@danielcadev

Copy link
Copy Markdown
Contributor

What

Allow the existing pad command file to inject an explicit touch contact, including coordinates, stable contact ID, movement and release. Button-only, stick and timeline commands keep their existing syntax. An optional final touch(X,Y,ID,ACTIVE) token accepts X 0..1919, Y 0..942, ID 0..127 and ACTIVE 0/1; malformed or out-of-range commands are rejected without consuming a sequence.

tools/pad_input.py gains --touch X Y ID ACTIVE and recognizes the extended command when advancing its sequence. It retains atomic replacement, file mode/owner handling and the existing line-size bound. While a coordinate command is active it overrides physical touch contacts and the left/right synthetic contact, including when ACTIVE=0; physical contact tracking continues so it resumes correctly afterward. Buttons and sticks still combine through the existing path.

For example, on a command file already configured through APS5_PAD_INPUT_FILE:

python3 tools/pad_input.py /tmp/anyps5-pad release --hold-ms 5000 --touch 100 200 3 1
python3 tools/pad_input.py /tmp/anyps5-pad release --hold-ms 5000 --touch 600 200 3 1
python3 tools/pad_input.py /tmp/anyps5-pad release --touch 600 200 3 0

This supplies the missing coordinate movement needed for the name-writing sequence in Ghost of Yōtei; the original implementation completed that sequence on the custom Linux integration reported in #675. This PR is a standalone port to main, not that combined graphics stack. Related #7102 covers left/right touchpad clicks, and #6485 concerns physical sample IDs; neither implements this command form. No FPS claim.

Tested

Fedora/Linux x86-64, GCC, Ryzen 7 5700X:

  • The repository GuestPad.cpp fixture passed on base main 0a570f617d85c0a560f6f6c9edea4954670ab629 and passed with this change, including parser validation, coordinate movement with the same ID, explicit lift, command expiry, unchanged buttons/sticks and the existing pad API checks. The fixture sequence for the following queue-timestamp test was advanced to avoid replaying a stale sequence consumed by the new touch checks.
  • For this focused check, main's actual libScePad/Export.cpp and PadState.cpp were compiled into separate unpatched base/candidate PRX modules with the corresponding main/candidate GuestPad.cpp. Both use the same existing locally built libkernel/libc dependencies. This is a focused module/fixture build, not a fresh full-project build of all dependencies. No production source or binary in the working game checkout was replaced.
  • python3 -m unittest discover -s tools/tests -p test_pad_input.py -v: 21 tests run, 20 passed and one skipped because privileged POSIX ownership behavior requires root.
  • git diff --check and code review passed.

The branch was then rebased onto main 2e85f47aef524d294148e474718a1210df1476c8; only an unrelated libc ElfTypes header changed between the tested base and that rebase. The Pad sources and five changed files were unchanged upstream.

Overlap review: the repository tool reports line conflicts with #10578 (timeline sequence validation) and #11207 (IME input interception), plus shared-file conflicts for #6531, #8260, #10206 and #11360. Their patches were inspected: none implements coordinate contacts. These are merge/rebase concerns, not feature prerequisites. If the IME interception patch lands first, this new contact input must also obey its interception flag when resolving that conflict. The other shared patches cover path/encoding/error handling and tracker-light-bar tests.

The current-main port has not been tested in a new native Yōtei run, on Windows or with a physical touchpad. The earlier name-writing result belongs to the separate integration; it is not presented as a fresh main game test. No AGC, shader recompiler or VideoOut code changes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA26344 Ghost of Yōtei (PPSA26344) #675 (coordinate input for name writing; current-main game run not performed)
  • GPUs tested: n/a (Pad and host input tool only)
  • AI-assisted: yes

@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 27, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 9ff5ae5cbb0606b4c032a806c6a8f34d226c3d86.

The optional touch token is bounded and rejected atomically on malformed or out-of-range input; the original button/stick grammar remains intact. The state path preserves a stable supplied contact ID during movement and treats an explicit inactive token as a lift that suppresses physical/synthetic contacts for that command. The tests cover those transitions, invalid tokens, expiry, and unchanged button/stick behavior. I checked the overlap candidates named in the PR: the open timeline, IME, path/error, and tracker-light-bar changes do not implement coordinate contacts; merged #7102 adds only left/right touchpad clicks, and closed #6485 covers physical sample IDs.

Independent checks: python3 -m unittest discover -s tools/tests -p test_pad_input.py -v passes 21/21; tools/check_conventions.py --base refs/review/upstream-main and git diff --check pass. I applied the PR patch in a disposable main-derived test tree, built guest_pad_tests, and ran ctest -R '^guest_pad$': 1/1 passed. The host lacks the required Zen 2 CPU features, so I bypassed only the startup guard in that scratch tree, then restored it and verified the scratch source is clean. All hosted relinker and ASan jobs pass; Linux/Windows product jobs were skipped by path policy. The separate Yōtei name-entry result remains historical integration evidence, not a new current-main game run.

No blocking issue found.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 10578 tools/pad_input.py L29-32
PR 11885 tools/pad_input.py L28-35

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6531 tools/pad_input.py
tools/tests/test_pad_input.py
PR 8260 core/libs/tests/GuestPad.cpp
PR 10112 core/libs/prx/libScePad/src/PadState.cpp
PR 10206 tools/pad_input.py
tools/tests/test_pad_input.py
PR 11360 tools/pad_input.py
tools/tests/test_pad_input.py

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 27, 2026
@adriadam10 adriadam10 self-assigned this Oct 27, 2026
@adriadam10
adriadam10 force-pushed the feat/pad-file-touch-coordinates branch from fa153a8 to 0701378 Compare October 27, 2026 12:01
@github-actions github-actions Bot added prx and removed needs rebase Conflicts with main, rebase needed labels Oct 27, 2026
@adriadam10
adriadam10 merged commit ee5e247 into boykopovar:main Oct 28, 2026
14 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Rebased onto current main. The conflict was in PadState.cpp: main gained the intercepted flag, so I made the injected coordinate contact obey it (injectedContact = !intercepted && injected.hasTouch), as the PR description anticipated, the same way injected buttons and sticks already do. The parser, tools/pad_input.py and the tests are unchanged; the merge queue's full Build is the gate; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prx unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants