From d279b158c93cdd110e23c5a6dc1d06f4c6da2ce5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 6 Aug 2015 03:09:42 +0200 Subject: [PATCH] Bring back input_flush --- runloop.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/runloop.c b/runloop.c index 516b778dc6..8d8403fc00 100644 --- a/runloop.c +++ b/runloop.c @@ -983,6 +983,18 @@ static void rarch_main_cmd_get_state(driver_t *driver, RARCH_CHEAT_TOGGLE); } +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 (main_is_paused) + BIT64_SET(*input, RARCH_PAUSE_TOGGLE); + + return true; +} + /** * rarch_main_iterate: * @@ -1008,15 +1020,7 @@ int rarch_main_iterate(void) last_input = input; if (driver->flushing_input) - { - input = 0; - /* If core was paused before entering menu, evoke - * pause toggle to wake it up. */ - if (main_is_paused) - BIT64_SET(input, RARCH_PAUSE_TOGGLE); - - driver->flushing_input = false; - } + driver->flushing_input = (input) ? input_flush(&input) : false; trigger_input = input & ~old_input;