Skip to content

feat(libScePad): read per-title input profiles beside the shared input file - #7499

Merged
4 commits merged into
boykopovar:mainfrom
AlxcBTW:pr/input-profiles
Nov 4, 2026
Merged

4 commits merged into
boykopovar:mainfrom
AlxcBTW:pr/input-profiles

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

What

anyps5-input.ini (or the file ANYPS5_INPUT_CONFIG names) applies to every title. Mouse sensitivity, curve and bindings that suit one title do not suit the next, and the only way to switch is to edit the file or set ANYPS5_INPUT_CONFIG for each launch.

Pad::LoadInputMapping(titleId) now reads a second file after the shared one: anyps5-input.<TITLEID>.ini in the same directory as the shared file (beside the executable, or beside the file ANYPS5_INPUT_CONFIG names), where <TITLEID> is the running title's ID from GetAppTitleId_nid_postfix. The profile has the same format and overrides only what it lists: an action it names replaces the bindings from the shared file (and the built-in ones), a setting it names replaces the shared value, everything else stays. A missing profile is not an error; an invalid line in one reports the profile's path and line like the shared file does. A title ID is used only if it has at most 32 characters of letters, digits, _ and - (Pad::InputProfileName), so an ID can never name a path outside the directory.

The parsing loop moved unchanged into one function (loadInputFile) that both files use; each file keeps its own "first line replaces, later lines add" and "setting given twice" state. With no profile, or no title ID, the result is the same as before. docs/user/INPUT_MAPPING.md has a "Per-game profiles" section.

Tested

  • Linux (Ubuntu 24.04, GCC 13, Mesa lavapipe runner), fork CI at 55b64a0 (the PR head 636cc9e plus the CI scaffolding commit; run 39115078106, ctest -R '^(pad_|guest_pad|video_out_mouse|mouse_input|keyboard_input)'): 9 of 9 passed, among them pad_input_mapping. Not run on Windows. An earlier run of the previous head (39113712815) failed to compile (InputBinding unqualified in the moved loop) and was fixed before this one.
  • New checks in pad_input_mapping: profile names (valid IDs, empty, path separator, dot, over the length limit); a profile overrides and adds settings and replaces the bindings of an action it lists; another title ID and no title ID keep the shared file; a partial profile keeps what it does not list; a profile may set a setting the shared file also sets; an invalid profile names its file and line and does not affect other titles.
  • Not tested in a game; the title ID wiring in PadInput (GetAppTitleId_nid_postfix, trimmed at the first NUL) is covered only by compiling.
  • python3 tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py lists no overlap with a comparable pull request and could not compare feat(input): add native SDL input configuration with ImGui #674, feat(agc,videoout): save the displayed frame as a PNG with a screenshot key #4891 and Macos port #7201 (InputMapping.cpp, PadInput.cpp, InputMapping.hpp, docs); feat(input): add native SDL input configuration with ImGui #674 (an input editor) also changes PadInput.cpp and INPUT_MAPPING.md. Based on cdb7ed0.

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
  • Unblocks: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 18, 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 9154 core/libs/prx/libSceVideoOut/src/PadInput.cpp
PR 10112 core/libs/prx/libSceVideoOut/src/PadInput.cpp
PR 11860 core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
PR 14098 core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
PR 14313 core/libs/prx/libScePad/include/InputMapping.hpp
core/libs/prx/libSceVideoOut/src/InputMapping.cpp
core/libs/prx/libSceVideoOut/src/PadInput.cpp
core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
docs/user/INPUT_MAPPING.md

@LeandroLP23

Copy link
Copy Markdown
Contributor

Windows run, since the description lists Windows as not run. Windows 11 26300, Ryzen AI 7 350, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. main 6efb7261b with this PR (636cc9e58) merged alone. It conflicts with #7496 to #7498, so it was not combined with them.

The build is clean. pad_input_mapping, which holds the new profile checks, together with pad_keyboard_mouse and pad_sdl, passes 3 runs of 3.

AI-assisted

@AlxcBTW

AlxcBTW commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@LeandroLP23 thanks for the Windows run. The conflict with #7496 to #7498 is textual: all four add rows to the default-bindings table in docs/user/INPUT_MAPPING.md and touch the same binding list. Whichever merges first, I rebase the others onto it.

AI-assisted: yes (Claude Code)

@oneandonlydean oneandonlydean self-assigned this Oct 18, 2026
@oneandonlydean

Copy link
Copy Markdown
Collaborator

