added emulation speed change to 'direct only' hotkeys

This commit is contained in:
thrust26 2020-07-26 10:59:08 +02:00
parent 5c9a73c530
commit bc9bb9fd31
2 changed files with 12 additions and 2 deletions

View File

@ -472,6 +472,7 @@ AdjustFunction EventHandler::getAdjustSetting(AdjustSetting setting)
std::bind(&StateManager::changeState, &myOSystem.state(), _1), std::bind(&StateManager::changeState, &myOSystem.state(), _1),
std::bind(&PaletteHandler::changeCurrentAdjustable, &myOSystem.frameBuffer().tiaSurface().paletteHandler(), _1), std::bind(&PaletteHandler::changeCurrentAdjustable, &myOSystem.frameBuffer().tiaSurface().paletteHandler(), _1),
std::bind(&TIASurface::changeCurrentNTSCAdjustable, &myOSystem.frameBuffer().tiaSurface(), _1), std::bind(&TIASurface::changeCurrentNTSCAdjustable, &myOSystem.frameBuffer().tiaSurface(), _1),
std::bind(&Console::changeSpeed, &myOSystem.console(), _1),
}; };
return ADJUST_FUNCTIONS[int(setting)]; return ADJUST_FUNCTIONS[int(setting)];
@ -1221,11 +1222,19 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
// Misc events // Misc events
case Event::DecreaseSpeed: case Event::DecreaseSpeed:
if(pressed) myOSystem.console().changeSpeed(-1); if(pressed)
{
myOSystem.console().changeSpeed(-1);
myAdjustDirect = AdjustSetting::CHANGE_SPEED;
}
return; return;
case Event::IncreaseSpeed: case Event::IncreaseSpeed:
if(pressed) myOSystem.console().changeSpeed(+1); if(pressed)
{
myOSystem.console().changeSpeed(+1);
myAdjustDirect = AdjustSetting::CHANGE_SPEED;
}
return; return;
case Event::ToggleTurbo: case Event::ToggleTurbo:

View File

@ -449,6 +449,7 @@ class EventHandler
STATE, STATE,
PALETTE_CHANGE_ATTRIBUTE, PALETTE_CHANGE_ATTRIBUTE,
NTSC_CHANGE_ATTRIBUTE, NTSC_CHANGE_ATTRIBUTE,
CHANGE_SPEED,
// *** Ranges *** // *** Ranges ***
NUM_ADJ, NUM_ADJ,
START_AV_ADJ = VOLUME, START_AV_ADJ = VOLUME,