From a0d5740d7ccfcac6266b58e6673796ce35179568 Mon Sep 17 00:00:00 2001 From: shinydoofy Date: Sun, 19 Oct 2008 17:01:37 +0000 Subject: [PATCH] skip lag when frame advancing toggled for SDL build --- changelog.txt | 1 + src/drivers/sdl/config.cpp | 1 + src/drivers/sdl/input.cpp | 13 ++++++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 325c3663..4f67e3ab 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.3 yet to be released--- +19-oct-2008 - shinydoofy - toggle skipping of lag frames for SDL build, default hotkey F6 19-oct-2008 - shinydoofy - [ 2179829 ] user ability to toggle "bind savestates to movie" added for SDL, default hotkey F2 19-oct-2008 - adelikat - winew - added a toggle for binding savestates to movies 18-oct-2008 - adelikat - Win32 - added -cfg (config file) command line argument diff --git a/src/drivers/sdl/config.cpp b/src/drivers/sdl/config.cpp index 248e2cf1..f6bda0f0 100644 --- a/src/drivers/sdl/config.cpp +++ b/src/drivers/sdl/config.cpp @@ -281,6 +281,7 @@ InitConfig() config->addOption(prefix + "FrameAdvance", SDLK_BACKSLASH); config->addOption(prefix + "Power", 0); config->addOption(prefix + "BindState", SDLK_F2); + config->addOption(prefix + "FrameAdvanceLagSkip", SDLK_F6); diff --git a/src/drivers/sdl/input.cpp b/src/drivers/sdl/input.cpp index 7b1eb0e5..e8ba6479 100644 --- a/src/drivers/sdl/input.cpp +++ b/src/drivers/sdl/input.cpp @@ -35,12 +35,12 @@ #ifdef _S9XLUA_H #include "../../fceulua.h" #endif -#include "../../file.h" /** GLOBALS **/ int NoWaiting=1; extern Config *g_config; +extern bool bindSavestate, frameAdvanceLagSkip; /* UsrInputType[] is user-specified. InputType[] is current @@ -379,9 +379,16 @@ KeyboardCommands() g_config->getOption("SDL.Hotkeys.BindState", &key); if(_keyonly(key)) { - bindSavestate = !bindSavestate; + bindSavestate ^= 1; FCEUI_DispMessage("Savestate binding to movie %sabled.", - bindSavestate ? "en" : "dis"); + bindSavestate ? "en" : "dis"); + } + + g_config->getOption("SDL.Hotkeys.FrameAdvanceLagSkip", &key); + if(_keyonly(key)) { + frameAdvanceLagSkip ^= 1; + FCEUI_DispMessage("Skipping lag in Frame Advance %sabled.", + frameAdvanceLagSkip ? "en" : "dis"); } // VS Unisystem games