From 8bcaabe9a96d47480068e15f5a7fb31afd874183 Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 11:58:18 -0500 Subject: [PATCH 01/35] Commit CLion settings to repository, VSCode settings already exist and this way starting the project is easier. --- .gitignore | 1 - .idea/.gitignore | 8 ++++++++ .idea/misc.xml | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml diff --git a/.gitignore b/.gitignore index 996bbf24375..32c879eebe3 100644 --- a/.gitignore +++ b/.gitignore @@ -57,7 +57,6 @@ xcuserdata profile *.moved-aside DerivedData -.idea/ *.hmap apple/tmp apple/*.mobileprovision diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000000..13566b81b01 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000000..2f317c469fb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file From 1e720ef9e06bf5a8062b46bf3f2bf22c4d7ddaa4 Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 13:05:44 -0500 Subject: [PATCH 02/35] Bump netplay version; Slight refactor of inputs to use macros rather than magic numbers. --- .../libretro-net-retropad/net_retropad_core.c | 2 +- input/input_driver.c | 18 +++++++++--------- libretro-common/include/libretro.h | 12 ++++++++++++ network/netplay/netplay_frontend.c | 2 +- network/netplay/netplay_protocol.h | 2 +- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/cores/libretro-net-retropad/net_retropad_core.c b/cores/libretro-net-retropad/net_retropad_core.c index bedf072ad00..e69a264e704 100644 --- a/cores/libretro-net-retropad/net_retropad_core.c +++ b/cores/libretro-net-retropad/net_retropad_core.c @@ -92,7 +92,7 @@ static struct descriptor joypad = { .index_min = 0, .index_max = 0, .id_min = RETRO_DEVICE_ID_JOYPAD_B, - .id_max = RETRO_DEVICE_ID_JOYPAD_R3 + .id_max = RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS }; static struct descriptor analog = { diff --git a/input/input_driver.c b/input/input_driver.c index 177d5df2b86..a14ba6fa468 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -92,7 +92,7 @@ ) /* Human readable order of input binds */ -const unsigned input_config_bind_order[24] = { +const unsigned input_config_bind_order[RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS] = { RETRO_DEVICE_ID_JOYPAD_UP, RETRO_DEVICE_ID_JOYPAD_DOWN, RETRO_DEVICE_ID_JOYPAD_LEFT, @@ -109,14 +109,14 @@ const unsigned input_config_bind_order[24] = { RETRO_DEVICE_ID_JOYPAD_R2, RETRO_DEVICE_ID_JOYPAD_L3, RETRO_DEVICE_ID_JOYPAD_R3, - 19, /* Left Analog Up */ - 18, /* Left Analog Down */ - 17, /* Left Analog Left */ - 16, /* Left Analog Right */ - 23, /* Right Analog Up */ - 22, /* Right Analog Down */ - 21, /* Right Analog Left */ - 20, /* Right Analog Right */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_L_UP, /* Left Analog Up */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_L_DOWN, /* Left Analog Down */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_L_LEFT, /* Left Analog Left */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_L_RIGHT, /* Left Analog Right */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_R_UP, /* Right Analog Up */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_R_DOWN, /* Right Analog Down */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_R_LEFT, /* Right Analog Left */ + RETRO_DEVICE_ID_JOYPAD_ANALOG_R_RIGHT, /* Right Analog Right */ }; /**************************************/ diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index b16228b272d..895afaf25fb 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -202,6 +202,18 @@ extern "C" { #define RETRO_DEVICE_ID_JOYPAD_L3 14 #define RETRO_DEVICE_ID_JOYPAD_R3 15 +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_L_RIGHT 16 +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_L_LEFT 17 +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_L_DOWN 18 +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_L_UP 19 + +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_R_RIGHT 20 +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_R_LEFT 21 +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_R_DOWN 22 +#define RETRO_DEVICE_ID_JOYPAD_ANALOG_R_UP 23 + +#define RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS 24 + #define RETRO_DEVICE_ID_JOYPAD_MASK 256 /* Index / Id values for ANALOG device. */ diff --git a/network/netplay/netplay_frontend.c b/network/netplay/netplay_frontend.c index c53b81f4e7e..f8f30caed8c 100644 --- a/network/netplay/netplay_frontend.c +++ b/network/netplay/netplay_frontend.c @@ -7744,7 +7744,7 @@ static bool get_self_input_state( /* no break */ case RETRO_DEVICE_JOYPAD: - for (i = 0; i <= RETRO_DEVICE_ID_JOYPAD_R3; i++) + for (i = 0; i <= RETRO_DEVICE_ID_JOYPAD_MAX_BUTTONS; i++) { int16_t tmp = cb(local_device, RETRO_DEVICE_JOYPAD, 0, (unsigned)i); diff --git a/network/netplay/netplay_protocol.h b/network/netplay/netplay_protocol.h index 7583a2e2561..608fca18b77 100644 --- a/network/netplay/netplay_protocol.h +++ b/network/netplay/netplay_protocol.h @@ -19,7 +19,7 @@ #define __RARCH_NETPLAY_PROTOCOL_H #define LOW_NETPLAY_PROTOCOL_VERSION 5 -#define HIGH_NETPLAY_PROTOCOL_VERSION 6 +#define HIGH_NETPLAY_PROTOCOL_VERSION 7 #define NETPLAY_PROTOCOL_VERSION HIGH_NETPLAY_PROTOCOL_VERSION From a5bc0843f59f3a9b71a6b862ab2fe1191a51435a Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 14:21:48 -0500 Subject: [PATCH 03/35] Base new hypothetical input query for information about an input device. --- libretro-common/include/libretro.h | 146 +++++++++++++++++++++++++++++ runloop.c | 8 ++ 2 files changed, 154 insertions(+) diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index 895afaf25fb..eba0145458c 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -1864,6 +1864,16 @@ enum retro_mod * multiplayer, where a deterministic core supporting multiple * input devices does not need to take any action on its own. */ +#define RETRO_ENVIRONMENT_QUERY_INPUT_DEVICE_ID 79 + /* const struct retro_query_input_device_id * -- + * Allows a core to query information about what an id of + * a given device represents along with generic input information. + * The structure used is freeform. + * If this returns zero then the core must assume that the + * frontend does not provide such functionality. + * This realistically should be called before + * RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS. + */ /* VFS functionality */ @@ -3372,6 +3382,142 @@ struct retro_input_descriptor const char *description; }; +/** Used with @c retro_query_input_device_id to classify a specific input. */ +enum retro_query_input_device_id_class +{ + /** Unbound action, not bound to any key. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_UNBOUND, + + /** Standard digital button. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_DIGITAL_BUTTON, + + /** Analog button. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_ANALOG_BUTTON, + + /** Analog trigger. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_ANALOG_TRIGGER, + + /** Analog Joystick. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_JOYSTICK, + + /** Digital hat (d-pad). */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_HAT, + + /** Throttle. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_THROTTLE, + + /** Touch pad. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_TOUCH_PAD, + + /** Mouse. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_MOUSE, + + /** Light Gun. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_LIGHT_GUN, + + /** Number Pad, 1 on bottom. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_NUMBER_PAD, + + /** Dial Pad, 1 on top. */ + RETRO_QUERY_INPUT_DEVICE_ID_CLASS_DIAL_PAD, + + /** The number of input classes. */ + RETRO_NUM_QUERY_INPUT_DEVICE_ID_CLASS +}; + +/** Used with @c retro_query_input_device_id to specify where on the controller an input is. */ +enum retro_query_input_device_id_location +{ + /** Undefined. */ + RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_UNDEFINED, + + /** Left. */ + RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_LEFT, + + /** Middle. */ + RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_MIDDLE, + + /** Right. */ + RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_RIGHT, + + /** Top. */ + RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_TOP, + + /** Bottom. */ + RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_BOTTOM, + + /** Back. */ + RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_BACK, + + /** The number of locations. */ + RETRO_NUM_QUERY_INPUT_DEVICE_ID_LOCATION +}; + +/** Used with @c retro_query_input_device_id to specify the direction of the input relative to the location. */ +enum retro_query_input_device_id_direction +{ + /** Undefined. */ + RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_UNDEFINED, + + /** Left. */ + RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_LEFT, + + /** Right. */ + RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_RIGHT, + + /** Up. */ + RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_UP, + + /** Down. */ + RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_DOWN, + + /** The number of directions. */ + RETRO_NUM_QUERY_INPUT_DEVICE_ID_DIRECTION +}; + +/** Used with @c RETRO_ENVIRONMENT_QUERY_INPUT_DEVICE_ID to query device info. */ +struct retro_query_input_device_id +{ + /** Query for device information. */ + struct { + /** The device type to query such as @c RETRO_DEVICE_JOYPAD . */ + unsigned device; + + /** The ID of the specific input such as @c RETRO_DEVICE_ID_JOYPAD_Y. */ + unsigned id; + } query; + + /** Response given from the give query. */ + struct { + /** General response given for all commands. */ + struct { + /** The number of unbound actions. */ + unsigned numUnbound; + + /** The start id of unbound actions. */ + unsigned unboundStartId; + } general; + + /** Response for the specific device and ID. */ + struct { + /** Whether or not this input is known, if it is then other fields are valid. */ + bool known_id; + + /** The class of input this is, one of @c retro_query_input_device_id_class .*/ + enum retro_query_input_device_id_class input_class; + + /** The location where this button is on a controller, one of @c retro_query_input_device_id_location . */ + enum retro_query_input_device_id_location location; + + /** The direction the button is on relative to its location on the controller, one of @c retro_query_input_device_id_direction .*/ + enum retro_query_input_device_id_direction direction; + + /** The description of this specific id, such as @c "Right Trigger". */ + const char* description; + } specific; + } response; +}; + struct retro_system_info { /* All pointers are owned by libretro implementation, and pointers must diff --git a/runloop.c b/runloop.c index 43bed44704c..f51b3b23023 100644 --- a/runloop.c +++ b/runloop.c @@ -1402,6 +1402,10 @@ static void core_performance_counter_stop(struct retro_perf_counter *perf) } +void rarch_query_input_device_id(rarch_system_info_t *system_info, struct retro_query_input_device_id *idQuery) { + /* TODO: Implement this. */ +} + bool runloop_environment_cb(unsigned cmd, void *data) { unsigned p; @@ -3551,6 +3555,10 @@ bool runloop_environment_cb(unsigned cmd, void *data) } } break; + case RETRO_ENVIRONMENT_QUERY_INPUT_DEVICE_ID: + rarch_query_input_device_id(sys_info, (struct retro_query_input_device_id*)data); + break; + default: RARCH_LOG("[Environ]: UNSUPPORTED (#%u).\n", cmd); return false; From 7bb72701e3d0cb9faf186e2049b84d9b0d1c14d5 Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 14:27:11 -0500 Subject: [PATCH 04/35] Add glyph as well. --- libretro-common/include/libretro.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index eba0145458c..346eeb13a14 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -3514,6 +3514,9 @@ struct retro_query_input_device_id /** The description of this specific id, such as @c "Right Trigger". */ const char* description; + + /** The glyph that is shown for this input, may be @c NULL . */ + const char* glyph; } specific; } response; }; From b35169a979fc98184bc02c9c4493d8b7255204b7 Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 14:52:14 -0500 Subject: [PATCH 05/35] Simplify greatly. --- libretro-common/include/libretro.h | 143 +++-------------------------- runloop.c | 12 ++- 2 files changed, 22 insertions(+), 133 deletions(-) diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index 346eeb13a14..9ca0272afc7 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -1864,11 +1864,11 @@ enum retro_mod * multiplayer, where a deterministic core supporting multiple * input devices does not need to take any action on its own. */ -#define RETRO_ENVIRONMENT_QUERY_INPUT_DEVICE_ID 79 - /* const struct retro_query_input_device_id * -- - * Allows a core to query information about what an id of - * a given device represents along with generic input information. - * The structure used is freeform. +#define RETRO_ENVIRONMENT_GET_EXTRA_INPUT_ACTIONS 79 + /* const struct retro_get_extra_input_actions * -- + * Allows the core to query information on input actions + * that are additionally available but not bound to any + * physical button or key. * If this returns zero then the core must assume that the * frontend does not provide such functionality. * This realistically should be called before @@ -3382,142 +3382,25 @@ struct retro_input_descriptor const char *description; }; -/** Used with @c retro_query_input_device_id to classify a specific input. */ -enum retro_query_input_device_id_class -{ - /** Unbound action, not bound to any key. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_UNBOUND, - - /** Standard digital button. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_DIGITAL_BUTTON, - - /** Analog button. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_ANALOG_BUTTON, - - /** Analog trigger. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_ANALOG_TRIGGER, - - /** Analog Joystick. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_JOYSTICK, - - /** Digital hat (d-pad). */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_HAT, - - /** Throttle. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_THROTTLE, - - /** Touch pad. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_TOUCH_PAD, - - /** Mouse. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_MOUSE, - - /** Light Gun. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_LIGHT_GUN, - - /** Number Pad, 1 on bottom. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_NUMBER_PAD, - - /** Dial Pad, 1 on top. */ - RETRO_QUERY_INPUT_DEVICE_ID_CLASS_DIAL_PAD, - - /** The number of input classes. */ - RETRO_NUM_QUERY_INPUT_DEVICE_ID_CLASS -}; - -/** Used with @c retro_query_input_device_id to specify where on the controller an input is. */ -enum retro_query_input_device_id_location -{ - /** Undefined. */ - RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_UNDEFINED, - - /** Left. */ - RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_LEFT, - - /** Middle. */ - RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_MIDDLE, - - /** Right. */ - RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_RIGHT, - - /** Top. */ - RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_TOP, - - /** Bottom. */ - RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_BOTTOM, - - /** Back. */ - RETRO_QUERY_INPUT_DEVICE_ID_LOCATION_BACK, - - /** The number of locations. */ - RETRO_NUM_QUERY_INPUT_DEVICE_ID_LOCATION -}; - -/** Used with @c retro_query_input_device_id to specify the direction of the input relative to the location. */ -enum retro_query_input_device_id_direction -{ - /** Undefined. */ - RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_UNDEFINED, - - /** Left. */ - RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_LEFT, - - /** Right. */ - RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_RIGHT, - - /** Up. */ - RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_UP, - - /** Down. */ - RETRO_QUERY_INPUT_DEVICE_ID_DIRECTION_DOWN, - - /** The number of directions. */ - RETRO_NUM_QUERY_INPUT_DEVICE_ID_DIRECTION -}; - -/** Used with @c RETRO_ENVIRONMENT_QUERY_INPUT_DEVICE_ID to query device info. */ -struct retro_query_input_device_id +/** Used with @c RETRO_ENVIRONMENT_GET_EXTRA_INPUT_ACTIONS to query device info. */ +struct retro_get_extra_input_actions { /** Query for device information. */ struct { /** The device type to query such as @c RETRO_DEVICE_JOYPAD . */ unsigned device; - - /** The ID of the specific input such as @c RETRO_DEVICE_ID_JOYPAD_Y. */ - unsigned id; } query; /** Response given from the give query. */ struct { - /** General response given for all commands. */ - struct { - /** The number of unbound actions. */ - unsigned numUnbound; - - /** The start id of unbound actions. */ - unsigned unboundStartId; - } general; - - /** Response for the specific device and ID. */ - struct { - /** Whether or not this input is known, if it is then other fields are valid. */ - bool known_id; - - /** The class of input this is, one of @c retro_query_input_device_id_class .*/ - enum retro_query_input_device_id_class input_class; - - /** The location where this button is on a controller, one of @c retro_query_input_device_id_location . */ - enum retro_query_input_device_id_location location; - - /** The direction the button is on relative to its location on the controller, one of @c retro_query_input_device_id_direction .*/ - enum retro_query_input_device_id_direction direction; + /** Is this device type known? */ + bool known; - /** The description of this specific id, such as @c "Right Trigger". */ - const char* description; + /** The number of extra IDs. */ + unsigned numExtra; - /** The glyph that is shown for this input, may be @c NULL . */ - const char* glyph; - } specific; + /** The start ID of the extra IDs. */ + unsigned numExtraStartId; } response; }; diff --git a/runloop.c b/runloop.c index f51b3b23023..3faaee93f0e 100644 --- a/runloop.c +++ b/runloop.c @@ -1401,8 +1401,14 @@ static void core_performance_counter_stop(struct retro_perf_counter *perf) perf->total += cpu_features_get_perf_counter() - perf->start; } +void rarch_query_input_device_id(rarch_system_info_t *system_info, + struct retro_get_extra_input_actions *idQuery) { + + /* We only know about the joypad. */ + if (idQuery->query.device != RETRO_DEVICE_JOYPAD) { + idQuery->response.known = false; + } -void rarch_query_input_device_id(rarch_system_info_t *system_info, struct retro_query_input_device_id *idQuery) { /* TODO: Implement this. */ } @@ -3555,8 +3561,8 @@ bool runloop_environment_cb(unsigned cmd, void *data) } } break; - case RETRO_ENVIRONMENT_QUERY_INPUT_DEVICE_ID: - rarch_query_input_device_id(sys_info, (struct retro_query_input_device_id*)data); + case RETRO_ENVIRONMENT_GET_EXTRA_INPUT_ACTIONS: + rarch_query_input_device_id(sys_info, (struct retro_get_extra_input_actions*)data); break; default: From ef5da42d6a0bf9ceac59e5276a72962313502d7d Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 15:02:49 -0500 Subject: [PATCH 06/35] Corrections to naming, mark experimental. --- libretro-common/include/libretro.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libretro-common/include/libretro.h b/libretro-common/include/libretro.h index 9ca0272afc7..e7e3c634b9b 100644 --- a/libretro-common/include/libretro.h +++ b/libretro-common/include/libretro.h @@ -1864,7 +1864,7 @@ enum retro_mod * multiplayer, where a deterministic core supporting multiple * input devices does not need to take any action on its own. */ -#define RETRO_ENVIRONMENT_GET_EXTRA_INPUT_ACTIONS 79 +#define RETRO_ENVIRONMENT_GET_EXTRA_INPUT_ACTIONS (79 | RETRO_ENVIRONMENT_EXPERIMENTAL) /* const struct retro_get_extra_input_actions * -- * Allows the core to query information on input actions * that are additionally available but not bound to any @@ -3397,10 +3397,10 @@ struct retro_get_extra_input_actions bool known; /** The number of extra IDs. */ - unsigned numExtra; + unsigned num_extra; /** The start ID of the extra IDs. */ - unsigned numExtraStartId; + unsigned extra_start_id; } response; }; From 57df9c027a7e0ac8d97926924dfc64e08ccc74cd Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 15:41:45 -0500 Subject: [PATCH 07/35] Just set something in the return value. --- runloop.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/runloop.c b/runloop.c index 3faaee93f0e..a849adf4880 100644 --- a/runloop.c +++ b/runloop.c @@ -1401,15 +1401,20 @@ static void core_performance_counter_stop(struct retro_perf_counter *perf) perf->total += cpu_features_get_perf_counter() - perf->start; } -void rarch_query_input_device_id(rarch_system_info_t *system_info, - struct retro_get_extra_input_actions *idQuery) { +static void rarch_get_extra_input_actions(rarch_system_info_t *system_info, + struct retro_get_extra_input_actions *request) { /* We only know about the joypad. */ - if (idQuery->query.device != RETRO_DEVICE_JOYPAD) { - idQuery->response.known = false; + if (request->query.device != RETRO_DEVICE_JOYPAD) { + request->response.known = false; } /* TODO: Implement this. */ + request->response.known = true; + request->response.num_extra = 1; + request->response.extra_start_id = 128; + + RARCH_LOG("rarch_get_extra_input_actions(%p, %p)", system_info, request); } bool runloop_environment_cb(unsigned cmd, void *data) @@ -3562,7 +3567,7 @@ bool runloop_environment_cb(unsigned cmd, void *data) } break; case RETRO_ENVIRONMENT_GET_EXTRA_INPUT_ACTIONS: - rarch_query_input_device_id(sys_info, (struct retro_get_extra_input_actions*)data); + rarch_get_extra_input_actions(sys_info, (struct retro_get_extra_input_actions*)data); break; default: From f236b449da3060e5f470626adca2fd8e18884d91 Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Sat, 23 Dec 2023 17:01:35 -0500 Subject: [PATCH 08/35] Initialize inputs and debug printing; Also as well fix some constants. --- .idea/misc.xml | 1 + input/input_defines.h | 5 + input/input_driver.h | 2 +- retroarch_types.h | 2 +- runloop.c | 270 +++++++++++++++++++++++------------------- 5 files changed, 154 insertions(+), 126 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 2f317c469fb..11f00163296 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -4,6 +4,7 @@