diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index 86728ef89..fc969949c 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -412,6 +412,11 @@ void HK_FastForwardKeyDown(int, bool justPressed) { FastForward = 1; } void HK_FastForwardKeyUp(int) { FastForward = 0; } void HK_IncreaseSpeed(int, bool justPressed) { IncreaseSpeed(); } void HK_DecreaseSpeed(int, bool justPressed) { DecreaseSpeed(); } +void HK_FrameLimitToggle(int, bool justPressed) { + FrameLimit ^= 1; + WritePrivateProfileInt("FrameLimit", "FrameLimit", FrameLimit, IniName); +} + void HK_FrameAdvanceKeyDown(int, bool justPressed) { FrameAdvance(true); } void HK_FrameAdvanceKeyUp(int) { FrameAdvance(false); } @@ -518,6 +523,12 @@ void InitCustomKeys (SCustomKeys *keys) keys->DecreaseSpeed.page = HOTKEY_PAGE_MAIN; keys->DecreaseSpeed.key = VK_OEM_MINUS; + keys->FrameLimitToggle.handleKeyDown = HK_FrameLimitToggle; + keys->FrameLimitToggle.code = "FrameLimitToggle"; + keys->FrameLimitToggle.name = STRW(ID_LABEL_HK8b); + keys->FrameLimitToggle.page = HOTKEY_PAGE_MAIN; + keys->FrameLimitToggle.key = NULL; + keys->IncreasePressure.handleKeyDown = HK_IncreasePressure; keys->IncreasePressure.code = "IncreasePressure"; keys->IncreasePressure.name = STRW(ID_LABEL_HK55); diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index 64e32f2ce..3cbafbef4 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -68,7 +68,7 @@ struct SCustomKeys SCustomKey Slot[10]; SCustomKey QuickSave, QuickLoad, NextSaveSlot, PreviousSaveSlot; - SCustomKey OpenROM, ReloadROM, Reset, Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, Microphone, IncreasePressure, DecreasePressure; + SCustomKey OpenROM, ReloadROM, Reset, Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, FrameLimitToggle, Microphone, IncreasePressure, DecreasePressure; SCustomKey PlayMovie, RecordMovie, StopMovie, ToggleReadOnly; diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index e51c59d0e..a03d83d06 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -405,7 +405,7 @@ UINT currLanguageMenuItem = IDC_LANGENGLISH; extern HWND RamSearchHWnd; static bool lostFocusPause = true; static bool lastPauseFromLostFocus = false; -static bool FrameLimit = true; +bool FrameLimit = true; extern bool allowBackgroundInput; std::vector LuaScriptHWnds; diff --git a/desmume/src/windows/resource.h b/desmume/src/windows/resource.h index 8e5a274c1..c3f832252 100644 --- a/desmume/src/windows/resource.h +++ b/desmume/src/windows/resource.h @@ -725,6 +725,7 @@ #define ID_LABEL_HK7 4471 #define IDC_GI_TITLEFR 4472 #define ID_LABEL_HK8 4472 +#define ID_LABEL_HK8b 44720 #define IDC_GI_TITLEGE 4473 #define ID_LABEL_HK9 4473 #define IDC_GI_TITLEIT 4474 diff --git a/desmume/src/windows/resources.rc b/desmume/src/windows/resources.rc index 66ad3de90..cadfd80d0 100644 Binary files a/desmume/src/windows/resources.rc and b/desmume/src/windows/resources.rc differ diff --git a/desmume/src/windows/throttle.h b/desmume/src/windows/throttle.h index 5a1968d62..6ff2dfa9e 100644 --- a/desmume/src/windows/throttle.h +++ b/desmume/src/windows/throttle.h @@ -2,6 +2,7 @@ #define _THROTTLE_H_ extern int FastForward; +extern bool FrameLimit; void IncreaseSpeed(); void DecreaseSpeed();