fix exiting to game from re-entering menu

This commit is contained in:
dborth 2009-05-28 04:20:04 +00:00
parent e6e6774757
commit 0998b084ea
3 changed files with 23 additions and 6 deletions

View File

@ -913,15 +913,27 @@ static u32 DecodeJoy(unsigned short pad)
return J; return J;
} }
u32 GetJoy(int pad) bool MenuRequested()
{ {
// request to go back to menu for(int i=0; i<4; i++)
{
if ( if (
(userInput[pad].pad.substickX < -70) || (userInput[pad].pad.substickX < -70) ||
(userInput[pad].wpad.btns_h & WPAD_BUTTON_HOME) || (userInput[pad].wpad.btns_h & WPAD_BUTTON_HOME) ||
(userInput[pad].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) || (userInput[pad].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) ||
(DownUsbKeys[KB_ESC]) (DownUsbKeys[KB_ESC])
) )
{
return true;
}
}
return false;
}
u32 GetJoy(int pad)
{
// request to go back to menu
if (MenuRequested())
{ {
ScreenshotRequested = 1; ScreenshotRequested = 1;
updateRumbleFrame(); updateRumbleFrame();

View File

@ -42,5 +42,6 @@ void systemGameRumbleOnlyFor(int OnlyRumbleForFrames);
void updateRumbleFrame(); void updateRumbleFrame();
s8 WPAD_Stick(u8 chan,u8 right, int axis); s8 WPAD_Stick(u8 chan,u8 right, int axis);
u32 GetJoy(int which); u32 GetJoy(int which);
bool MenuRequested();
#endif #endif

View File

@ -3544,6 +3544,10 @@ MainMenu (int menu)
ShutoffRumble(); ShutoffRumble();
#endif #endif
// wait for keys to be depressed
while(MenuRequested())
usleep(THREAD_SLEEP);
CancelAction(); CancelAction();
HaltGui(); HaltGui();