Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input test function for Remote RetroPad #16357

Merged
merged 1 commit into from
Mar 16, 2024

Conversation

zoltanvb
Copy link
Contributor

Description

Add input test capability for Remote Retropad core:

  • read an .ratst file (JSON format) with test steps
  • display instruction (via libretro SET_MESSAGE)
  • highlight input to be activated
  • display summary when test is finished

Since the Remote Retropad does not support content loading, the only way to pass the .ratst file is to invoke RA from command line:
retroarch -L netretropad <testfile.ratst>

This will result in a sequence where user is instructed to activate inputs / axes one after the other:

[INFO] [Environ]: SET_MESSAGE: Press A
[libretro INFO] [Remote RetroPad]: Proceeding to test step 0 at frame 301, next: 601
[libretro INFO] [Remote RetroPad]: Test step 0 successful at frame 363
[INFO] [Environ]: SET_MESSAGE: Press B
[libretro INFO] [Remote RetroPad]: Proceeding to test step 1 at frame 364, next: 664
[libretro INFO] [Remote RetroPad]: Test step 1 successful at frame 401
...
[INFO] [Environ]: SET_MESSAGE: Move right analog stick right fully
[libretro INFO] [Remote RetroPad]: Proceeding to test step 31 at frame 1353, next: 1653
[libretro INFO] [Remote RetroPad]: Test step 31 successful at frame 1354
[INFO] [Environ]: SET_MESSAGE: Test sequence finished, result: 32/32 inputs detected
[libretro INFO] [Remote RetroPad]: Test sequence finished at frame 1355, result: 32/32 inputs detected

Combined with --max-frames, --appendconfig, a bit of log parsing, and test input driver(s) - to be created separately -, it can serve as a test harness for input related functions.

Already in the present form, it can be used for manual troubleshooting, by asking the user to start the remote pad, try to send inputs, then press A+B which will print a short summary to log. Some combo inputs are recorded explicitly (d-pad diagonals, opposing directions, and the combos currently selectable for menu/exit).
[libretro INFO] [Remote RetroPad]: Validated state: 00003dfd combo: 00002a0f

JSON reader functions lifted and adapted from disk_index_file.c . Sample test file supplied, with all current RetroPad inputs.

Related Pull Requests

#16342

Add input test capability for Remote Retropad core:
- read an .ratst file (JSON format) with test steps
- display instruction (via libretro SET_MESSAGE)
- highlight input to be activated
- display summary when test is finished
@LibretroAdmin LibretroAdmin merged commit 99aadc8 into libretro:master Mar 16, 2024
27 checks passed
@zoltanvb zoltanvb deleted the remote_pad_test_input branch May 19, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants