diff --git a/runloop.c b/runloop.c index b63cfbc592..c90542efa1 100644 --- a/runloop.c +++ b/runloop.c @@ -670,6 +670,18 @@ static inline retro_input_t input_keys_pressed(void) return ret; } +static bool input_flush(retro_input_t *input) +{ + *input = 0; + + /* If core was paused before entering menu, evoke + * pause toggle to wake it up. */ + if (g_extern.is_paused) + BIT64_SET(*input, RARCH_PAUSE_TOGGLE); + + return true; +} + /* * RetroArch's main iteration loop. * @@ -691,20 +703,7 @@ int rarch_main_iterate(void) last_input = input; if (driver.flushing_input) - { - if (input) - { - input = 0; - /* If core was paused before - * entering menu, evoke - * pause toggle to wake it up. - */ - if (g_extern.is_paused) - input |= (1ULL << RARCH_PAUSE_TOGGLE); - } - else - driver.flushing_input = false; - } + driver.flushing_input = (input) ? input_flush(&input) : false; trigger_input = input & ~old_input;