Start preparing for remap binds
This commit is contained in:
parent
74698f73bf
commit
31d816b6d3
4
driver.h
4
driver.h
|
@ -143,11 +143,7 @@ struct retro_keybind
|
||||||
const char *desc;
|
const char *desc;
|
||||||
enum retro_key key;
|
enum retro_key key;
|
||||||
|
|
||||||
/* PC only uses lower 16-bits.
|
|
||||||
* Full 64-bit can be used for port-specific purposes,
|
|
||||||
* like simplifying multiple binds, etc. */
|
|
||||||
uint64_t joykey;
|
uint64_t joykey;
|
||||||
|
|
||||||
/* Default key binding value - for resetting bind to default */
|
/* Default key binding value - for resetting bind to default */
|
||||||
uint64_t def_joykey;
|
uint64_t def_joykey;
|
||||||
|
|
||||||
|
|
|
@ -360,13 +360,15 @@ struct settings
|
||||||
char driver[32];
|
char driver[32];
|
||||||
char joypad_driver[32];
|
char joypad_driver[32];
|
||||||
char keyboard_layout[64];
|
char keyboard_layout[64];
|
||||||
|
|
||||||
struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END];
|
struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||||
|
struct retro_keybind remap_binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||||
|
struct retro_keybind autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||||
|
|
||||||
unsigned max_users;
|
unsigned max_users;
|
||||||
|
|
||||||
/* Set by autoconfiguration in joypad_autoconfig_dir.
|
/* Set by autoconfiguration in joypad_autoconfig_dir.
|
||||||
* Does not override main binds. */
|
* Does not override main binds. */
|
||||||
struct retro_keybind autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END];
|
|
||||||
bool autoconfigured[MAX_USERS];
|
bool autoconfigured[MAX_USERS];
|
||||||
|
|
||||||
unsigned libretro_device[MAX_USERS];
|
unsigned libretro_device[MAX_USERS];
|
||||||
|
|
11
settings.c
11
settings.c
|
@ -449,10 +449,17 @@ static void config_set_defaults(void)
|
||||||
|
|
||||||
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
||||||
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
|
rarch_assert(sizeof(g_settings.input.binds[1]) >= sizeof(retro_keybinds_rest));
|
||||||
|
|
||||||
memcpy(g_settings.input.binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
|
memcpy(g_settings.input.binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
|
||||||
|
memcpy(g_settings.input.remap_binds[0], retro_keybinds_1, sizeof(retro_keybinds_1));
|
||||||
|
|
||||||
for (i = 1; i < MAX_USERS; i++)
|
for (i = 1; i < MAX_USERS; i++)
|
||||||
|
{
|
||||||
memcpy(g_settings.input.binds[i], retro_keybinds_rest,
|
memcpy(g_settings.input.binds[i], retro_keybinds_rest,
|
||||||
sizeof(retro_keybinds_rest));
|
sizeof(retro_keybinds_rest));
|
||||||
|
memcpy(g_settings.input.remap_binds[i], retro_keybinds_rest,
|
||||||
|
sizeof(retro_keybinds_rest));
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
|
@ -468,8 +475,12 @@ static void config_set_defaults(void)
|
||||||
/* Verify that binds are in proper order. */
|
/* Verify that binds are in proper order. */
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
||||||
|
{
|
||||||
if (g_settings.input.binds[i][j].valid)
|
if (g_settings.input.binds[i][j].valid)
|
||||||
rarch_assert(j == g_settings.input.binds[i][j].id);
|
rarch_assert(j == g_settings.input.binds[i][j].id);
|
||||||
|
if (g_settings.input.remap_binds[i][j].valid)
|
||||||
|
rarch_assert(j == g_settings.input.remap_binds[i][j].id);
|
||||||
|
}
|
||||||
|
|
||||||
g_settings.input.axis_threshold = axis_threshold;
|
g_settings.input.axis_threshold = axis_threshold;
|
||||||
g_settings.input.netplay_client_swap_input = netplay_client_swap_input;
|
g_settings.input.netplay_client_swap_input = netplay_client_swap_input;
|
||||||
|
|
Loading…
Reference in New Issue