diff --git a/input/input_common.c b/input/input_common.c index cf0401003c..a88e8d38ba 100644 --- a/input/input_common.c +++ b/input/input_common.c @@ -1625,22 +1625,16 @@ retro_input_t input_keys_pressed(unsigned key, * 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 @@ -1680,8 +1674,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 052f7da376..8f74f6f7a5 100644 --- a/input/input_common.h +++ b/input/input_common.h @@ -216,7 +216,7 @@ retro_input_t input_keys_pressed(unsigned key, unsigned key_end, const 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 29b6a15b5d..4e3d3c858c 100644 --- a/retroarch.c +++ b/retroarch.c @@ -3229,9 +3229,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) {