disable frame advance; delay pause spam in hardcore
This commit is contained in:
parent
2588f51ff2
commit
96fc17f43c
46
retroarch.c
46
retroarch.c
|
@ -39598,19 +39598,47 @@ static enum runloop_state runloop_check_state(
|
||||||
{
|
{
|
||||||
static bool old_frameadvance = false;
|
static bool old_frameadvance = false;
|
||||||
static bool old_pause_pressed = false;
|
static bool old_pause_pressed = false;
|
||||||
bool frameadvance_pressed = BIT256_GET(
|
bool pause_pressed, frameadvance_pressed, trig_frameadvance;
|
||||||
current_bits, RARCH_FRAMEADVANCE);
|
|
||||||
bool pause_pressed = BIT256_GET(
|
#ifdef HAVE_CHEEVOS
|
||||||
current_bits, RARCH_PAUSE_TOGGLE);
|
if (rcheevos_hardcore_active())
|
||||||
bool trig_frameadvance = frameadvance_pressed && !old_frameadvance;
|
{
|
||||||
|
static int unpaused_frames = 0;
|
||||||
|
|
||||||
|
/* frame advance is not allowed when achievement hardcore is active */
|
||||||
|
frameadvance_pressed = false;
|
||||||
|
trig_frameadvance = false;
|
||||||
|
|
||||||
|
pause_pressed = BIT256_GET(current_bits, RARCH_PAUSE_TOGGLE);
|
||||||
|
if (!p_rarch->runloop_paused)
|
||||||
|
{
|
||||||
|
/* limit pause to approximately three times per second (depending on core framerate) */
|
||||||
|
if (unpaused_frames < 20)
|
||||||
|
{
|
||||||
|
++unpaused_frames;
|
||||||
|
pause_pressed = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
unpaused_frames = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
pause_pressed = BIT256_GET(current_bits, RARCH_PAUSE_TOGGLE);
|
||||||
|
frameadvance_pressed = BIT256_GET(current_bits, RARCH_FRAMEADVANCE);
|
||||||
|
trig_frameadvance = frameadvance_pressed && !old_frameadvance;
|
||||||
|
|
||||||
|
/* FRAMEADVANCE will set us into pause mode. */
|
||||||
|
pause_pressed |= !p_rarch->runloop_paused
|
||||||
|
&& trig_frameadvance;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if libretro pause key was pressed. If so, pause or
|
/* Check if libretro pause key was pressed. If so, pause or
|
||||||
* unpause the libretro core. */
|
* unpause the libretro core. */
|
||||||
|
|
||||||
/* FRAMEADVANCE will set us into pause mode. */
|
|
||||||
pause_pressed |= !p_rarch->runloop_paused
|
|
||||||
&& trig_frameadvance;
|
|
||||||
|
|
||||||
if (focused && pause_pressed && !old_pause_pressed)
|
if (focused && pause_pressed && !old_pause_pressed)
|
||||||
command_event(CMD_EVENT_PAUSE_TOGGLE, NULL);
|
command_event(CMD_EVENT_PAUSE_TOGGLE, NULL);
|
||||||
else if (focused && !old_focus)
|
else if (focused && !old_focus)
|
||||||
|
|
Loading…
Reference in New Issue