From 274d8178aa1e2da95104d3e638edb55056d74f5b Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 12 Apr 2009 18:50:54 +0000 Subject: [PATCH] Win - Added Lag Counter Display Toggle Hotkey --- desmume/src/windows/hotkey.cpp | 8 ++++++++ desmume/src/windows/hotkey.h | 1 + desmume/src/windows/main.h | 1 + 3 files changed, 10 insertions(+) diff --git a/desmume/src/windows/hotkey.cpp b/desmume/src/windows/hotkey.cpp index 7db098a28..12f57111e 100644 --- a/desmume/src/windows/hotkey.cpp +++ b/desmume/src/windows/hotkey.cpp @@ -157,6 +157,8 @@ void HK_AutoHoldClearKeyDown(int) { } } +void HK_ToggleLag(int) {ShowLagFrameCounter ^= true;} + void HK_AutoHoldKeyDown(int) {AutoHoldPressed = true;} void HK_AutoHoldKeyUp(int) {AutoHoldPressed = false;} @@ -228,6 +230,12 @@ void InitCustomKeys (SCustomKeys *keys) i++; }; + keys->ToggleLag.handleKeyDown = HK_ToggleLag; + keys->ToggleLag.code = "Toggle Lag Display"; + keys->ToggleLag.name = L"Toggle Lag Display"; + keys->ToggleLag.page = HOTKEY_PAGE_MAIN; + keys->ToggleLag.key = NULL; + keys->Pause.handleKeyDown = HK_Pause; keys->Pause.code = "Pause"; keys->Pause.name = L"Pause"; diff --git a/desmume/src/windows/hotkey.h b/desmume/src/windows/hotkey.h index e01521f19..7ebc969f8 100644 --- a/desmume/src/windows/hotkey.h +++ b/desmume/src/windows/hotkey.h @@ -74,6 +74,7 @@ struct SCustomKeys SCustomKey ToggleRasterizer; SCustomKey PrintScreen; + SCustomKey ToggleLag; SCustomKey LastItem; // dummy, must be last //--methods-- diff --git a/desmume/src/windows/main.h b/desmume/src/windows/main.h index 2901e77b1..df973d5f9 100644 --- a/desmume/src/windows/main.h +++ b/desmume/src/windows/main.h @@ -13,6 +13,7 @@ void Display(); void Pause(); void FrameAdvance(); extern bool ShowInputDisplay; +extern bool ShowLagFrameCounter; #define GPU3D_NULL 0 #define GPU3D_OPENGL 1