Index: pcsx2/Linux/LnxSysExec.cpp =================================================================== --- pcsx2/Linux/LnxSysExec.cpp (revision 552) +++ pcsx2/Linux/LnxSysExec.cpp (working copy) @@ -728,6 +728,10 @@ } break; + case XK_Tab: + CycleFrameLimit(0); + break; + case XK_Escape: signal(SIGINT, SIG_DFL); signal(SIGPIPE, SIG_DFL); Index: pcsx2/Misc.cpp =================================================================== --- pcsx2/Misc.cpp (revision 552) +++ pcsx2/Misc.cpp (working copy) @@ -514,6 +514,66 @@ Path::Combine( dest, SSTATES_DIR, gsText ); } +void CycleFrameLimit(int dir) +{ + const char* limitMsg; + u32 newOptions; + u32 curFrameLimit = Config.Options & PCSX2_FRAMELIMIT_MASK; + u32 newFrameLimit; + static u32 oldFrameLimit = PCSX2_FRAMELIMIT_LIMIT; + + if( dir == 0 ) { + // turn off limit or restore previous limit mode + if (curFrameLimit) { + oldFrameLimit = curFrameLimit; + newFrameLimit = 0; + } else + newFrameLimit = oldFrameLimit; + } else if (dir > 0) { + // next + newFrameLimit = (curFrameLimit + PCSX2_FRAMELIMIT_LIMIT) & PCSX2_FRAMELIMIT_MASK; + } else { + // previous + newFrameLimit = (curFrameLimit + PCSX2_FRAMELIMIT_VUSKIP) & PCSX2_FRAMELIMIT_MASK; + } + + newOptions = (Config.Options & ~PCSX2_FRAMELIMIT_MASK) | newFrameLimit; + + gsResetFrameSkip(); + + switch(newOptions & PCSX2_FRAMELIMIT_MASK) { + case PCSX2_FRAMELIMIT_NORMAL: + limitMsg = "None/Normal"; + break; + case PCSX2_FRAMELIMIT_LIMIT: + limitMsg = "Limit"; + break; + case PCSX2_FRAMELIMIT_SKIP: + case PCSX2_FRAMELIMIT_VUSKIP: + if( GSsetFrameSkip == NULL ) + { + newOptions &= ~PCSX2_FRAMELIMIT_MASK; + Console::Notice("Notice: GS Plugin does not support frameskipping."); + limitMsg = "None/Normal"; + } + else + { + // When enabling Skipping we have to make sure Skipper (GS) and Limiter (EE) + // are properly synchronized. + gsDynamicSkipEnable(); + limitMsg = ((newOptions & PCSX2_FRAMELIMIT_MASK) == PCSX2_FRAMELIMIT_SKIP) ? "Skip" : "VUSkip"; + } + + break; + } + Threading::AtomicExchange( Config.Options, newOptions ); + + Console::Notice("Frame Limit Mode Changed: %s", params limitMsg ); + + // [Air]: Do we really want to save runtime changes to frameskipping? + //SaveConfig(); +} + void ProcessFKeys(int fkey, int shift) { string Text; @@ -588,55 +648,9 @@ break; case 4: - { - const char* limitMsg; - u32 newOptions; - // cycle - if( shift ) { - // previous - newOptions = (Config.Options&~PCSX2_FRAMELIMIT_MASK)|(((Config.Options&PCSX2_FRAMELIMIT_MASK)+PCSX2_FRAMELIMIT_VUSKIP)&PCSX2_FRAMELIMIT_MASK); - } - else { - // next - newOptions = (Config.Options&~PCSX2_FRAMELIMIT_MASK)|(((Config.Options&PCSX2_FRAMELIMIT_MASK)+PCSX2_FRAMELIMIT_LIMIT)&PCSX2_FRAMELIMIT_MASK); - } + CycleFrameLimit(shift ? -1 : 1); + break; - gsResetFrameSkip(); - - switch(newOptions & PCSX2_FRAMELIMIT_MASK) { - case PCSX2_FRAMELIMIT_NORMAL: - limitMsg = "None/Normal"; - break; - case PCSX2_FRAMELIMIT_LIMIT: - limitMsg = "Limit"; - break; - case PCSX2_FRAMELIMIT_SKIP: - case PCSX2_FRAMELIMIT_VUSKIP: - if( GSsetFrameSkip == NULL ) - { - newOptions &= ~PCSX2_FRAMELIMIT_MASK; - Console::Notice("Notice: GS Plugin does not support frameskipping."); - limitMsg = "None/Normal"; - } - else - { - // When enabling Skipping we have to make sure Skipper (GS) and Limiter (EE) - // are properly synchronized. - gsDynamicSkipEnable(); - limitMsg = ((newOptions & PCSX2_FRAMELIMIT_MASK) == PCSX2_FRAMELIMIT_SKIP) ? "Skip" : "VUSkip"; - } - - break; - } - Threading::AtomicExchange( Config.Options, newOptions ); - - Console::Notice("Frame Limit Mode Changed: %s", params limitMsg ); - - // [Air]: Do we really want to save runtime changes to frameskipping? - //SaveConfig(); - } - break; - // note: VK_F5-VK_F7 are reserved for GS case 8: GSmakeSnapshot("snaps/"); Index: pcsx2/Misc.h =================================================================== --- pcsx2/Misc.h (revision 552) +++ pcsx2/Misc.h (working copy) @@ -184,6 +184,7 @@ void LoadGSState(const string& file); char *ParseLang(char *id); +void CycleFrameLimit(int dir); void ProcessFKeys(int fkey, int shift); // processes fkey related commands value 1-12 #define DIRENTRY_SIZE 16 Index: pcsx2/windows/WinSysExec.cpp =================================================================== --- pcsx2/windows/WinSysExec.cpp (revision 552) +++ pcsx2/windows/WinSysExec.cpp (working copy) @@ -655,6 +655,10 @@ } break; + case VK_TAB: + CycleFrameLimit(0); + break; + case VK_ESCAPE: #ifdef PCSX2_DEVBUILD if( g_SaveGSStream >= 3 ) {