UI: Added reload rom option

Same as Mesen - Power Cycle no longer resets changes done to PRG.  Reload ROM must be used when reloading the rom from the disk is needed.
+ Fixed some issues with reset and power cycle not pausing emulation when the option to pause when turned on
This commit is contained in:
Sour 2020-02-22 20:54:07 -05:00
parent 5aa615a227
commit 483ffe1143
16 changed files with 140 additions and 83 deletions

View file

@ -307,11 +307,9 @@ void Console::Stop(bool sendNotification)
void Console::Reset() void Console::Reset()
{ {
shared_ptr<Debugger> debugger = _debugger; shared_ptr<Debugger> debugger = _debugger;
if(debugger) {
debugger->Run();
}
Lock(); _lockCounter++;
_runLock.Acquire();
_dmaController->Reset(); _dmaController->Reset();
_internalRegisters->Reset(); _internalRegisters->Reset();
@ -334,16 +332,18 @@ void Console::Reset()
_spcHud.reset(); _spcHud.reset();
} }
_memoryManager->IncMasterClockStartup();
Unlock();
if(debugger) { if(debugger) {
//Debugger was suspended in SystemActionManager::Reset(), resume debugger here
debugger->SuspendDebugger(true); debugger->SuspendDebugger(true);
} }
_memoryManager->IncMasterClockStartup();
_runLock.Release();
_lockCounter--;
} }
void Console::PowerCycle() void Console::ReloadRom(bool forPowerCycle)
{ {
shared_ptr<BaseCartridge> cart = _cart; shared_ptr<BaseCartridge> cart = _cart;
if(cart) { if(cart) {
@ -354,14 +354,19 @@ void Console::PowerCycle()
RomInfo info = cart->GetRomInfo(); RomInfo info = cart->GetRomInfo();
Lock(); Lock();
LoadRom(info.RomFile, info.PatchFile, false); LoadRom(info.RomFile, info.PatchFile, false, forPowerCycle);
_memoryManager->IncMasterClockStartup(); _memoryManager->IncMasterClockStartup();
Unlock(); Unlock();
} }
} }
bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom) void Console::PowerCycle()
{
ReloadRom(true);
}
bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom, bool forPowerCycle)
{ {
if(_cart) { if(_cart) {
//Make sure the battery is saved to disk before we load another game (or reload the same game) //Make sure the battery is saved to disk before we load another game (or reload the same game)
@ -370,7 +375,7 @@ bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom)
bool result = false; bool result = false;
EmulationConfig orgConfig = _settings->GetEmulationConfig(); //backup emulation config (can be temporarily overriden to control the power on RAM state) EmulationConfig orgConfig = _settings->GetEmulationConfig(); //backup emulation config (can be temporarily overriden to control the power on RAM state)
shared_ptr<BaseCartridge> cart = BaseCartridge::CreateCartridge(this, romFile, patchFile); shared_ptr<BaseCartridge> cart = forPowerCycle ? _cart : BaseCartridge::CreateCartridge(this, romFile, patchFile);
if(cart) { if(cart) {
if(stopRom) { if(stopRom) {
KeyManager::UpdateDevices(); KeyManager::UpdateDevices();
@ -422,13 +427,15 @@ bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom)
UpdateRegion(); UpdateRegion();
_notificationManager->SendNotification(ConsoleNotificationType::GameLoaded); _notificationManager->SendNotification(ConsoleNotificationType::GameLoaded, (void*)forPowerCycle);
_paused = false; _paused = false;
string modelName = _region == ConsoleRegion::Pal ? "PAL" : "NTSC"; if(!forPowerCycle) {
string messageTitle = MessageManager::Localize("GameLoaded") + " (" + modelName + ")"; string modelName = _region == ConsoleRegion::Pal ? "PAL" : "NTSC";
MessageManager::DisplayMessage(messageTitle, FolderUtilities::GetFilename(GetRomInfo().RomFile.GetFileName(), false)); string messageTitle = MessageManager::Localize("GameLoaded") + " (" + modelName + ")";
MessageManager::DisplayMessage(messageTitle, FolderUtilities::GetFilename(GetRomInfo().RomFile.GetFileName(), false));
}
if(stopRom) { if(stopRom) {
#ifndef LIBRETRO #ifndef LIBRETRO

View file

@ -113,6 +113,7 @@ public:
void ProcessEndOfFrame(); void ProcessEndOfFrame();
void Reset(); void Reset();
void ReloadRom(bool forPowerCycle);
void PowerCycle(); void PowerCycle();
void PauseOnNextFrame(); void PauseOnNextFrame();
@ -121,7 +122,7 @@ public:
void Resume(); void Resume();
bool IsPaused(); bool IsPaused();
bool LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom = true); bool LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom = true, bool forPowerCycle = false);
RomInfo GetRomInfo(); RomInfo GetRomInfo();
uint32_t GetMasterClockRate(); uint32_t GetMasterClockRate();
ConsoleRegion GetRegion(); ConsoleRegion GetRegion();

View file

@ -252,7 +252,7 @@ void Debugger::SleepUntilResume(BreakSource source, MemoryOperationInfo *operati
_executionStopped = true; _executionStopped = true;
if(_breakRequestCount == 0) { if(source != BreakSource::Unspecified || _breakRequestCount == 0) {
//Only trigger code break event if the pause was caused by user action //Only trigger code break event if the pause was caused by user action
BreakEvent evt = {}; BreakEvent evt = {};
evt.BreakpointId = breakpointId; evt.BreakpointId = breakpointId;

View file

@ -366,6 +366,7 @@ enum class EmulatorShortcut
Pause, Pause,
Reset, Reset,
PowerCycle, PowerCycle,
ReloadRom,
PowerOff, PowerOff,
Exit, Exit,

View file

@ -201,6 +201,13 @@ extern "C" {
} }
} }
DllExport void __stdcall ReloadRom()
{
if(!GameClient::Connected()) {
_console->ReloadRom(false);
}
}
DllExport void __stdcall Release() DllExport void __stdcall Release()
{ {
GameClient::Disconnect(); GameClient::Disconnect();

View file

@ -44,6 +44,7 @@ namespace Mesen.GUI.Config.Shortcuts
Pause, Pause,
Reset, Reset,
PowerCycle, PowerCycle,
ReloadRom,
PowerOff, PowerOff,
Exit, Exit,

View file

@ -108,6 +108,8 @@ namespace Mesen.GUI.Config
public XmlKeys Reset = Keys.Control | Keys.R; public XmlKeys Reset = Keys.Control | Keys.R;
[ShortcutName("Power Cycle")] [ShortcutName("Power Cycle")]
public XmlKeys PowerCycle = Keys.Control | Keys.T; public XmlKeys PowerCycle = Keys.Control | Keys.T;
[ShortcutName("Reload ROM")]
public XmlKeys ReloadRom = Keys.None;
[ShortcutName("Continue")] [ShortcutName("Continue")]
public XmlKeys Continue = Keys.F5; public XmlKeys Continue = Keys.F5;

View file

@ -83,6 +83,7 @@ namespace Mesen.GUI.Debugger
}; };
ctrlDbgShortcutsDebugger.Shortcuts = new FieldInfo[] { ctrlDbgShortcutsDebugger.Shortcuts = new FieldInfo[] {
GetMember(nameof(DebuggerShortcutsConfig.ReloadRom)),
GetMember(nameof(DebuggerShortcutsConfig.Reset)), GetMember(nameof(DebuggerShortcutsConfig.Reset)),
GetMember(nameof(DebuggerShortcutsConfig.PowerCycle)), GetMember(nameof(DebuggerShortcutsConfig.PowerCycle)),
GetMember(nameof(DebuggerShortcutsConfig.Continue)), GetMember(nameof(DebuggerShortcutsConfig.Continue)),

View file

@ -39,6 +39,9 @@
this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripSeparator();
this.importExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.importExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuDbgIntegrationSettings = new System.Windows.Forms.ToolStripMenuItem(); this.mnuDbgIntegrationSettings = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator();
this.mnuImportLabels = new System.Windows.Forms.ToolStripMenuItem();
this.mnuExportLabels = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator();
this.codeDataLoggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.codeDataLoggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuResetCdlLog = new System.Windows.Forms.ToolStripMenuItem(); this.mnuResetCdlLog = new System.Windows.Forms.ToolStripMenuItem();
@ -140,9 +143,8 @@
this.grpCallstack = new System.Windows.Forms.GroupBox(); this.grpCallstack = new System.Windows.Forms.GroupBox();
this.ctrlCallstack = new Mesen.GUI.Debugger.Controls.ctrlCallstack(); this.ctrlCallstack = new Mesen.GUI.Debugger.Controls.ctrlCallstack();
this.tsToolbar = new Mesen.GUI.Controls.ctrlMesenToolStrip(); this.tsToolbar = new Mesen.GUI.Controls.ctrlMesenToolStrip();
this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator();
this.mnuImportLabels = new System.Windows.Forms.ToolStripMenuItem(); this.mnuReloadRom = new System.Windows.Forms.ToolStripMenuItem();
this.mnuExportLabels = new System.Windows.Forms.ToolStripMenuItem();
this.ctrlMesenMenuStrip1.SuspendLayout(); this.ctrlMesenMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ctrlSplitContainer)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.ctrlSplitContainer)).BeginInit();
this.ctrlSplitContainer.Panel1.SuspendLayout(); this.ctrlSplitContainer.Panel1.SuspendLayout();
@ -180,6 +182,8 @@
// fileToolStripMenuItem // fileToolStripMenuItem
// //
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuReloadRom,
this.toolStripMenuItem16,
this.mnuSaveRomAs, this.mnuSaveRomAs,
this.mnuSaveAsIps, this.mnuSaveAsIps,
this.toolStripMenuItem14, this.toolStripMenuItem14,
@ -231,6 +235,27 @@
this.mnuDbgIntegrationSettings.Text = "CC65/CA65 Integration Settings"; this.mnuDbgIntegrationSettings.Text = "CC65/CA65 Integration Settings";
this.mnuDbgIntegrationSettings.Click += new System.EventHandler(this.mnuDbgIntegrationSettings_Click); this.mnuDbgIntegrationSettings.Click += new System.EventHandler(this.mnuDbgIntegrationSettings_Click);
// //
// toolStripMenuItem15
//
this.toolStripMenuItem15.Name = "toolStripMenuItem15";
this.toolStripMenuItem15.Size = new System.Drawing.Size(238, 6);
//
// mnuImportLabels
//
this.mnuImportLabels.Image = global::Mesen.GUI.Properties.Resources.Import;
this.mnuImportLabels.Name = "mnuImportLabels";
this.mnuImportLabels.Size = new System.Drawing.Size(241, 22);
this.mnuImportLabels.Text = "Import Labels";
this.mnuImportLabels.Click += new System.EventHandler(this.mnuImportLabels_Click);
//
// mnuExportLabels
//
this.mnuExportLabels.Image = global::Mesen.GUI.Properties.Resources.Export;
this.mnuExportLabels.Name = "mnuExportLabels";
this.mnuExportLabels.Size = new System.Drawing.Size(241, 22);
this.mnuExportLabels.Text = "Export Labels";
this.mnuExportLabels.Click += new System.EventHandler(this.mnuExportLabels_Click);
//
// toolStripMenuItem7 // toolStripMenuItem7
// //
this.toolStripMenuItem7.Name = "toolStripMenuItem7"; this.toolStripMenuItem7.Name = "toolStripMenuItem7";
@ -1036,26 +1061,17 @@
this.tsToolbar.TabIndex = 3; this.tsToolbar.TabIndex = 3;
this.tsToolbar.Text = "ctrlMesenToolStrip1"; this.tsToolbar.Text = "ctrlMesenToolStrip1";
// //
// toolStripMenuItem15 // toolStripMenuItem16
// //
this.toolStripMenuItem15.Name = "toolStripMenuItem15"; this.toolStripMenuItem16.Name = "toolStripMenuItem16";
this.toolStripMenuItem15.Size = new System.Drawing.Size(238, 6); this.toolStripMenuItem16.Size = new System.Drawing.Size(198, 6);
// //
// mnuImportLabels // mnuReloadRom
// //
this.mnuImportLabels.Image = global::Mesen.GUI.Properties.Resources.Import; this.mnuReloadRom.Image = global::Mesen.GUI.Properties.Resources.Refresh;
this.mnuImportLabels.Name = "mnuImportLabels"; this.mnuReloadRom.Name = "mnuReloadRom";
this.mnuImportLabels.Size = new System.Drawing.Size(241, 22); this.mnuReloadRom.Size = new System.Drawing.Size(201, 22);
this.mnuImportLabels.Text = "Import Labels"; this.mnuReloadRom.Text = "Reload ROM";
this.mnuImportLabels.Click += new System.EventHandler(this.mnuImportLabels_Click);
//
// mnuExportLabels
//
this.mnuExportLabels.Image = global::Mesen.GUI.Properties.Resources.Export;
this.mnuExportLabels.Name = "mnuExportLabels";
this.mnuExportLabels.Size = new System.Drawing.Size(241, 22);
this.mnuExportLabels.Text = "Export Labels";
this.mnuExportLabels.Click += new System.EventHandler(this.mnuExportLabels_Click);
// //
// frmDebugger // frmDebugger
// //
@ -1203,5 +1219,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem15; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem15;
private System.Windows.Forms.ToolStripMenuItem mnuImportLabels; private System.Windows.Forms.ToolStripMenuItem mnuImportLabels;
private System.Windows.Forms.ToolStripMenuItem mnuExportLabels; private System.Windows.Forms.ToolStripMenuItem mnuExportLabels;
private System.Windows.Forms.ToolStripMenuItem mnuReloadRom;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem16;
} }
} }

View file

@ -9,6 +9,7 @@ using System.ComponentModel;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
namespace Mesen.GUI.Debugger namespace Mesen.GUI.Debugger
@ -145,6 +146,7 @@ namespace Mesen.GUI.Debugger
private void InitShortcuts() private void InitShortcuts()
{ {
mnuReloadRom.InitShortcut(this, nameof(DebuggerShortcutsConfig.ReloadRom));
mnuReset.InitShortcut(this, nameof(DebuggerShortcutsConfig.Reset)); mnuReset.InitShortcut(this, nameof(DebuggerShortcutsConfig.Reset));
mnuPowerCycle.InitShortcut(this, nameof(DebuggerShortcutsConfig.PowerCycle)); mnuPowerCycle.InitShortcut(this, nameof(DebuggerShortcutsConfig.PowerCycle));
@ -165,9 +167,6 @@ namespace Mesen.GUI.Debugger
mnuToggleBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint)); mnuToggleBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint));
mnuEnableDisableBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_DisableEnableBreakpoint)); mnuEnableDisableBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_DisableEnableBreakpoint));
mnuReset.InitShortcut(this, nameof(DebuggerShortcutsConfig.Reset));
mnuPowerCycle.InitShortcut(this, nameof(DebuggerShortcutsConfig.PowerCycle));
mnuGoToAll.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToAll)); mnuGoToAll.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToAll));
mnuGoToAddress.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoTo)); mnuGoToAddress.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoTo));
mnuGoToProgramCounter.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToProgramCounter)); mnuGoToProgramCounter.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToProgramCounter));
@ -200,6 +199,7 @@ namespace Mesen.GUI.Debugger
mnuContinue.Click += (s, e) => { DebugApi.ResumeExecution(); }; mnuContinue.Click += (s, e) => { DebugApi.ResumeExecution(); };
mnuBreak.Click += (s, e) => { DebugApi.Step(_cpuType, 1, StepType.Step); }; mnuBreak.Click += (s, e) => { DebugApi.Step(_cpuType, 1, StepType.Step); };
mnuReloadRom.Click += (s, e) => { Task.Run(() => { EmuApi.ReloadRom(); }); };
mnuReset.Click += (s, e) => { EmuApi.Reset(); }; mnuReset.Click += (s, e) => { EmuApi.Reset(); };
mnuPowerCycle.Click += (s, e) => { EmuApi.PowerCycle(); }; mnuPowerCycle.Click += (s, e) => { EmuApi.PowerCycle(); };
@ -445,7 +445,10 @@ namespace Mesen.GUI.Debugger
DebugState state = DebugApi.GetState(); DebugState state = DebugApi.GetState();
this.BeginInvoke((MethodInvoker)(() => { this.BeginInvoke((MethodInvoker)(() => {
DebugWorkspaceManager.ImportDbgFile(); bool isPowerCycle = e.Parameter.ToInt32() != 0;
if(!isPowerCycle) {
DebugWorkspaceManager.ImportDbgFile();
}
LabelManager.RefreshLabels(); LabelManager.RefreshLabels();
DebugApi.RefreshDisassembly(_cpuType); DebugApi.RefreshDisassembly(_cpuType);
UpdateDebugger(state, null); UpdateDebugger(state, null);

View file

@ -4,6 +4,7 @@
<Form ID="frmMain" Title="Mesen-S"> <Form ID="frmMain" Title="Mesen-S">
<Control ID="mnuFile">File</Control> <Control ID="mnuFile">File</Control>
<Control ID="mnuOpen">Open</Control> <Control ID="mnuOpen">Open</Control>
<Control ID="mnuReloadRom">Reload ROM</Control>
<Control ID="mnuSaveState">Save State</Control> <Control ID="mnuSaveState">Save State</Control>
<Control ID="mnuLoadState">Load State</Control> <Control ID="mnuLoadState">Load State</Control>
<Control ID="mnuLoadLastSession">Load Last Session</Control> <Control ID="mnuLoadLastSession">Load Last Session</Control>
@ -767,6 +768,7 @@
<Message ID="EmulatorShortcutMappings_Pause">Pause</Message> <Message ID="EmulatorShortcutMappings_Pause">Pause</Message>
<Message ID="EmulatorShortcutMappings_Reset">Reset</Message> <Message ID="EmulatorShortcutMappings_Reset">Reset</Message>
<Message ID="EmulatorShortcutMappings_PowerCycle">Power Cycle</Message> <Message ID="EmulatorShortcutMappings_PowerCycle">Power Cycle</Message>
<Message ID="EmulatorShortcutMappings_ReloadRom">Reload ROM</Message>
<Message ID="EmulatorShortcutMappings_PowerOff">Power Off</Message> <Message ID="EmulatorShortcutMappings_PowerOff">Power Off</Message>
<Message ID="EmulatorShortcutMappings_Exit">Exit</Message> <Message ID="EmulatorShortcutMappings_Exit">Exit</Message>
<Message ID="EmulatorShortcutMappings_TakeScreenshot">Take Screenshot</Message> <Message ID="EmulatorShortcutMappings_TakeScreenshot">Take Screenshot</Message>

View file

@ -75,6 +75,7 @@ namespace Mesen.GUI.Emulation
case EmulatorShortcut.Pause: TogglePause(); break; case EmulatorShortcut.Pause: TogglePause(); break;
case EmulatorShortcut.Reset: EmuApi.Reset(); break; case EmulatorShortcut.Reset: EmuApi.Reset(); break;
case EmulatorShortcut.PowerCycle: EmuApi.PowerCycle(); break; case EmulatorShortcut.PowerCycle: EmuApi.PowerCycle(); break;
case EmulatorShortcut.ReloadRom: Task.Run(() => EmuApi.ReloadRom()); break;
case EmulatorShortcut.PowerOff: Task.Run(() => EmuApi.Stop()); restoreFullscreen = false; break; case EmulatorShortcut.PowerOff: Task.Run(() => EmuApi.Stop()); restoreFullscreen = false; break;
case EmulatorShortcut.Exit: frmMain.Instance.Close(); restoreFullscreen = false; break; case EmulatorShortcut.Exit: frmMain.Instance.Close(); restoreFullscreen = false; break;

View file

@ -44,6 +44,7 @@ namespace Mesen.GUI.Forms.Config
EmulatorShortcut.Pause, EmulatorShortcut.Pause,
EmulatorShortcut.Reset, EmulatorShortcut.Reset,
EmulatorShortcut.PowerCycle, EmulatorShortcut.PowerCycle,
EmulatorShortcut.ReloadRom,
EmulatorShortcut.PowerOff, EmulatorShortcut.PowerOff,
EmulatorShortcut.Exit, EmulatorShortcut.Exit,

View file

@ -151,10 +151,12 @@
this.mnuDebugger = new System.Windows.Forms.ToolStripMenuItem(); this.mnuDebugger = new System.Windows.Forms.ToolStripMenuItem();
this.mnuEventViewer = new System.Windows.Forms.ToolStripMenuItem(); this.mnuEventViewer = new System.Windows.Forms.ToolStripMenuItem();
this.mnuMemoryTools = new System.Windows.Forms.ToolStripMenuItem(); this.mnuMemoryTools = new System.Windows.Forms.ToolStripMenuItem();
this.mnuProfiler = new System.Windows.Forms.ToolStripMenuItem();
this.mnuRegisterViewer = new System.Windows.Forms.ToolStripMenuItem(); this.mnuRegisterViewer = new System.Windows.Forms.ToolStripMenuItem();
this.mnuScriptWindow = new System.Windows.Forms.ToolStripMenuItem();
this.mnuTraceLogger = new System.Windows.Forms.ToolStripMenuItem(); this.mnuTraceLogger = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem26 = new System.Windows.Forms.ToolStripSeparator();
this.mnuAssembler = new System.Windows.Forms.ToolStripMenuItem();
this.mnuProfiler = new System.Windows.Forms.ToolStripMenuItem();
this.mnuScriptWindow = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator();
this.mnuTilemapViewer = new System.Windows.Forms.ToolStripMenuItem(); this.mnuTilemapViewer = new System.Windows.Forms.ToolStripMenuItem();
this.mnuTileViewer = new System.Windows.Forms.ToolStripMenuItem(); this.mnuTileViewer = new System.Windows.Forms.ToolStripMenuItem();
@ -172,8 +174,7 @@
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem(); this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
this.pnlRenderer = new System.Windows.Forms.Panel(); this.pnlRenderer = new System.Windows.Forms.Panel();
this.ctrlRecentGames = new Mesen.GUI.Controls.ctrlRecentGames(); this.ctrlRecentGames = new Mesen.GUI.Controls.ctrlRecentGames();
this.mnuAssembler = new System.Windows.Forms.ToolStripMenuItem(); this.mnuReloadRom = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem26 = new System.Windows.Forms.ToolStripSeparator();
this.mnuMain.SuspendLayout(); this.mnuMain.SuspendLayout();
this.pnlRenderer.SuspendLayout(); this.pnlRenderer.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
@ -204,6 +205,7 @@
// //
this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuOpen, this.mnuOpen,
this.mnuReloadRom,
this.toolStripMenuItem2, this.toolStripMenuItem2,
this.mnuSaveState, this.mnuSaveState,
this.mnuLoadState, this.mnuLoadState,
@ -222,49 +224,49 @@
// //
this.mnuOpen.Image = global::Mesen.GUI.Properties.Resources.Folder; this.mnuOpen.Image = global::Mesen.GUI.Properties.Resources.Folder;
this.mnuOpen.Name = "mnuOpen"; this.mnuOpen.Name = "mnuOpen";
this.mnuOpen.Size = new System.Drawing.Size(136, 22); this.mnuOpen.Size = new System.Drawing.Size(180, 22);
this.mnuOpen.Text = "Open"; this.mnuOpen.Text = "Open";
// //
// toolStripMenuItem2 // toolStripMenuItem2
// //
this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(133, 6); this.toolStripMenuItem2.Size = new System.Drawing.Size(177, 6);
// //
// mnuSaveState // mnuSaveState
// //
this.mnuSaveState.Name = "mnuSaveState"; this.mnuSaveState.Name = "mnuSaveState";
this.mnuSaveState.Size = new System.Drawing.Size(136, 22); this.mnuSaveState.Size = new System.Drawing.Size(180, 22);
this.mnuSaveState.Text = "Save State"; this.mnuSaveState.Text = "Save State";
this.mnuSaveState.DropDownOpening += new System.EventHandler(this.mnuSaveState_DropDownOpening); this.mnuSaveState.DropDownOpening += new System.EventHandler(this.mnuSaveState_DropDownOpening);
// //
// mnuLoadState // mnuLoadState
// //
this.mnuLoadState.Name = "mnuLoadState"; this.mnuLoadState.Name = "mnuLoadState";
this.mnuLoadState.Size = new System.Drawing.Size(136, 22); this.mnuLoadState.Size = new System.Drawing.Size(180, 22);
this.mnuLoadState.Text = "Load State"; this.mnuLoadState.Text = "Load State";
this.mnuLoadState.DropDownOpening += new System.EventHandler(this.mnuLoadState_DropDownOpening); this.mnuLoadState.DropDownOpening += new System.EventHandler(this.mnuLoadState_DropDownOpening);
// //
// toolStripMenuItem10 // toolStripMenuItem10
// //
this.toolStripMenuItem10.Name = "toolStripMenuItem10"; this.toolStripMenuItem10.Name = "toolStripMenuItem10";
this.toolStripMenuItem10.Size = new System.Drawing.Size(133, 6); this.toolStripMenuItem10.Size = new System.Drawing.Size(177, 6);
// //
// mnuRecentFiles // mnuRecentFiles
// //
this.mnuRecentFiles.Name = "mnuRecentFiles"; this.mnuRecentFiles.Name = "mnuRecentFiles";
this.mnuRecentFiles.Size = new System.Drawing.Size(136, 22); this.mnuRecentFiles.Size = new System.Drawing.Size(180, 22);
this.mnuRecentFiles.Text = "Recent Files"; this.mnuRecentFiles.Text = "Recent Files";
// //
// toolStripMenuItem6 // toolStripMenuItem6
// //
this.toolStripMenuItem6.Name = "toolStripMenuItem6"; this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(133, 6); this.toolStripMenuItem6.Size = new System.Drawing.Size(177, 6);
// //
// mnuExit // mnuExit
// //
this.mnuExit.Image = global::Mesen.GUI.Properties.Resources.Exit; this.mnuExit.Image = global::Mesen.GUI.Properties.Resources.Exit;
this.mnuExit.Name = "mnuExit"; this.mnuExit.Name = "mnuExit";
this.mnuExit.Size = new System.Drawing.Size(136, 22); this.mnuExit.Size = new System.Drawing.Size(180, 22);
this.mnuExit.Text = "Exit"; this.mnuExit.Text = "Exit";
// //
// mnuGame // mnuGame
@ -286,7 +288,7 @@
this.mnuPause.Enabled = false; this.mnuPause.Enabled = false;
this.mnuPause.Image = global::Mesen.GUI.Properties.Resources.MediaPause; this.mnuPause.Image = global::Mesen.GUI.Properties.Resources.MediaPause;
this.mnuPause.Name = "mnuPause"; this.mnuPause.Name = "mnuPause";
this.mnuPause.Size = new System.Drawing.Size(139, 22); this.mnuPause.Size = new System.Drawing.Size(180, 22);
this.mnuPause.Text = "Pause"; this.mnuPause.Text = "Pause";
// //
// mnuReset // mnuReset
@ -294,7 +296,7 @@
this.mnuReset.Enabled = false; this.mnuReset.Enabled = false;
this.mnuReset.Image = global::Mesen.GUI.Properties.Resources.Refresh; this.mnuReset.Image = global::Mesen.GUI.Properties.Resources.Refresh;
this.mnuReset.Name = "mnuReset"; this.mnuReset.Name = "mnuReset";
this.mnuReset.Size = new System.Drawing.Size(139, 22); this.mnuReset.Size = new System.Drawing.Size(180, 22);
this.mnuReset.Text = "Reset"; this.mnuReset.Text = "Reset";
// //
// mnuPowerCycle // mnuPowerCycle
@ -302,19 +304,19 @@
this.mnuPowerCycle.Enabled = false; this.mnuPowerCycle.Enabled = false;
this.mnuPowerCycle.Image = global::Mesen.GUI.Properties.Resources.PowerCycle; this.mnuPowerCycle.Image = global::Mesen.GUI.Properties.Resources.PowerCycle;
this.mnuPowerCycle.Name = "mnuPowerCycle"; this.mnuPowerCycle.Name = "mnuPowerCycle";
this.mnuPowerCycle.Size = new System.Drawing.Size(139, 22); this.mnuPowerCycle.Size = new System.Drawing.Size(180, 22);
this.mnuPowerCycle.Text = "Power Cycle"; this.mnuPowerCycle.Text = "Power Cycle";
// //
// toolStripMenuItem24 // toolStripMenuItem24
// //
this.toolStripMenuItem24.Name = "toolStripMenuItem24"; this.toolStripMenuItem24.Name = "toolStripMenuItem24";
this.toolStripMenuItem24.Size = new System.Drawing.Size(136, 6); this.toolStripMenuItem24.Size = new System.Drawing.Size(177, 6);
// //
// mnuPowerOff // mnuPowerOff
// //
this.mnuPowerOff.Image = global::Mesen.GUI.Properties.Resources.MediaStop; this.mnuPowerOff.Image = global::Mesen.GUI.Properties.Resources.MediaStop;
this.mnuPowerOff.Name = "mnuPowerOff"; this.mnuPowerOff.Name = "mnuPowerOff";
this.mnuPowerOff.Size = new System.Drawing.Size(139, 22); this.mnuPowerOff.Size = new System.Drawing.Size(180, 22);
this.mnuPowerOff.Text = "Power Off"; this.mnuPowerOff.Text = "Power Off";
// //
// mnuOptions // mnuOptions
@ -1126,13 +1128,6 @@
this.mnuMemoryTools.Size = new System.Drawing.Size(183, 22); this.mnuMemoryTools.Size = new System.Drawing.Size(183, 22);
this.mnuMemoryTools.Text = "Memory Tools"; this.mnuMemoryTools.Text = "Memory Tools";
// //
// mnuProfiler
//
this.mnuProfiler.Image = global::Mesen.GUI.Properties.Resources.PerfTracker;
this.mnuProfiler.Name = "mnuProfiler";
this.mnuProfiler.Size = new System.Drawing.Size(183, 22);
this.mnuProfiler.Text = "Performance Profiler";
//
// mnuRegisterViewer // mnuRegisterViewer
// //
this.mnuRegisterViewer.Image = global::Mesen.GUI.Properties.Resources.RegisterIcon; this.mnuRegisterViewer.Image = global::Mesen.GUI.Properties.Resources.RegisterIcon;
@ -1140,13 +1135,6 @@
this.mnuRegisterViewer.Size = new System.Drawing.Size(183, 22); this.mnuRegisterViewer.Size = new System.Drawing.Size(183, 22);
this.mnuRegisterViewer.Text = "Register Viewer"; this.mnuRegisterViewer.Text = "Register Viewer";
// //
// mnuScriptWindow
//
this.mnuScriptWindow.Image = global::Mesen.GUI.Properties.Resources.Script;
this.mnuScriptWindow.Name = "mnuScriptWindow";
this.mnuScriptWindow.Size = new System.Drawing.Size(183, 22);
this.mnuScriptWindow.Text = "Script Window";
//
// mnuTraceLogger // mnuTraceLogger
// //
this.mnuTraceLogger.Image = global::Mesen.GUI.Properties.Resources.LogWindow; this.mnuTraceLogger.Image = global::Mesen.GUI.Properties.Resources.LogWindow;
@ -1154,6 +1142,32 @@
this.mnuTraceLogger.Size = new System.Drawing.Size(183, 22); this.mnuTraceLogger.Size = new System.Drawing.Size(183, 22);
this.mnuTraceLogger.Text = "Trace Logger"; this.mnuTraceLogger.Text = "Trace Logger";
// //
// toolStripMenuItem26
//
this.toolStripMenuItem26.Name = "toolStripMenuItem26";
this.toolStripMenuItem26.Size = new System.Drawing.Size(180, 6);
//
// mnuAssembler
//
this.mnuAssembler.Image = global::Mesen.GUI.Properties.Resources.Chip;
this.mnuAssembler.Name = "mnuAssembler";
this.mnuAssembler.Size = new System.Drawing.Size(183, 22);
this.mnuAssembler.Text = "Assembler";
//
// mnuProfiler
//
this.mnuProfiler.Image = global::Mesen.GUI.Properties.Resources.PerfTracker;
this.mnuProfiler.Name = "mnuProfiler";
this.mnuProfiler.Size = new System.Drawing.Size(183, 22);
this.mnuProfiler.Text = "Performance Profiler";
//
// mnuScriptWindow
//
this.mnuScriptWindow.Image = global::Mesen.GUI.Properties.Resources.Script;
this.mnuScriptWindow.Name = "mnuScriptWindow";
this.mnuScriptWindow.Size = new System.Drawing.Size(183, 22);
this.mnuScriptWindow.Text = "Script Window";
//
// toolStripMenuItem12 // toolStripMenuItem12
// //
this.toolStripMenuItem12.Name = "toolStripMenuItem12"; this.toolStripMenuItem12.Name = "toolStripMenuItem12";
@ -1281,17 +1295,12 @@
this.ctrlRecentGames.TabIndex = 1; this.ctrlRecentGames.TabIndex = 1;
this.ctrlRecentGames.Visible = false; this.ctrlRecentGames.Visible = false;
// //
// mnuAssembler // mnuReloadRom
// //
this.mnuAssembler.Image = global::Mesen.GUI.Properties.Resources.Chip; this.mnuReloadRom.Image = global::Mesen.GUI.Properties.Resources.Refresh;
this.mnuAssembler.Name = "mnuAssembler"; this.mnuReloadRom.Name = "mnuReloadRom";
this.mnuAssembler.Size = new System.Drawing.Size(183, 22); this.mnuReloadRom.Size = new System.Drawing.Size(180, 22);
this.mnuAssembler.Text = "Assembler"; this.mnuReloadRom.Text = "Reload ROM";
//
// toolStripMenuItem26
//
this.toolStripMenuItem26.Name = "toolStripMenuItem26";
this.toolStripMenuItem26.Size = new System.Drawing.Size(180, 6);
// //
// frmMain // frmMain
// //
@ -1465,5 +1474,6 @@
private System.Windows.Forms.ToolStripMenuItem mnuProfiler; private System.Windows.Forms.ToolStripMenuItem mnuProfiler;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem26; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem26;
private System.Windows.Forms.ToolStripMenuItem mnuAssembler; private System.Windows.Forms.ToolStripMenuItem mnuAssembler;
private System.Windows.Forms.ToolStripMenuItem mnuReloadRom;
} }
} }

View file

@ -251,6 +251,7 @@ namespace Mesen.GUI.Forms
Func<bool> runningNotClientNotMovie = () => { return EmuRunner.IsRunning() && !NetplayApi.IsConnected() && !RecordApi.MoviePlaying(); }; Func<bool> runningNotClientNotMovie = () => { return EmuRunner.IsRunning() && !NetplayApi.IsConnected() && !RecordApi.MoviePlaying(); };
_shortcuts.BindShortcut(mnuOpen, EmulatorShortcut.OpenFile); _shortcuts.BindShortcut(mnuOpen, EmulatorShortcut.OpenFile);
_shortcuts.BindShortcut(mnuReloadRom, EmulatorShortcut.ReloadRom, runningNotClientNotMovie);
_shortcuts.BindShortcut(mnuExit, EmulatorShortcut.Exit); _shortcuts.BindShortcut(mnuExit, EmulatorShortcut.Exit);
_shortcuts.BindShortcut(mnuIncreaseSpeed, EmulatorShortcut.IncreaseSpeed, notClient); _shortcuts.BindShortcut(mnuIncreaseSpeed, EmulatorShortcut.IncreaseSpeed, notClient);
_shortcuts.BindShortcut(mnuDecreaseSpeed, EmulatorShortcut.DecreaseSpeed, notClient); _shortcuts.BindShortcut(mnuDecreaseSpeed, EmulatorShortcut.DecreaseSpeed, notClient);

View file

@ -40,6 +40,7 @@ namespace Mesen.GUI
[DllImport(DllPath)] public static extern void Reset(); [DllImport(DllPath)] public static extern void Reset();
[DllImport(DllPath)] public static extern void PowerCycle(); [DllImport(DllPath)] public static extern void PowerCycle();
[DllImport(DllPath)] public static extern void ReloadRom();
[DllImport(DllPath)] public static extern void Pause(); [DllImport(DllPath)] public static extern void Pause();
[DllImport(DllPath)] public static extern void Resume(); [DllImport(DllPath)] public static extern void Resume();