runloop.c - Create input_flush function

This commit is contained in:
twinaphex 2014-10-05 16:22:15 +02:00
parent 1d7dea392d
commit fa8e457cf2

View File

@ -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;