mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Revert "Part 1 of menu input remapping"
This reverts commit 5b2d950034
.
This commit is contained in:
parent
85441f34a7
commit
8e95e87b2f
@ -271,7 +271,6 @@ struct settings
|
||||
char joypad_driver[32];
|
||||
char keyboard_layout[64];
|
||||
|
||||
unsigned menu_remap_ids[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
unsigned remap_ids[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
struct retro_keybind binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
struct retro_keybind autoconf_binds[MAX_USERS][RARCH_BIND_LIST_END];
|
||||
@ -285,7 +284,6 @@ struct settings
|
||||
unsigned libretro_device[MAX_USERS];
|
||||
unsigned analog_dpad_mode[MAX_USERS];
|
||||
|
||||
bool menu_remap_binds_enable;
|
||||
bool remap_binds_enable;
|
||||
float axis_threshold;
|
||||
unsigned joypad_map[MAX_USERS];
|
||||
|
@ -118,14 +118,3 @@ void input_remapping_set_defaults(void)
|
||||
g_settings.input.remap_ids[i][j] = g_settings.input.binds[i][j].id;
|
||||
}
|
||||
}
|
||||
|
||||
void input_menu_remapping_set_defaults(void)
|
||||
{
|
||||
unsigned i, j;
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
for (j = 0; j < RARCH_BIND_LIST_END; j++)
|
||||
g_settings.input.menu_remap_ids[i][j] = g_settings.input.binds[i][j].id;
|
||||
}
|
||||
}
|
||||
|
@ -44,8 +44,6 @@ void input_remapping_save_file(const char *path);
|
||||
|
||||
void input_remapping_set_defaults(void);
|
||||
|
||||
void input_menu_remapping_set_defaults(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -425,68 +425,29 @@ int menu_input_bind_iterate_keyboard(void *data)
|
||||
|
||||
unsigned menu_input_frame(retro_input_t trigger_state)
|
||||
{
|
||||
int16_t libretro_id = -1;
|
||||
unsigned menu_id = 0;
|
||||
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_UP))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_UP;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_DOWN;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_LEFT;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_RIGHT;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_L))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_L;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_R))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_R;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_B))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_B;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_A))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_A;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_Y))
|
||||
libretro_id = RETRO_DEVICE_ID_JOYPAD_Y;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_START))
|
||||
libretro_id = MENU_ACTION_START;
|
||||
else if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
libretro_id = MENU_ACTION_SELECT;
|
||||
else if (trigger_state & (1ULL << RARCH_MENU_TOGGLE))
|
||||
libretro_id = MENU_ACTION_TOGGLE;
|
||||
|
||||
if (g_settings.input.menu_remap_binds_enable)
|
||||
{
|
||||
unsigned port = 0;
|
||||
if (libretro_id != -1)
|
||||
libretro_id = g_settings.input.menu_remap_ids[0][libretro_id];
|
||||
}
|
||||
|
||||
switch (libretro_id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_JOYPAD_UP:
|
||||
return MENU_ACTION_UP;
|
||||
case RETRO_DEVICE_ID_JOYPAD_DOWN:
|
||||
return MENU_ACTION_DOWN;
|
||||
case RETRO_DEVICE_ID_JOYPAD_LEFT:
|
||||
return MENU_ACTION_LEFT;
|
||||
case RETRO_DEVICE_ID_JOYPAD_RIGHT:
|
||||
return MENU_ACTION_RIGHT;
|
||||
case RETRO_DEVICE_ID_JOYPAD_L:
|
||||
return MENU_ACTION_SCROLL_UP;
|
||||
case RETRO_DEVICE_ID_JOYPAD_R:
|
||||
return MENU_ACTION_SCROLL_DOWN;
|
||||
case RETRO_DEVICE_ID_JOYPAD_B:
|
||||
return MENU_ACTION_CANCEL;
|
||||
case RETRO_DEVICE_ID_JOYPAD_A:
|
||||
return MENU_ACTION_OK;
|
||||
case RETRO_DEVICE_ID_JOYPAD_Y:
|
||||
return MENU_ACTION_Y;
|
||||
case RETRO_DEVICE_ID_JOYPAD_START:
|
||||
return MENU_ACTION_START;
|
||||
case RETRO_DEVICE_ID_JOYPAD_SELECT:
|
||||
return MENU_ACTION_SELECT;
|
||||
case RARCH_MENU_TOGGLE:
|
||||
return MENU_ACTION_TOGGLE;
|
||||
}
|
||||
|
||||
return MENU_ACTION_UP;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN))
|
||||
return MENU_ACTION_DOWN;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT))
|
||||
return MENU_ACTION_LEFT;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT))
|
||||
return MENU_ACTION_RIGHT;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_L))
|
||||
return MENU_ACTION_SCROLL_UP;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_R))
|
||||
return MENU_ACTION_SCROLL_DOWN;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_B))
|
||||
return MENU_ACTION_CANCEL;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_A))
|
||||
return MENU_ACTION_OK;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_Y))
|
||||
return MENU_ACTION_Y;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_START))
|
||||
return MENU_ACTION_START;
|
||||
if (trigger_state & (1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT))
|
||||
return MENU_ACTION_SELECT;
|
||||
if (trigger_state & (1ULL << RARCH_MENU_TOGGLE))
|
||||
return MENU_ACTION_TOGGLE;
|
||||
return MENU_ACTION_NOOP;
|
||||
}
|
||||
|
@ -297,6 +297,9 @@
|
||||
# Enable or disable the current overlay.
|
||||
# input_overlay_enable = true
|
||||
|
||||
# If enabled, overrides the input binds with the remapped binds set for the current core.
|
||||
# input_remap_binds_enable = true
|
||||
|
||||
# Path to input overlay
|
||||
# input_overlay =
|
||||
|
||||
@ -308,7 +311,6 @@
|
||||
|
||||
#### Input
|
||||
|
||||
|
||||
# Input driver. Depending on video driver, it might force a different input driver.
|
||||
# input_driver = sdl
|
||||
|
||||
@ -318,12 +320,6 @@
|
||||
# Path to input remapping file.
|
||||
# input_remapping_path =
|
||||
|
||||
# If enabled, overrides the input binds with the remapped binds set for the current core.
|
||||
# input_remap_binds_enable = true
|
||||
|
||||
# If enabled, overrides the menu input binds with remapped binds.
|
||||
# input_menu_remap_binds_enable = true
|
||||
|
||||
# Maximum amount of users supported by RetroArch.
|
||||
# input_max_users = 16
|
||||
|
||||
|
@ -527,7 +527,6 @@ static void config_set_defaults(void)
|
||||
g_settings.input.input_descriptor_label_show = input_descriptor_label_show;
|
||||
g_settings.input.input_descriptor_hide_unbound = input_descriptor_hide_unbound;
|
||||
g_settings.input.remap_binds_enable = true;
|
||||
g_settings.input.menu_remap_binds_enable = true;
|
||||
g_settings.input.max_users = MAX_USERS;
|
||||
|
||||
rarch_assert(sizeof(g_settings.input.binds[0]) >= sizeof(retro_keybinds_1));
|
||||
@ -540,7 +539,6 @@ static void config_set_defaults(void)
|
||||
sizeof(retro_keybinds_rest));
|
||||
|
||||
input_remapping_set_defaults();
|
||||
input_menu_remapping_set_defaults();
|
||||
|
||||
for (i = 0; i < MAX_USERS; i++)
|
||||
{
|
||||
@ -1213,8 +1211,6 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
|
||||
CONFIG_GET_BOOL(input.remap_binds_enable,
|
||||
"input_remap_binds_enable");
|
||||
CONFIG_GET_BOOL(input.menu_remap_binds_enable,
|
||||
"menu_input_remap_binds_enable");
|
||||
CONFIG_GET_FLOAT(input.axis_threshold, "input_axis_threshold");
|
||||
CONFIG_GET_BOOL(input.netplay_client_swap_input,
|
||||
"netplay_client_swap_input");
|
||||
@ -1810,8 +1806,6 @@ bool config_save_file(const char *path)
|
||||
g_settings.input.axis_threshold);
|
||||
config_set_bool(conf, "input_remap_binds_enable",
|
||||
g_settings.input.remap_binds_enable);
|
||||
config_set_bool(conf, "menu_input_remap_binds_enable",
|
||||
g_settings.input.menu_remap_binds_enable);
|
||||
config_set_bool(conf, "netplay_client_swap_input",
|
||||
g_settings.input.netplay_client_swap_input);
|
||||
config_set_bool(conf, "input_descriptor_label_show",
|
||||
|
@ -4802,18 +4802,6 @@ static bool setting_data_append_list_input_options(
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
|
||||
CONFIG_BOOL(
|
||||
g_settings.input.menu_remap_binds_enable,
|
||||
"menu_input_remap_binds_enable",
|
||||
"Menu Remap Binds Enable",
|
||||
true,
|
||||
"OFF",
|
||||
"ON",
|
||||
group_info.name,
|
||||
subgroup_info.name,
|
||||
general_write_handler,
|
||||
general_read_handler);
|
||||
|
||||
CONFIG_BOOL(
|
||||
g_settings.input.autodetect_enable,
|
||||
"input_autodetect_enable",
|
||||
|
Loading…
Reference in New Issue
Block a user