Skip to content

Commit

Permalink
Test input joypad driver (libretro#16370)
Browse files Browse the repository at this point in the history
* Test driver for joypad inputs

Add a new joypad input driver:
- hide driver behind #ifdef and enable it in config_params.sh
- add a new config parameter to specify the test input file
- add aux files: additional config files that cancel out any binds
  that may be present in RA config, autoconfig profile for
  test joypads, test input file that matches controller test
  sequence

* Fixes and comments for test input driver.
  • Loading branch information
zoltanvb authored and Sunderland93 committed Dec 26, 2024
1 parent 115feb1 commit f72ad70
Show file tree
Hide file tree
Showing 15 changed files with 1,175 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -2431,6 +2431,12 @@ ifeq ($(HAVE_WEBOS), 1)
DEFINES += -DWEBOS
endif

ifeq ($(HAVE_TEST_DRIVERS), 1)
DEFINES += -DHAVE_TEST_DRIVERS
OBJ += input/drivers_joypad/test_joypad.o
endif


#####################################
### Android Play Feature Delivery ###
### (Play Store build core ###
Expand Down
4 changes: 4 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,10 @@ static struct config_path_setting *populate_settings_path(
SETTING_PATH("bottom_assets_directory", settings->paths.directory_bottom_assets, true, NULL, true);
#endif

#ifdef HAVE_TEST_DRIVERS
SETTING_PATH("test_input_file_joypad", settings->paths.test_input_file_joypad, false, NULL, true);
#endif

SETTING_ARRAY("log_dir", settings->paths.log_dir, true, NULL, true);
SETTING_ARRAY("app_icon", settings->paths.app_icon, true, NULL, true);

Expand Down
3 changes: 3 additions & 0 deletions configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ typedef struct settings
char streaming_title[PATH_MAX_LENGTH];
#ifdef _3DS
char directory_bottom_assets[PATH_MAX_LENGTH];
#endif
#ifdef HAVE_TEST_DRIVERS
char test_input_file_joypad[PATH_MAX_LENGTH];
#endif
char log_dir[PATH_MAX_LENGTH];
char app_icon[PATH_MAX_LENGTH];
Expand Down
3 changes: 3 additions & 0 deletions cores/libretro-net-retropad/net_retropad_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ void NETRETROPAD_CORE_PREFIX(retro_run)(void)
NETRETROPAD_CORE_PREFIX(log_cb)(RETRO_LOG_INFO,
"[Remote RetroPad]: Test sequence finished at frame %d, result: %d/%d inputs detected\n",
current_frame, pass_count, last_test_step);
NETRETROPAD_CORE_PREFIX(log_cb)(RETRO_LOG_INFO,
"[Remote RetroPad]: Validated state: %08x combo: %08x\n",
input_state_validated, combo_state_validated);
}
}

Expand Down
4 changes: 4 additions & 0 deletions griffin/griffin.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,10 @@ INPUT
#endif
#endif

#ifdef HAVE_TEST_DRIVERS
#include "../input/drivers_joypad/test_joypad.c"
#endif

/*============================================================
INPUT (HID)
============================================================ */
Expand Down
Loading

0 comments on commit f72ad70

Please sign in to comment.