From 8e95e87b2fa397fea8b71c5f9e3519c206a0e8cb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 25 Jan 2015 04:52:26 +0100 Subject: [PATCH] Revert "Part 1 of menu input remapping" This reverts commit 5b2d9500343554f20b561bff57b42a45c27142d0. --- general.h | 2 - input/input_remapping.c | 11 ------ input/input_remapping.h | 2 - menu/menu_input.c | 85 +++++++++++------------------------------ retroarch.cfg | 10 ++--- settings.c | 6 --- settings_data.c | 12 ------ 7 files changed, 26 insertions(+), 102 deletions(-) diff --git a/general.h b/general.h index c09b258eea..cf6f77849a 100644 --- a/general.h +++ b/general.h @@ -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]; diff --git a/input/input_remapping.c b/input/input_remapping.c index 5bd3659765..3494527e1d 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -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; - } -} diff --git a/input/input_remapping.h b/input/input_remapping.h index a202cc0a03..7a1ab57278 100644 --- a/input/input_remapping.h +++ b/input/input_remapping.h @@ -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 diff --git a/menu/menu_input.c b/menu/menu_input.c index be35e23457..608ae5fe43 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -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; } diff --git a/retroarch.cfg b/retroarch.cfg index f56d8c89b8..d6aed9e2a2 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -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 diff --git a/settings.c b/settings.c index b961417611..ed4319c92b 100644 --- a/settings.c +++ b/settings.c @@ -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", diff --git a/settings_data.c b/settings_data.c index caca8bb3d5..6eee664d15 100644 --- a/settings_data.c +++ b/settings_data.c @@ -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",