diff --git a/configuration.c b/configuration.c index 2e78b4f38d..0070bb054a 100644 --- a/configuration.c +++ b/configuration.c @@ -1165,7 +1165,7 @@ static void config_set_defaults(void) { for (j = 0; j < RARCH_BIND_LIST_END; j++) { - const struct retro_keybind *keyval = input_config_get_specific_bind(i, j); + const struct retro_keybind *keyval = &input_config_binds[i][j]; if (keyval->valid) retro_assert(j == keyval->id); } @@ -1645,7 +1645,7 @@ static void read_keybinds_user(config_file_t *conf, unsigned user) for (i = 0; input_config_bind_map_get_valid(i); i++) { - struct retro_keybind *bind = input_config_get_specific_bind_ptr(user, i); + struct retro_keybind *bind = &input_config_binds[user][i]; if (!bind->valid) continue; @@ -2797,7 +2797,7 @@ static void save_keybinds_user(config_file_t *conf, unsigned user) if (prefix) save_keybind(conf, prefix, input_config_bind_map_get_base(i), - input_config_get_specific_bind(user, i), true, true); + &input_config_binds[user][i], true, true); } } @@ -2925,7 +2925,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user) for (i = 0; i < RARCH_FIRST_META_KEY; i++) { save_keybind(conf, "input", input_config_bind_map_get_base(i), - input_config_get_specific_bind(user, i), false, false); + &input_config_binds[user][i], false, false); } ret = config_file_write(conf, autoconf_file); diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index fea01660e9..8bd1e8e1ea 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -1369,7 +1369,7 @@ static int16_t android_input_state(void *data, (android->pointer[idx].y != -0x8000); case RARCH_DEVICE_ID_POINTER_BACK: { - const struct retro_keybind *keyptr = input_autoconfigure_get_specific_bind(0, RARCH_MENU_TOGGLE); + const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE]; if (keyptr->joykey == 0) return android_keyboard_input_pressed(AKEYCODE_BACK); } @@ -1388,7 +1388,7 @@ static int16_t android_input_state(void *data, (android->pointer[idx].full_y != -0x8000); case RARCH_DEVICE_ID_POINTER_BACK: { - const struct retro_keybind *keyptr = input_autoconfigure_get_specific_bind(0, RARCH_MENU_TOGGLE); + const struct retro_keybind *keyptr = &input_autoconf_binds[0][RARCH_MENU_TOGGLE]; if (keyptr->joykey == 0) return android_keyboard_input_pressed(AKEYCODE_BACK); } diff --git a/input/input_config.c b/input/input_config.c index 05ee452435..66958e7a04 100644 --- a/input/input_config.c +++ b/input/input_config.c @@ -153,16 +153,6 @@ const struct input_bind_map input_config_bind_map[RARCH_BIND_LIST_END_NULL] = { #endif }; -struct retro_keybind *input_config_get_specific_bind_ptr(unsigned i, unsigned j) -{ - return (struct retro_keybind*)&input_config_binds[i][j]; -} - -const struct retro_keybind *input_config_get_specific_bind(unsigned i, unsigned j) -{ - return &input_config_binds[i][j]; -} - static const void *input_config_bind_map_get(unsigned i) { return (const struct input_bind_map*)&input_config_bind_map[i]; @@ -560,7 +550,7 @@ const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned i unsigned joy_idx = settings->input.joypad_map[port]; if (joy_idx < MAX_USERS) - return input_autoconfigure_get_specific_bind(joy_idx, id); + return &input_autoconf_binds[joy_idx][id]; return NULL; } @@ -603,8 +593,3 @@ void input_config_reset(void) input_config_pid[i] = 0; } } - -const struct retro_keybind *input_autoconfigure_get_specific_bind(unsigned i, unsigned j) -{ - return &input_autoconf_binds[i][j]; -} diff --git a/input/input_config.h b/input/input_config.h index 695a66fab2..600c077bde 100644 --- a/input/input_config.h +++ b/input/input_config.h @@ -92,13 +92,6 @@ void input_config_set_vid(unsigned port, unsigned vid); int32_t input_config_get_vid(unsigned port); -struct retro_keybind *input_config_get_specific_bind_ptr(unsigned i, unsigned j); - -const struct retro_keybind *input_config_get_specific_bind(unsigned i, unsigned j); - -const struct retro_keybind * -input_autoconfigure_get_specific_bind(unsigned i, unsigned j); - void input_config_reset(void); #endif diff --git a/input/input_remapping.c b/input/input_remapping.c index 49a0db9b77..2f24a6d717 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -175,7 +175,7 @@ void input_remapping_set_defaults(void) { for (j = 0; j < RARCH_FIRST_CUSTOM_BIND; j++) { - const struct retro_keybind *keybind = input_config_get_specific_bind(i, j); + const struct retro_keybind *keybind = &input_config_binds[i][j]; settings->input.remap_ids[i][j] = keybind->id; } for (j = 0; j < 4; j++) diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index dd4eefa99b..ad7cadac3f 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -453,7 +453,7 @@ static void menu_action_setting_disp_set_label_input_desc( remap_id = settings->input.remap_ids [inp_desc_user][inp_desc_button_index_offset]; - keybind = input_config_get_specific_bind(inp_desc_user, remap_id); + keybind = &input_config_binds[inp_desc_user][remap_id]; auto_bind = (const struct retro_keybind*) input_config_get_bind_auto(inp_desc_user, remap_id); @@ -469,8 +469,8 @@ static void menu_action_setting_disp_set_label_input_desc( len); else { - const struct retro_keybind *keyptr = input_config_get_specific_bind(inp_desc_user, - remap_id); + const struct retro_keybind *keyptr = &input_config_binds[inp_desc_user] + [remap_id]; strlcpy(s, msg_hash_to_str(keyptr->enum_idx), len); } diff --git a/menu/cbs/menu_cbs_scan.c b/menu/cbs/menu_cbs_scan.c index 51f9b1a801..e30fc37e92 100644 --- a/menu/cbs/menu_cbs_scan.c +++ b/menu/cbs/menu_cbs_scan.c @@ -137,8 +137,7 @@ static int action_scan_input_desc(const char *path, else key = input_config_translate_str_to_bind_id(label); - target = input_config_get_specific_bind_ptr(inp_desc_user, - key); + target = &input_config_binds[inp_desc_user][key]; if (target) { diff --git a/menu/cbs/menu_cbs_start.c b/menu/cbs/menu_cbs_start.c index 9d16959ce3..775995179a 100644 --- a/menu/cbs/menu_cbs_start.c +++ b/menu/cbs/menu_cbs_start.c @@ -111,8 +111,8 @@ static int action_start_input_desc(unsigned type, const char *label) if (inp_desc_button_index_offset < RARCH_FIRST_CUSTOM_BIND) { - const struct retro_keybind *keyptr = input_config_get_specific_bind(inp_desc_user, - inp_desc_button_index_offset); + const struct retro_keybind *keyptr = &input_config_binds[inp_desc_user] + [inp_desc_button_index_offset]; settings->input.remap_ids[inp_desc_user][inp_desc_button_index_offset] = keyptr->id; } else diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 1a6a883add..5b9f26aa5f 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1338,7 +1338,7 @@ static int setting_action_ok_bind_defaults(void *data, bool wraparound) if (!setting) return -1; - target = input_config_get_specific_bind_ptr(setting->index_offset, 0); + target = &input_config_binds[setting->index_offset][0]; def_binds = (setting->index_offset) ? retro_keybinds_rest : retro_keybinds_1; @@ -2090,7 +2090,7 @@ static bool setting_append_list_input_player_options( CONFIG_BIND_ALT( list, list_info, - input_config_get_specific_bind_ptr(user, i), + &input_config_binds[user][i], user + 1, user, strdup(name), @@ -4408,7 +4408,7 @@ static bool setting_append_list( CONFIG_BIND_ALT( list, list_info, - input_config_get_specific_bind_ptr(0, i), + &input_config_binds[0][i], 0, 0, strdup(input_config_bind_map_get_base(i)), strdup(input_config_bind_map_get_desc(i)), diff --git a/menu/widgets/menu_dialog.c b/menu/widgets/menu_dialog.c index 2d3fd6d453..2912e85eef 100644 --- a/menu/widgets/menu_dialog.c +++ b/menu/widgets/menu_dialog.c @@ -96,7 +96,7 @@ int menu_dialog_iterate(char *s, size_t len, const char *label) for (i = 0; i < ARRAY_SIZE(binds); i++) { - const struct retro_keybind *keybind = input_config_get_specific_bind(0, binds[i]); + const struct retro_keybind *keybind = &input_config_binds[0][binds[i]]; const struct retro_keybind *auto_bind = (const struct retro_keybind*) input_config_get_bind_auto(0, binds[i]); diff --git a/menu/widgets/menu_input_bind_dialog.c b/menu/widgets/menu_input_bind_dialog.c index 96a3196648..8589af22d9 100644 --- a/menu/widgets/menu_input_bind_dialog.c +++ b/menu/widgets/menu_input_bind_dialog.c @@ -116,7 +116,7 @@ static int menu_input_key_bind_set_mode_common( menu_displaylist_ctl(DISPLAYLIST_PROCESS, &info); break; case MENU_INPUT_BINDS_CTL_BIND_ALL: - menu_input_binds.target = input_config_get_specific_bind_ptr(index_offset, 0); + menu_input_binds.target = &input_config_binds[index_offset][0]; menu_input_binds.begin = MENU_SETTINGS_BIND_BEGIN; menu_input_binds.last = MENU_SETTINGS_BIND_LAST;