diff --git a/input/input_common.c b/input/input_common.c index a88adb4928..ebfe5c1097 100644 --- a/input/input_common.c +++ b/input/input_common.c @@ -1604,22 +1604,16 @@ void input_pop_analog_dpad(struct retro_keybind *binds) * from the specified key up until the last queryable key * (key_end). * - * Because this function keeps a copy of the old input state, - * it should only be called once per frame (currently in - * rarch_main_iterate); - * * TODO: In case RARCH_BIND_LIST_END starts exceeding 64, * and you need a bitmask of more than 64 entries, don't * use this function. */ retro_input_t meta_input_keys_pressed(unsigned key, - unsigned key_end, retro_input_t *old_state) + unsigned key_end) { - static retro_input_t old_ret = 0; static const struct retro_keybind *binds[] = { g_settings.input.binds[0] }; retro_input_t ret = 0; - *old_state = old_ret; int i; #ifdef RARCH_INTERNAL @@ -1661,8 +1655,6 @@ retro_input_t meta_input_keys_pressed(unsigned key, for (i = 0; i < MAX_PLAYERS; i++) input_pop_analog_dpad(g_settings.input.autoconf_binds[i]); - old_ret = ret; - return ret; } #endif diff --git a/input/input_common.h b/input/input_common.h index 3a8932d015..d3e7b84511 100644 --- a/input/input_common.h +++ b/input/input_common.h @@ -213,7 +213,7 @@ void input_push_analog_dpad(struct retro_keybind *binds, unsigned mode); void input_pop_analog_dpad(struct retro_keybind *binds); retro_input_t meta_input_keys_pressed(unsigned key, - unsigned key_end, retro_input_t *old_state); + unsigned key_end); #ifdef __cplusplus } diff --git a/retroarch.c b/retroarch.c index 18dc81bb92..b45aa3705a 100644 --- a/retroarch.c +++ b/retroarch.c @@ -3243,9 +3243,13 @@ static bool do_menu_oneshot( bool rarch_main_iterate(void) { unsigned i; + static retro_input_t last_input = 0; retro_input_t old_input, trigger_input; retro_input_t input = meta_input_keys_pressed(0, - RARCH_BIND_LIST_END, &old_input); + RARCH_BIND_LIST_END); + + old_input = last_input; + last_input = input; if (driver.flushing_input) {