One small change before merge: the example profile name in docs/user/INPUT_MAPPING.md ("for example anyps5-input.PPSA16064.ini") uses a real title's ID. We keep user docs free of specific titles. Could you use a placeholder such as anyps5-input.PPSA00000.ini there, and in profileNames() in tests/InputMapping.cpp (the 4 PPSA16064 lines)? The other profile tests already use PPSA00001/PPSA00002, so any made-up ID works.

The rest reads well: the loop moved unchanged, each file keeps its own override state, and InputProfileName can't name a path outside the directory. Heads-up on order: this conflicts with #7496 and #7500 in tests/InputMapping.cpp (and with #7500 in INPUT_MAPPING.md). They're add/add conflicts at the same spot, and keeping both sides resolves them. Whichever lands second will need a rebase.

AlxcBTW and others added 2 commits October 18, 2026 22:24
# Conflicts:
#	core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
# Conflicts:
#	core/libs/prx/libSceVideoOut/tests/InputMapping.cpp
#	docs/user/INPUT_MAPPING.md
@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed and removed needs rebase Conflicts with main, rebase needed labels Oct 18, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (authorship unchanged). Test-function conflicts unioned (main's newer stick-modifier/keyboard-ramp tests kept alongside your profile tests, with the runner calls integrated); docs unioned.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; the input-mapping tests pass; conventions pass; full suite green apart from the four known main regressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7499
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 8942f4739.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@blawesom thanks for the rebase. The code and tests come through exactly as reviewed, and main's stick-modifier and keyboard-ramp tests are all still there and called next to the profile tests.

One fix is needed in docs/user/INPUT_MAPPING.md: in the per-game profile example, the ```ini fences got lost and main's next heading ended up on the example's last line:

MouseSensitivity = 0.6
Cross = KEY:F## Mouse as the right stick

It should read:

```ini
MouseSensitivity = 0.6
Cross = KEY:F
```

## Mouse as the right stick

@AlxcBTW this is a real rebase (it doesn't contain your current head), so --ff-only won't pick it up. Once the docs fix is on rebase/7499, adopting it would be git fetch https://github.com/blawesom/AnyPS5 rebase/7499, then git reset --hard FETCH_HEAD on your branch and git push --force-with-lease. Or you can merge main into your branch yourself. The PPSA16064 example ID from the earlier comment still needs swapping for a placeholder, and that can go in the same push.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

@AlxcBTW we prepared the small change from our earlier review but couldn't push it to your branch (this fork doesn't allow maintainer edits), so here it is to apply yourself. It only replaces the real title ID in the examples with the fictional PPSA00001; nothing else changes.

  • core/libs/prx/libSceVideoOut/tests/InputMapping.cpp, profileNames(): the three PPSA16064 occurrences ("PPSA16064" / "anyps5-input.PPSA16064.ini", "../PPSA16064", "PPSA16064.ini") become PPSA00001.
  • docs/user/INPUT_MAPPING.md, "Per-game profiles": anyps5-input.PPSA16064.ini becomes anyps5-input.PPSA00001.ini.

Or run, from the repository root: sed -i 's/PPSA16064/PPSA00001/g' core/libs/prx/libSceVideoOut/tests/InputMapping.cpp docs/user/INPUT_MAPPING.md

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 30, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 83021ee merged onto main f6fddd6 · tested 2026-10-30 08:39 UTC · 18 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 815 passed · 0 failed · 8 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 823 of 2,950 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (401 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 69.1 s
Validation IDs already present on main (3 IDs in 125 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (125 tests): agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_bitfield_mask, agc_driver_buffer_atomic_csub, agc_driver_buffer_atomics, and 117 more
VUID-vkCmdCopyImage-srcImage-01548 (6 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
VUID-vkCmdCopyImage-srcImage-01551 (6 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_partial_store, agc_driver_depth_storage_dispatch, agc_driver_depth_surface_from_storage, agc_driver_dispatch_move_depth
Skipped (8)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
Reproduce
git fetch origin 83021ee52aabb010fb1d2e6dbca8db60a0ddd96f f6fddd60d826831f70f7c62e25423610ee742bcc
git checkout f6fddd60d826831f70f7c62e25423610ee742bcc && git merge --no-ff 83021ee52aabb010fb1d2e6dbca8db60a0ddd96f
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Your fork is archived, so we carried this as #14313 with your commits and credit. Thank you!

@oneandonlydean oneandonlydean closed this pull request by merging all changes into boykopovar:main in 08f19f9 Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs needs rebase Conflicts with main, rebase needed prx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants