Revert "Menu toggle without delay timers (more testing might be needed -"

This reverts commit 54a6175a555925d8a3530756b1fa6c9a7b14adc2.
This commit is contained in:
twinaphex 2013-03-11 02:07:50 +01:00
parent edf600e0c7
commit 039fc644d5
7 changed files with 70 additions and 44 deletions

View File

@ -1631,16 +1631,16 @@ static int menu_input_process(void *data, void *state)
return -1; return -1;
} }
static bool old_rmenu_toggle = true; if (!(g_extern.frame_count < g_extern.delay_timer[0]))
bool rmenu_toggle = ((trigger_state & (1ULL << GX_DEVICE_NAV_MENU)) && g_extern.main_is_init);
if (rmenu_toggle && !old_rmenu_toggle)
{ {
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); bool return_to_game_enable = ((trigger_state & (1ULL << GX_DEVICE_NAV_MENU)) && g_extern.main_is_init);
old_rmenu_toggle = true;
return -1; if (return_to_game_enable)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
return -1;
}
} }
else
old_rmenu_toggle = rmenu_toggle;
return 0; return 0;
} }
@ -1788,6 +1788,11 @@ bool menu_iterate(void)
return true; return true;
deinit: 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_DRAW);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_INGAME);

View File

@ -2709,18 +2709,19 @@ int menu_input_process(void *data, void *state)
return -1; return -1;
} }
static bool old_rmenu_toggle = true; if (!(g_extern.frame_count < g_extern.delay_timer[0]))
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)
{ {
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); 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));
old_rmenu_toggle = true;
return -1; 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;
}
}
} }
else
old_rmenu_toggle = rmenu_toggle;
bool quit, resize; bool quit, resize;
unsigned width, height, frame_count; unsigned width, height, frame_count;
@ -2888,6 +2889,11 @@ bool menu_iterate(void)
return true; return true;
deinit: 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); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW);
#ifndef __CELLOS_LV2__ #ifndef __CELLOS_LV2__

View File

@ -1499,19 +1499,19 @@ bool menu_iterate(void)
process_input_ret = -1; 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 (rmenu_toggle && !old_rmenu_toggle) if (!(g_extern.frame_count < g_extern.delay_timer[0]))
{ {
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME); bool rmenu_enable = ((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
old_rmenu_toggle = true; && (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.main_is_init));
process_input_ret = -1;
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
if (rmenu_enable)
{
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
process_input_ret = -1;
}
} }
else
old_rmenu_toggle = rmenu_toggle;
rarch_render_cached_frame(); rarch_render_cached_frame();
@ -1543,6 +1543,11 @@ bool menu_iterate(void)
return true; return true;
deinit: 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_INGAME);
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW); g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU_DRAW);

View File

@ -518,15 +518,18 @@ static void gx_input_poll(void *data)
g_quit = false; g_quit = false;
} }
if (*state_p1 & GX_QUIT_KEY) if (!(g_extern.frame_count < g_extern.delay_timer[0]))
*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 #ifdef HW_RVL
| GX_CLASSIC_HOME | GX_CLASSIC_HOME
#endif #endif
)) ))
*lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE); *lifecycle_state |= (1ULL << RARCH_MENU_TOGGLE);
}
} }
static bool gx_input_key_pressed(void *data, int key) static bool gx_input_key_pressed(void *data, int key)

View File

@ -207,12 +207,15 @@ 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))) if ((*state_p1 & (1ULL << RARCH_ANALOG_RIGHT_Y_DPAD_UP)) && !(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R2)))
*lifecycle_state |= (1ULL << RARCH_REWIND); *lifecycle_state |= (1ULL << RARCH_REWIND);
if ((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) if (!(g_extern.frame_count < g_extern.delay_timer[0]))
*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); if ((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3)))
*lifecycle_state |= (1ULL << RARCH_MENU_QUICKMENU_TOGGLE); *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);
}
} }
cellPadGetInfo2(&pad_info); cellPadGetInfo2(&pad_info);

View File

@ -2858,6 +2858,7 @@ static inline bool check_enter_rgui(void)
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME); g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_INGAME);
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU); 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; old_rmenu_toggle = true;
return true; return true;
} }

View File

@ -228,12 +228,15 @@ 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))) if ((*state_p1 & (1ULL << RARCH_ANALOG_RIGHT_Y_DPAD_UP)) && !(*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R2)))
*lifecycle_state |= (1ULL << RARCH_REWIND); *lifecycle_state |= (1ULL << RARCH_REWIND);
if((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3))) if (!(g_extern.frame_count < g_extern.delay_timer[0]))
*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); if((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3)))
*lifecycle_state |= (1ULL << RARCH_MENU_QUICKMENU_TOGGLE); *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);
}
} }
} }