From bc9bb9fd31af3a907d9044f7fd203cc895756118 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sun, 26 Jul 2020 10:59:08 +0200 Subject: [PATCH] added emulation speed change to 'direct only' hotkeys --- src/emucore/EventHandler.cxx | 13 +++++++++++-- src/emucore/EventHandler.hxx | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index 75a38b97c..ed72579a6 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -472,6 +472,7 @@ AdjustFunction EventHandler::getAdjustSetting(AdjustSetting setting) std::bind(&StateManager::changeState, &myOSystem.state(), _1), std::bind(&PaletteHandler::changeCurrentAdjustable, &myOSystem.frameBuffer().tiaSurface().paletteHandler(), _1), std::bind(&TIASurface::changeCurrentNTSCAdjustable, &myOSystem.frameBuffer().tiaSurface(), _1), + std::bind(&Console::changeSpeed, &myOSystem.console(), _1), }; return ADJUST_FUNCTIONS[int(setting)]; @@ -1221,11 +1222,19 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated) // Misc events case Event::DecreaseSpeed: - if(pressed) myOSystem.console().changeSpeed(-1); + if(pressed) + { + myOSystem.console().changeSpeed(-1); + myAdjustDirect = AdjustSetting::CHANGE_SPEED; + } return; case Event::IncreaseSpeed: - if(pressed) myOSystem.console().changeSpeed(+1); + if(pressed) + { + myOSystem.console().changeSpeed(+1); + myAdjustDirect = AdjustSetting::CHANGE_SPEED; + } return; case Event::ToggleTurbo: diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index 93e167282..4c7954c40 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -449,6 +449,7 @@ class EventHandler STATE, PALETTE_CHANGE_ATTRIBUTE, NTSC_CHANGE_ATTRIBUTE, + CHANGE_SPEED, // *** Ranges *** NUM_ADJ, START_AV_ADJ = VOLUME,