Skip to content

feat(pad): let controller timelines hold stick positions - #16097

Open
LeandroLP23 wants to merge 1 commit into
boykopovar:mainfrom
LeandroLP23:feat/pad-timeline-sticks
Open

LeandroLP23 wants to merge 1 commit into
boykopovar:mainfrom
LeandroLP23:feat/pad-timeline-sticks

Conversation

@LeandroLP23

Copy link
Copy Markdown
Contributor

What

A controller timeline (APS5_PAD_INPUT_FILE, tools/pad_timeline.py) could only press buttons, while a single pulse can already set the four stick axes. Titles whose menus move only with the left stick cannot be driven by a timeline. SuperTuxKart (PPSA69421) is one: its input.xml binds menuUp/Down/Left/Right to axes 0 and 1 and menuSelect to button 0, so d-pad presses do nothing in its menus.

  • Runtime (InputCommandFile.hpp): a timeline row may be start duration buttons or start duration buttons lx ly rx ry, the same axis order and 0..255 range as a pulse. While the row is active its axes replace the physical sticks; rows without axes keep them as before. The row is split with the separators the numeric extraction accepted before (whitespace, or a + sign starting the next number), so existing timelines such as 0+500+16 still parse.
  • pad_timeline.py: events may hold left_stick and/or right_stick as [x, y]; an event naming one stick writes the other centred (128). Unknown event fields are still rejected.
  • pad_input.py (reading an existing timeline for the next sequence) and preview_pad_timeline.py accept the 7-column rows; the preview shows both sticks.
  • INPUT_MAPPING.md documents the fields.

Tested

  • pad_command_file_tests (InputCommandFile.cpp) with the new cases passes. Built against main's header, the same test fails (input command assertion failed). The new cases: a stick row followed by a button-only row, rows with 4, 6 and 8 columns, an axis of 256 and a non-numeric axis are all refused, and a +-joined 7-column row is accepted.
  • python -m unittest tools.tests.test_pad_timeline tools.tests.test_pad_input tools.tests.test_preview_pad_timeline: 64 pass (3 skipped as on main). New cases cover stick rows, position validation (missing, extra, out of range, bool and float axes), unknown event fields, and sequence handling of stick rows in pad_input.py.
  • Windows 11, Radeon 860M, main 4741457fed with this header: a timeline {"at_ms":0,"hold_ms":400,"buttons":[],"left_stick":[255,128]} sent to SuperTuxKart moves its tutorial dialog's focus from "No" to "Yes" (dumped frames), which button-only timelines could not do. A temporary log in scePadReadState showed the title reading port 0 with the injected buttons and connected=1.
  • python tools/check_conventions.py --base origin/main passes.

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. test(tools): pin timeline CLI encoding #15340 adds other cases to tools/tests/test_pad_timeline.py, and fix(tools): report controller command file errors cleanly #11360 changes pad_input.py's error reporting, not its timeline parsing; whichever lands second rebases.
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (controller input; the live check used a Radeon 860M)
  • AI-assisted: yes (Claude Code)

@JJenkx

JJenkx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 3c94e09858, merged onto main dab11d4569 (7676b00ea4, clean merge).

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run this test on pull requests.

  • pad_command_file passes in 3 of 3 runs, none skipped.

AI-assisted: yes.

A timeline row may carry the four stick axes after its buttons, as a
single pulse already can. pad_timeline.py writes them from optional
left_stick and right_stick event fields; pad_input.py and the preview
accept such rows. Titles whose menus move only with the left stick,
such as SuperTuxKart, can then be driven by a timeline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

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 11360 tools/pad_input.py
tools/tests/test_pad_input.py

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants