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;
}
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();

View File

@ -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

View File

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