From d169d51180721a1fc5b72264ae08c4b5b064b77e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 17 Dec 2017 17:21:51 +0100 Subject: [PATCH] Revert "Rewrite menu toggle" This reverts commit 144ca2cfd8eb4234acc74630e1aab2e709f11abb. --- retroarch.c | 67 ++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/retroarch.c b/retroarch.c index b3f7db1091..a0750560ac 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2356,44 +2356,6 @@ static bool input_driver_toggle_button_combo( } #endif -#ifdef HAVE_MENU -static void runloop_check_state_menu_toggle( - bool pressed, bool old_pressed) -{ - bool menu_toggle_kb_is_set = menu_event_kb_is_set(RETROK_F1); - bool menu_is_alive = menu_driver_is_alive(); - - if (menu_toggle_kb_is_set == 1) - { - if (menu_is_alive) - goto finished; - } - else if ( - (!menu_toggle_kb_is_set && - (pressed && !old_pressed)) || - (current_core_type == CORE_TYPE_DUMMY) - ) - { - if (menu_is_alive) - goto finished; - - menu_display_toggle_set_reason(MENU_TOGGLE_REASON_USER); - rarch_menu_running(); - } - else - menu_event_kb_set(false, RETROK_F1); - - return; - -finished: - if (rarch_is_inited && (current_core_type != CORE_TYPE_DUMMY)) - { - rarch_menu_running_finished(); - menu_event_kb_set(false, RETROK_F1); - } -} -#endif - static enum runloop_state runloop_check_state( settings_t *settings, bool input_nonblock_state, @@ -2632,7 +2594,34 @@ static enum runloop_state runloop_check_state( bool pressed = BIT256_GET( current_input, RARCH_MENU_TOGGLE); - runloop_check_state_menu_toggle(pressed, old_pressed); + if (menu_event_kb_is_set(RETROK_F1) == 1) + { + if (menu_driver_is_alive()) + { + if (rarch_is_inited && (current_core_type != CORE_TYPE_DUMMY)) + { + rarch_menu_running_finished(); + menu_event_kb_set(false, RETROK_F1); + } + } + } + else if ((!menu_event_kb_is_set(RETROK_F1) && + (pressed && !old_pressed)) || + (current_core_type == CORE_TYPE_DUMMY)) + { + if (menu_driver_is_alive()) + { + if (rarch_is_inited && (current_core_type != CORE_TYPE_DUMMY)) + rarch_menu_running_finished(); + } + else + { + menu_display_toggle_set_reason(MENU_TOGGLE_REASON_USER); + rarch_menu_running(); + } + } + else + menu_event_kb_set(false, RETROK_F1); old_pressed = pressed; }