mirror of
https://github.com/dborth/vbagx.git
synced 2024-12-26 10:41:50 +01:00
fix exiting to game from re-entering menu
This commit is contained in:
parent
e6e6774757
commit
0998b084ea
@ -913,15 +913,27 @@ static u32 DecodeJoy(unsigned short pad)
|
||||
return J;
|
||||
}
|
||||
|
||||
bool MenuRequested()
|
||||
{
|
||||
for(int i=0; i<4; i++)
|
||||
{
|
||||
if (
|
||||
(userInput[pad].pad.substickX < -70) ||
|
||||
(userInput[pad].wpad.btns_h & WPAD_BUTTON_HOME) ||
|
||||
(userInput[pad].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) ||
|
||||
(DownUsbKeys[KB_ESC])
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
u32 GetJoy(int pad)
|
||||
{
|
||||
// request to go back to menu
|
||||
if (
|
||||
(userInput[pad].pad.substickX < -70) ||
|
||||
(userInput[pad].wpad.btns_h & WPAD_BUTTON_HOME) ||
|
||||
(userInput[pad].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) ||
|
||||
(DownUsbKeys[KB_ESC])
|
||||
)
|
||||
if (MenuRequested())
|
||||
{
|
||||
ScreenshotRequested = 1;
|
||||
updateRumbleFrame();
|
||||
|
@ -42,5 +42,6 @@ void systemGameRumbleOnlyFor(int OnlyRumbleForFrames);
|
||||
void updateRumbleFrame();
|
||||
s8 WPAD_Stick(u8 chan,u8 right, int axis);
|
||||
u32 GetJoy(int which);
|
||||
bool MenuRequested();
|
||||
|
||||
#endif
|
||||
|
@ -3544,6 +3544,10 @@ MainMenu (int menu)
|
||||
ShutoffRumble();
|
||||
#endif
|
||||
|
||||
// wait for keys to be depressed
|
||||
while(MenuRequested())
|
||||
usleep(THREAD_SLEEP);
|
||||
|
||||
CancelAction();
|
||||
HaltGui();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user