mirror of
https://github.com/libretro/RetroArch
synced 2025-03-26 11:37:30 +00:00
(Consoles) re-add second timer for scroll delays
This commit is contained in:
parent
1dc08b9a6d
commit
f33ed73671
@ -1179,7 +1179,7 @@ bool rmenu_iterate(void)
|
|||||||
XInputGetState(0, &state);
|
XInputGetState(0, &state);
|
||||||
|
|
||||||
|
|
||||||
if (!(g_extern.frame_count < g_extern.delay_timer))
|
if (!(g_extern.frame_count < g_extern.delay_timer[0]))
|
||||||
{
|
{
|
||||||
bool rmenu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
|
bool rmenu_enable = !((state.Gamepad.wButtons & XINPUT_GAMEPAD_LEFT_THUMB)
|
||||||
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.main_is_init));
|
&& (state.Gamepad.wButtons & XINPUT_GAMEPAD_RIGHT_THUMB) && (g_extern.main_is_init));
|
||||||
@ -1229,7 +1229,7 @@ deinit:
|
|||||||
// set a timer delay so that we don't instantly switch back to the menu when
|
// 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)
|
// press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks)
|
||||||
if(!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
if(!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
||||||
g_extern.delay_timer = g_extern.frame_count + 30;
|
g_extern.delay_timer[0] = g_extern.frame_count + 30;
|
||||||
|
|
||||||
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
||||||
g_extern.draw_menu = false;
|
g_extern.draw_menu = false;
|
||||||
|
@ -2322,10 +2322,10 @@ void rmenu_input_poll(void *data, void *state)
|
|||||||
if(!first_held)
|
if(!first_held)
|
||||||
{
|
{
|
||||||
first_held = true;
|
first_held = true;
|
||||||
g_extern.delay_timer = g_extern.frame_count + 7;
|
g_extern.delay_timer[1] = g_extern.frame_count + 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(g_extern.frame_count < g_extern.delay_timer))
|
if(!(g_extern.frame_count < g_extern.delay_timer[1]))
|
||||||
{
|
{
|
||||||
first_held = false;
|
first_held = false;
|
||||||
rstate->input = input_state; //second input frame set as current frame
|
rstate->input = input_state; //second input frame set as current frame
|
||||||
@ -2344,7 +2344,7 @@ void rmenu_input_process(void *data, void *state)
|
|||||||
(void)data;
|
(void)data;
|
||||||
rmenu_state_t *rstate = (rmenu_state_t*)state;
|
rmenu_state_t *rstate = (rmenu_state_t*)state;
|
||||||
|
|
||||||
if (!(g_extern.frame_count < g_extern.delay_timer))
|
if (!(g_extern.frame_count < g_extern.delay_timer[0]))
|
||||||
{
|
{
|
||||||
bool rmenu_enable = (((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.main_is_init));
|
bool rmenu_enable = (((rstate->old_state & (1ULL << RMENU_DEVICE_NAV_L3)) && (rstate->old_state & (1ULL << RMENU_DEVICE_NAV_R3)) && g_extern.main_is_init));
|
||||||
|
|
||||||
@ -2506,7 +2506,7 @@ deinit:
|
|||||||
// set a timer delay so that we don't instantly switch back to the menu when
|
// 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)
|
// press and holding L3 + R3 in the emulation loop (lasts for 30 frame ticks)
|
||||||
if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
||||||
g_extern.delay_timer = g_extern.frame_count + 30;
|
g_extern.delay_timer[0] = g_extern.frame_count + 30;
|
||||||
|
|
||||||
if(g_extern.console.rmenu.state.ingame_menu.enable)
|
if(g_extern.console.rmenu.state.ingame_menu.enable)
|
||||||
menu_stack_pop();
|
menu_stack_pop();
|
||||||
|
@ -297,10 +297,10 @@ static bool rmenu_iterate(void)
|
|||||||
if(!first_held)
|
if(!first_held)
|
||||||
{
|
{
|
||||||
first_held = true;
|
first_held = true;
|
||||||
g_extern.delay_timer = g_extern.frame_count + (initial_held ? 15 : 7);
|
g_extern.delay_timer[1] = g_extern.frame_count + (initial_held ? 15 : 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(g_extern.frame_count < g_extern.delay_timer))
|
if (!(g_extern.frame_count < g_extern.delay_timer[1]))
|
||||||
{
|
{
|
||||||
first_held = false;
|
first_held = false;
|
||||||
trigger_state = input_state; //second input frame set as current frame
|
trigger_state = input_state; //second input frame set as current frame
|
||||||
@ -340,7 +340,7 @@ static bool rmenu_iterate(void)
|
|||||||
|
|
||||||
old_input_state = input_state;
|
old_input_state = input_state;
|
||||||
|
|
||||||
if (!(g_extern.frame_count < g_extern.delay_timer))
|
if (!(g_extern.frame_count < g_extern.delay_timer[0]))
|
||||||
{
|
{
|
||||||
bool rmenu_enable = ((trigger_state & (1ULL << GX_DEVICE_NAV_MENU)) && g_extern.main_is_init);
|
bool rmenu_enable = ((trigger_state & (1ULL << GX_DEVICE_NAV_MENU)) && g_extern.main_is_init);
|
||||||
bool quit_key_pressed = (trigger_state & (1ULL << GX_DEVICE_NAV_QUIT));
|
bool quit_key_pressed = (trigger_state & (1ULL << GX_DEVICE_NAV_QUIT));
|
||||||
@ -366,7 +366,7 @@ deinit:
|
|||||||
// set a timer delay so that we don't instantly switch back to the menu when
|
// 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)
|
// press and holding QUIT in the emulation loop (lasts for 30 frame ticks)
|
||||||
if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
if (!(g_extern.lifecycle_state & (1ULL << RARCH_FRAMEADVANCE)))
|
||||||
g_extern.delay_timer = g_extern.frame_count + 30;
|
g_extern.delay_timer[0] = g_extern.frame_count + 30;
|
||||||
|
|
||||||
g_extern.draw_menu = false;
|
g_extern.draw_menu = false;
|
||||||
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
g_extern.console.rmenu.state.ingame_menu.enable = false;
|
||||||
|
@ -454,7 +454,8 @@ struct global
|
|||||||
} frame_cache;
|
} frame_cache;
|
||||||
|
|
||||||
unsigned frame_count;
|
unsigned frame_count;
|
||||||
unsigned delay_timer;
|
// two timers, the first for handling menu and exit button delays, the second for scrolling delays
|
||||||
|
unsigned delay_timer[2];
|
||||||
char title_buf[64];
|
char title_buf[64];
|
||||||
|
|
||||||
struct
|
struct
|
||||||
|
@ -449,7 +449,7 @@ static void gx_input_poll(void *data)
|
|||||||
g_quit = false;
|
g_quit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(g_extern.frame_count < g_extern.delay_timer))
|
if (!(g_extern.frame_count < g_extern.delay_timer[0]))
|
||||||
{
|
{
|
||||||
if (*pad_p1 & GX_QUIT_KEY)
|
if (*pad_p1 & GX_QUIT_KEY)
|
||||||
*lifecycle_state |= (1ULL << RARCH_QUIT_KEY);
|
*lifecycle_state |= (1ULL << RARCH_QUIT_KEY);
|
||||||
|
@ -207,7 +207,7 @@ 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 (!(g_extern.frame_count < g_extern.delay_timer))
|
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)))
|
if((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3)))
|
||||||
{
|
{
|
||||||
|
@ -2789,7 +2789,7 @@ bool rarch_main_iterate(void)
|
|||||||
if (rmenu_enable || (g_extern.console.rmenu.state.ingame_menu.enable && !rmenu_enable))
|
if (rmenu_enable || (g_extern.console.rmenu.state.ingame_menu.enable && !rmenu_enable))
|
||||||
{
|
{
|
||||||
g_extern.console.rmenu.mode = MODE_MENU;
|
g_extern.console.rmenu.mode = MODE_MENU;
|
||||||
g_extern.delay_timer = g_extern.frame_count + 30;
|
g_extern.delay_timer[0] = g_extern.frame_count + 30;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
@ -223,7 +223,7 @@ 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 (!(g_extern.frame_count < g_extern.delay_timer))
|
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)))
|
if((*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_L3)) && (*state_p1 & (1ULL << RETRO_DEVICE_ID_JOYPAD_R3)))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user