mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-19 00:47:36 +00:00
Simplify fastforwarding code
This commit is contained in:
parent
9b4fe343f3
commit
8ac794d4af
27
retroarch.c
27
retroarch.c
@ -23632,10 +23632,17 @@ static enum runloop_state runloop_check_state(
|
|||||||
current_bits, RARCH_FAST_FORWARD_KEY);
|
current_bits, RARCH_FAST_FORWARD_KEY);
|
||||||
bool new_hold_button_state = BIT256_GET(
|
bool new_hold_button_state = BIT256_GET(
|
||||||
current_bits, RARCH_FAST_FORWARD_HOLD_KEY);
|
current_bits, RARCH_FAST_FORWARD_HOLD_KEY);
|
||||||
|
bool check1 = !new_hold_button_state;
|
||||||
|
bool check2 = new_button_state && !old_button_state;
|
||||||
|
|
||||||
if (new_button_state && !old_button_state)
|
if (check2)
|
||||||
|
check1 = input_nonblock_state;
|
||||||
|
else
|
||||||
|
check2 = old_hold_button_state != new_hold_button_state;
|
||||||
|
|
||||||
|
if (check2)
|
||||||
{
|
{
|
||||||
if (input_nonblock_state)
|
if (check1)
|
||||||
{
|
{
|
||||||
input_driver_nonblock_state = false;
|
input_driver_nonblock_state = false;
|
||||||
runloop_fastmotion = false;
|
runloop_fastmotion = false;
|
||||||
@ -23649,22 +23656,6 @@ static enum runloop_state runloop_check_state(
|
|||||||
driver_set_nonblock_state();
|
driver_set_nonblock_state();
|
||||||
update_fastforwarding_state();
|
update_fastforwarding_state();
|
||||||
}
|
}
|
||||||
else if (old_hold_button_state != new_hold_button_state)
|
|
||||||
{
|
|
||||||
if (new_hold_button_state)
|
|
||||||
{
|
|
||||||
input_driver_nonblock_state = true;
|
|
||||||
runloop_fastmotion = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
input_driver_nonblock_state = false;
|
|
||||||
runloop_fastmotion = false;
|
|
||||||
fastforward_after_frames = 1;
|
|
||||||
}
|
|
||||||
driver_set_nonblock_state();
|
|
||||||
update_fastforwarding_state();
|
|
||||||
}
|
|
||||||
|
|
||||||
old_button_state = new_button_state;
|
old_button_state = new_button_state;
|
||||||
old_hold_button_state = new_hold_button_state;
|
old_hold_button_state = new_hold_button_state;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user