diff --git a/Core/FdsSystemActionManager.h b/Core/FdsSystemActionManager.h index c1632432..5e763eff 100644 --- a/Core/FdsSystemActionManager.h +++ b/Core/FdsSystemActionManager.h @@ -53,27 +53,29 @@ public: SetBit(FdsSystemActionManager::FdsButtons::InsertDisk1 + _insertDiskNumber); } } - } - void ProcessSystemActions() override - { - SystemActionManager::ProcessSystemActions(); + bool needEject = IsPressed(FdsSystemActionManager::FdsButtons::EjectDiskButton); + int diskToInsert = -1; + for(int i = 0; i < 16; i++) { + if(IsPressed(FdsSystemActionManager::FdsButtons::InsertDisk1 + i)) { + diskToInsert = i; + break; + } + } - shared_ptr mapper = _mapper.lock(); - if(mapper) { - if(IsPressed(FdsSystemActionManager::FdsButtons::EjectDiskButton)) { + if(needEject || diskToInsert >= 0) { + shared_ptr mapper = _mapper.lock(); + if(needEject) { mapper->EjectDisk(); } - for(int i = 0; i < 16; i++) { - if(IsPressed(FdsSystemActionManager::FdsButtons::InsertDisk1 + i)) { - mapper->InsertDisk(i); - break; - } + if(diskToInsert >= 0) { + mapper->InsertDisk(diskToInsert); + } } } - + void EjectDisk() { _needEjectDisk = true; diff --git a/Core/SystemActionManager.h b/Core/SystemActionManager.h index 2cec9ddc..904e0e32 100644 --- a/Core/SystemActionManager.h +++ b/Core/SystemActionManager.h @@ -61,7 +61,7 @@ public: _needPowerCycle = true; } - virtual void ProcessSystemActions() + void ProcessSystemActions() { shared_ptr console = _console.lock(); if(console) { @@ -70,6 +70,7 @@ public: } if(IsPressed(SystemActionManager::Buttons::PowerButton)) { console->PowerCycle(); + //Calling PowerCycle() causes this object to be deleted - no code must be written below this line } } } diff --git a/GUI.NET/Config/PreferenceInfo.cs b/GUI.NET/Config/PreferenceInfo.cs index 229c64d8..a0b573e6 100644 --- a/GUI.NET/Config/PreferenceInfo.cs +++ b/GUI.NET/Config/PreferenceInfo.cs @@ -107,6 +107,8 @@ namespace Mesen.GUI.Config ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.TakeScreenshot, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("F12") })); ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.LoadRandomGame, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("Insert") })); + ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.SwitchDiskSide, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("B") })); + ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.Reset, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("R") })); ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.PowerCycle, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Ctrl"), Key2 = InteropEmu.GetKeyCode("T") })); ShortcutKeys1.Add(new ShortcutKeyInfo(EmulatorShortcut.Pause, new KeyCombination() { Key1 = InteropEmu.GetKeyCode("Esc") }));