mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-04 10:36:50 +00:00
runloop.c - Create input_flush function
This commit is contained in:
parent
1d7dea392d
commit
fa8e457cf2
27
runloop.c
27
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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user