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(); program.reset();
})); }));
hotkeys.append(InputHotkey("Power Cycle").onPress([] {
program.power();
}));
hotkeys.append(InputHotkey("Quit Emulator").onPress([] { hotkeys.append(InputHotkey("Quit Emulator").onPress([] {
program.quit(); program.quit();
})); }));

View File

@ -308,6 +308,14 @@ auto Program::reset() -> void {
showMessage("Game reset"); showMessage("Game reset");
} }
auto Program::power() -> void {
if(!emulator->loaded()) return;
rewindReset();
hackCompatibility();
emulator->power();
showMessage("Power cycle");
}
auto Program::unload() -> void { auto Program::unload() -> void {
if(!emulator->loaded()) return; if(!emulator->loaded()) return;
//todo: video.clear() is not working on macOS/OpenGL 3.2 //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 loadSufamiTurboB(string location) -> bool;
auto save() -> void; auto save() -> void;
auto reset() -> void; auto reset() -> void;
auto power() -> void;
auto unload() -> void; auto unload() -> void;
auto verified() const -> bool; auto verified() const -> bool;