diff --git a/frontend/menu/rgui.c b/frontend/menu/rgui.c index 9afe164a9d..23eb2a0102 100644 --- a/frontend/menu/rgui.c +++ b/frontend/menu/rgui.c @@ -1631,16 +1631,16 @@ static int menu_input_process(void *data, void *state) return -1; } - if (!(g_extern.frame_count < g_extern.delay_timer[0])) + static bool old_rmenu_toggle = true; + bool rmenu_toggle = ((trigger_state & (1ULL << GX_DEVICE_NAV_MENU)) && g_extern.main_is_init); + if (rmenu_toggle && !old_rmenu_toggle) { - bool return_to_game_enable = ((trigger_state & (1ULL << GX_DEVICE_NAV_MENU)) && g_extern.main_is_init); - - if (return_to_game_enable) - { - g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); - return -1; - } + g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); + old_rmenu_toggle = true; + return -1; } + else + old_rmenu_toggle = rmenu_toggle; return 0; } @@ -1788,11 +1788,6 @@ bool menu_iterate(void) return true; deinit: - // set a timer delay so that we don't instantly switch back to the menu when - // press and holding QUIT in the emulation loop (lasts for 30 frame ticks) - if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE))) - g_extern.delay_timer[0] = g_extern.frame_count + 30; - g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME); diff --git a/frontend/menu/rmenu.c b/frontend/menu/rmenu.c index e2430e22bd..20d439bc1e 100644 --- a/frontend/menu/rmenu.c +++ b/frontend/menu/rmenu.c @@ -2709,19 +2709,18 @@ int menu_input_process(void *data, void *state) return -1; } - if (!(g_extern.frame_count < g_extern.delay_timer[0])) + static bool old_rmenu_toggle = true; + bool rmenu_toggle = (((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) + && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) + && g_extern.main_is_init)); + if (rmenu_toggle && !old_rmenu_toggle) { - bool return_to_game_enable = (((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.main_is_init)); - - if (return_to_game_enable) - { - if (!(g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_INGAME))) - { - g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); - return -1; - } - } + g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); + old_rmenu_toggle = true; + return -1; } + else + old_rmenu_toggle = rmenu_toggle; bool quit, resize; unsigned width, height, frame_count; @@ -2889,11 +2888,6 @@ bool menu_iterate(void) return true; deinit: - // set a timer delay so that we don't instantly switch back to the menu when - // press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks) - if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE))) - g_extern.delay_timer[0] = g_extern.frame_count + 30; - g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW); #ifndef __CELLOS_LV2__ diff --git a/frontend/menu/rmenu_xui.cpp b/frontend/menu/rmenu_xui.cpp index 249d1d7c2a..d0f4806e4f 100644 --- a/frontend/menu/rmenu_xui.cpp +++ b/frontend/menu/rmenu_xui.cpp @@ -1499,19 +1499,19 @@ bool menu_iterate(void) process_input_ret = -1; } + static bool old_rmenu_toggle = true; + bool rmenu_toggle = ((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) + && (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) + && (g_extern.main_is_init)); - if (!(g_extern.frame_count < g_extern.delay_timer[0])) + if (rmenu_toggle && !old_rmenu_toggle) { - bool rmenu_enable = ((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB) - && (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.main_is_init)); - - if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU)) - if (rmenu_enable) - { - g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); - process_input_ret = -1; - } + g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); + old_rmenu_toggle = true; + process_input_ret = -1; } + else + old_rmenu_toggle = rmenu_toggle; rarch_render_cached_frame(); @@ -1543,11 +1543,6 @@ bool menu_iterate(void) return true; deinit: - // set a timer delay so that we don't instantly switch back to the menu when - // press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks) - if(!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE))) - g_extern.delay_timer[0] = g_extern.frame_count + 30; - g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW); diff --git a/gx/gx_input.c b/gx/gx_input.c index 4cbadde846..fc57ddb9f1 100644 --- a/gx/gx_input.c +++ b/gx/gx_input.c @@ -518,18 +518,15 @@ static void gx_input_poll(void *data) g_quit = false; } - if (!(g_extern.frame_count < g_extern.delay_timer[0])) - { - if (*state_p1 & GX_QUIT_KEY) - *lifecycle_state |= (1ULL << RARCH_QUIT_KEY); + if (*state_p1 & GX_QUIT_KEY) + *lifecycle_state |= (1ULL << RARCH_QUIT_KEY); - if (*state_p1 & (GX_WIIMOTE_HOME + if (*state_p1 & (GX_WIIMOTE_HOME #ifdef HW_RVL - | GX_CLASSIC_HOME + | GX_CLASSIC_HOME #endif - )) - *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); - } + )) + *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); } static bool gx_input_key_pressed(void *data, int key) diff --git a/ps3/ps3_input.c b/ps3/ps3_input.c index 43f8638f75..0e40dfe985 100644 --- a/ps3/ps3_input.c +++ b/ps3/ps3_input.c @@ -207,15 +207,12 @@ static void ps3_input_poll(void *data) if ((*state_p1 & (1ULL << RARCH_ANALOG_RIGHT_Y_DPAD_UP)) && !(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R2))) *lifecycle_state |= (1ULL << RARCH_REWIND); - if (!(g_extern.frame_count < g_extern.delay_timer[0])) + if ((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) + *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); + if (!(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) { - if ((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) - *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); - if (!(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) - { - *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); - *lifecycle_state |= (1ULL << RARCH_MENU_QUICKMENU_TOGGLE); - } + *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); + *lifecycle_state |= (1ULL << RARCH_MENU_QUICKMENU_TOGGLE); } cellPadGetInfo2(&pad_info); diff --git a/retroarch.c b/retroarch.c index efb4779c60..5884395575 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2858,7 +2858,6 @@ static inline bool check_enter_rgui(void) g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME); g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU); - g_extern.delay_timer[0] = g_extern.frame_count + 30; // FIXME: Purge. Should do something similar in RGUI as well. old_rmenu_toggle = true; return true; } diff --git a/xdk/xdk_xinput_input.c b/xdk/xdk_xinput_input.c index 9792e75a19..fd3ee5ed1a 100644 --- a/xdk/xdk_xinput_input.c +++ b/xdk/xdk_xinput_input.c @@ -228,15 +228,12 @@ static void xdk_input_poll(void *data) if ((*state_p1 & (1ULL << RARCH_ANALOG_RIGHT_Y_DPAD_UP)) && !(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R2))) *lifecycle_state |= (1ULL << RARCH_REWIND); - if (!(g_extern.frame_count < g_extern.delay_timer[0])) + if((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) + *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); + if(!(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) { - if((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) - *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); - if(!(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) - { - *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); - *lifecycle_state |= (1ULL << RARCH_MENU_QUICKMENU_TOGGLE); - } + *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); + *lifecycle_state |= (1ULL << RARCH_MENU_QUICKMENU_TOGGLE); } }