Add 'Power Cycle' hotkey

Closes #25.
This commit is contained in:
Sintendo 2020-06-30 23:13:09 +02:00 committed by Screwtapello
parent b9ccb90324
commit c2c479440e
3 changed files with 13 additions and 0 deletions

View File

@ -151,6 +151,10 @@ auto InputManager::bindHotkeys() -> void {
program.reset();
}));
hotkeys.append(InputHotkey("Power Cycle").onPress([] {
program.power();
}));
hotkeys.append(InputHotkey("Quit Emulator").onPress([] {
program.quit();
}));

View File

@ -308,6 +308,14 @@ auto Program::reset() -> void {
showMessage("Game reset");
}
auto Program::power() -> void {
if(!emulator->loaded()) return;
rewindReset();
hackCompatibility();
emulator->power();
showMessage("Power cycle");
}
auto Program::unload() -> void {
if(!emulator->loaded()) return;
//todo: video.clear() is not working on macOS/OpenGL 3.2

View File

@ -24,6 +24,7 @@ struct Program : Lock, Emulator::Platform {
auto loadSufamiTurboB(string location) -> bool;
auto save() -> void;
auto reset() -> void;
auto power() -> void;
auto unload() -> void;
auto verified() const -> bool;