From 8ac794d4afb0cc6be9d1d6bfa0dc0f67727669e5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 10 Aug 2019 19:59:33 +0200 Subject: [PATCH] Simplify fastforwarding code --- retroarch.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/retroarch.c b/retroarch.c index d671b3da82..d1758e8b07 100644 --- a/retroarch.c +++ b/retroarch.c @@ -23632,10 +23632,17 @@ static enum runloop_state runloop_check_state( current_bits, RARCH_FAST_FORWARD_KEY); bool new_hold_button_state = BIT256_GET( 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; runloop_fastmotion = false; @@ -23649,22 +23656,6 @@ static enum runloop_state runloop_check_state( driver_set_nonblock_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_hold_button_state = new_hold_button_state;