diff --git a/source/ngc/fceugx.cpp b/source/ngc/fceugx.cpp index 2a44bc5..5a10c17 100644 --- a/source/ngc/fceugx.cpp +++ b/source/ngc/fceugx.cpp @@ -300,6 +300,7 @@ int main(int argc, char *argv[]) videoReset = -1; currentMode = GCSettings.render; + currentTiming = GCSettings.timing; ConfigRequested = 0; SwitchAudioMode(0); diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 644e0a8..113f07c 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -3664,6 +3664,10 @@ MainMenu (int menu) ShutoffRumble(); #endif + // wait for keys to be depressed + while(MenuRequested()) + usleep(100); + CancelAction(); HaltGui(); diff --git a/source/ngc/pad.cpp b/source/ngc/pad.cpp index f5ae57d..3b65f5e 100644 --- a/source/ngc/pad.cpp +++ b/source/ngc/pad.cpp @@ -559,6 +559,27 @@ static unsigned char DecodeJoy( unsigned short pad ) return J; } +bool MenuRequested() +{ + for(int i=0; i<4; i++) + { + if ( + (userInput[i].pad.substickX < -70) || + (userInput[i].pad.btns_h & PAD_BUTTON_START && + userInput[i].pad.btns_h & PAD_BUTTON_A && + userInput[i].pad.btns_h & PAD_BUTTON_B && + userInput[i].pad.btns_h & PAD_TRIGGER_Z + ) || + (userInput[i].wpad.btns_h & WPAD_BUTTON_HOME) || + (userInput[i].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) + ) + { + return true; + } + } + return false; +} + void GetJoy() { JSReturn = 0; // reset buttons pressed @@ -573,22 +594,8 @@ void GetJoy() frameskip = 0; // request to go back to menu - for(i=0; i<4; i++) - { - if ( - (userInput[i].pad.substickX < -70) || - (userInput[i].pad.btns_h & PAD_BUTTON_START && - userInput[i].pad.btns_h & PAD_BUTTON_A && - userInput[i].pad.btns_h & PAD_BUTTON_B && - userInput[i].pad.btns_h & PAD_TRIGGER_Z - ) || - (userInput[i].wpad.btns_h & WPAD_BUTTON_HOME) || - (userInput[i].wpad.btns_h & WPAD_CLASSIC_BUTTON_HOME) - ) - { - ScreenshotRequested = 1; // go to the menu - } - } + if(MenuRequested()) + ScreenshotRequested = 1; // go to the menu for (i = 0; i < 4; i++) pad[i] = DecodeJoy(i); diff --git a/source/ngc/pad.h b/source/ngc/pad.h index 0c05aac..fab29fd 100644 --- a/source/ngc/pad.h +++ b/source/ngc/pad.h @@ -32,5 +32,6 @@ s8 WPAD_StickX(u8 chan,u8 right); s8 WPAD_StickY(u8 chan, u8 right); void GetJoy(); void DrawCursor(); +bool MenuRequested(); #endif