diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index eb483ea8e..03ad0cc2f 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -157,6 +157,8 @@ void HK_AutoHoldClearKeyDown(int) { } } +void HK_Reset(int) {ResetGame();} + void HK_ToggleFrame(int) {frameCounterDisplay ^= true;} void HK_ToggleFPS(int) {FpsDisplay ^= true;} void HK_ToggleInput(int) {ShowInputDisplay ^= true;} @@ -233,33 +235,37 @@ void InitCustomKeys (SCustomKeys *keys) i++; }; - - - keys->ToggleFrameCounter.handleKeyDown = HK_ToggleFrame; - keys->ToggleFrameCounter.code = "Toggle Frame Display"; + keys->ToggleFrameCounter.code = "ToggleFrameDisplay"; keys->ToggleFrameCounter.name = L"Toggle Frame Display"; keys->ToggleFrameCounter.page = HOTKEY_PAGE_MAIN; keys->ToggleFrameCounter.key = VK_OEM_PERIOD; keys->ToggleFPS.handleKeyDown = HK_ToggleFPS; - keys->ToggleFPS.code = "Toggle FPS Display"; + keys->ToggleFPS.code = "ToggleFPSDisplay"; keys->ToggleFPS.name = L"Toggle FPS Display"; keys->ToggleFPS.page = HOTKEY_PAGE_MAIN; keys->ToggleFPS.key = NULL; keys->ToggleInput.handleKeyDown = HK_ToggleInput; - keys->ToggleInput.code = "Toggle Input Display"; + keys->ToggleInput.code = "ToggleInputDisplay"; keys->ToggleInput.name = L"Toggle Input Display"; keys->ToggleInput.page = HOTKEY_PAGE_MAIN; keys->ToggleInput.key = VK_OEM_COMMA; keys->ToggleLag.handleKeyDown = HK_ToggleLag; - keys->ToggleLag.code = "Toggle Lag Display"; + keys->ToggleLag.code = "ToggleLagDisplay"; keys->ToggleLag.name = L"Toggle Lag Display"; keys->ToggleLag.page = HOTKEY_PAGE_MAIN; keys->ToggleLag.key = NULL; + keys->Reset.handleKeyDown = HK_Reset; + keys->Reset.code = "Reset"; + keys->Reset.name = L"Reset"; + keys->Reset.page = HOTKEY_PAGE_MAIN; + keys->Reset.key = 'R'; + keys->Reset.modifiers = CUSTKEY_CTRL_MASK; + keys->Pause.handleKeyDown = HK_Pause; keys->Pause.code = "Pause"; keys->Pause.name = L"Pause"; @@ -387,10 +393,10 @@ void InitCustomKeys (SCustomKeys *keys) keys->ToggleRasterizer.key = VK_SUBTRACT; keys->PrintScreen.handleKeyDown = HK_PrintScreen; - keys->PrintScreen.code = "PrintScreen"; - keys->PrintScreen.name = L"Print Screen"; + keys->PrintScreen.code = "SaveScreenshotas"; + keys->PrintScreen.name = L"Save Screenshot as"; keys->PrintScreen.page = HOTKEY_PAGE_MAIN; - keys->PrintScreen.key = VK_PAUSE; + keys->PrintScreen.key = VK_F12; keys->Microphone.handleKeyDown = HK_MicrophoneKeyDown; keys->Microphone.handleKeyUp = HK_MicrophoneKeyUp; diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index 9aebc2a59..360ccb55b 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -65,7 +65,7 @@ struct SCustomKeys SCustomKey Slot[10]; SCustomKey QuickSave, QuickLoad; - SCustomKey Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, Microphone; + SCustomKey Reset, Pause, FrameAdvance, FastForward, FastForwardToggle, IncreaseSpeed, DecreaseSpeed, Microphone; SCustomKey TurboRight, TurboLeft, TurboDown, TurboUp, TurboSelect, TurboStart, TurboB, TurboA, TurboY, TurboX; diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 812e44e35..f3c8b6a30 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2998,9 +2998,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM return 0; case IDM_RESET: - CheatsSearchReset(); - NDS_Reset(); - frameCounter=0; + ResetGame(); return 0; case IDM_3DCONFIG: @@ -3721,3 +3719,10 @@ LRESULT CALLBACK SoundSettingsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARA return FALSE; } + +void ResetGame() +{ + CheatsSearchReset(); + NDS_Reset(); + frameCounter=0; +} \ No newline at end of file diff --git a/desmume/src/windows/main.h b/desmume/src/windows/main.h index bce93b7f8..34a37b613 100644 --- a/desmume/src/windows/main.h +++ b/desmume/src/windows/main.h @@ -12,8 +12,9 @@ void SaveStateMessages(int slotnum, int whichMessage); void Display(); void Pause(); void FrameAdvance(); -extern bool ShowInputDisplay; +void ResetGame(); //Resets game (for the menu item & hotkey +extern bool ShowInputDisplay; extern bool frameCounterDisplay; extern bool FpsDisplay; extern bool ShowInputDisplay;