mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
(RMenu) Make current_menu variable static to prevent crashes
on Xbox 1
This commit is contained in:
parent
f9fcb55835
commit
3405c7f08c
@ -42,7 +42,7 @@
|
|||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
|
|
||||||
|
|
||||||
rmenu_state_t rmenu_state;
|
static rmenu_state_t rmenu_state;
|
||||||
|
|
||||||
static bool set_libretro_core_as_launch;
|
static bool set_libretro_core_as_launch;
|
||||||
|
|
||||||
@ -2373,7 +2373,6 @@ INPUT POLL CALLBACK
|
|||||||
void rmenu_input_poll(void *data, void *state)
|
void rmenu_input_poll(void *data, void *state)
|
||||||
{
|
{
|
||||||
menu *current_menu = (menu*)data;
|
menu *current_menu = (menu*)data;
|
||||||
rmenu_state_t *rstate = (rmenu_state_t*)state;
|
|
||||||
|
|
||||||
//first button input frame
|
//first button input frame
|
||||||
uint64_t input_state_first_frame = 0;
|
uint64_t input_state_first_frame = 0;
|
||||||
@ -2387,7 +2386,7 @@ void rmenu_input_poll(void *data, void *state)
|
|||||||
RETRO_DEVICE_JOYPAD, 0, i) ? (1ULL << i) : 0;
|
RETRO_DEVICE_JOYPAD, 0, i) ? (1ULL << i) : 0;
|
||||||
|
|
||||||
//set first button input frame as trigger
|
//set first button input frame as trigger
|
||||||
rstate->input = input_state & ~(rstate->old_state);
|
rmenu_state.input = input_state & ~(rmenu_state.old_state);
|
||||||
//hold onto first button input frame
|
//hold onto first button input frame
|
||||||
input_state_first_frame = input_state;
|
input_state_first_frame = input_state;
|
||||||
|
|
||||||
@ -2416,11 +2415,11 @@ void rmenu_input_poll(void *data, void *state)
|
|||||||
if(!(g_extern.frame_count < g_extern.delay_timer[1]))
|
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
|
rmenu_state.input = input_state; //second input frame set as current frame
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rstate->old_state = input_state_first_frame;
|
rmenu_state.old_state = input_state_first_frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
@ -2523,7 +2522,7 @@ bool rmenu_iterate(void)
|
|||||||
const char *msg;
|
const char *msg;
|
||||||
|
|
||||||
DEVICE_CAST device_ptr = (DEVICE_CAST)driver.video_data;
|
DEVICE_CAST device_ptr = (DEVICE_CAST)driver.video_data;
|
||||||
menu current_menu;
|
static menu current_menu;
|
||||||
|
|
||||||
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_PREINIT))
|
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_PREINIT))
|
||||||
{
|
{
|
||||||
@ -2550,7 +2549,7 @@ bool rmenu_iterate(void)
|
|||||||
rarch_render_cached_frame();
|
rarch_render_cached_frame();
|
||||||
|
|
||||||
if(current_menu.input_poll)
|
if(current_menu.input_poll)
|
||||||
current_menu.input_poll(¤t_menu, &rmenu_state);
|
rmenu_input_poll(¤t_menu, &rmenu_state);
|
||||||
|
|
||||||
#ifdef HAVE_OSKUTIL
|
#ifdef HAVE_OSKUTIL
|
||||||
if(rmenu_state.osk_init != NULL)
|
if(rmenu_state.osk_init != NULL)
|
||||||
|
@ -115,7 +115,7 @@ static void xdk_input_poll(void *data)
|
|||||||
if(bInserted[i])
|
if(bInserted[i])
|
||||||
{
|
{
|
||||||
XINPUT_POLLING_PARAMETERS m_pollingParameters;
|
XINPUT_POLLING_PARAMETERS m_pollingParameters;
|
||||||
m_pollingParameters.fAutoPoll = TRUE;
|
m_pollingParameters.fAutoPoll = FALSE;
|
||||||
m_pollingParameters.fInterruptOut = TRUE;
|
m_pollingParameters.fInterruptOut = TRUE;
|
||||||
m_pollingParameters.bInputInterval = 8;
|
m_pollingParameters.bInputInterval = 8;
|
||||||
m_pollingParameters.bOutputInterval = 8;
|
m_pollingParameters.bOutputInterval = 8;
|
||||||
@ -129,6 +129,9 @@ static void xdk_input_poll(void *data)
|
|||||||
// XInputOpen, the device handle will be NULL
|
// XInputOpen, the device handle will be NULL
|
||||||
XINPUT_STATE state_tmp;
|
XINPUT_STATE state_tmp;
|
||||||
|
|
||||||
|
if (XInputPoll(gamepads[i]) != ERROR_SUCCESS)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(XInputGetState(gamepads[i], &state_tmp) != ERROR_SUCCESS)
|
if(XInputGetState(gamepads[i], &state_tmp) != ERROR_SUCCESS)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user