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()
{
shared_ptr<Debugger> debugger = _debugger;
if(debugger) {
debugger->Run();
}
Lock();
_lockCounter++;
_runLock.Acquire();
_dmaController->Reset();
_internalRegisters->Reset();
@ -334,16 +332,18 @@ void Console::Reset()
_spcHud.reset();
}
_memoryManager->IncMasterClockStartup();
Unlock();
if(debugger) {
//Debugger was suspended in SystemActionManager::Reset(), resume debugger here
debugger->SuspendDebugger(true);
}
_memoryManager->IncMasterClockStartup();
_runLock.Release();
_lockCounter--;
}
void Console::PowerCycle()
void Console::ReloadRom(bool forPowerCycle)
{
shared_ptr<BaseCartridge> cart = _cart;
if(cart) {
@ -354,14 +354,19 @@ void Console::PowerCycle()
RomInfo info = cart->GetRomInfo();
Lock();
LoadRom(info.RomFile, info.PatchFile, false);
LoadRom(info.RomFile, info.PatchFile, false, forPowerCycle);
_memoryManager->IncMasterClockStartup();
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) {
//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;
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(stopRom) {
KeyManager::UpdateDevices();
@ -422,13 +427,15 @@ bool Console::LoadRom(VirtualFile romFile, VirtualFile patchFile, bool stopRom)
UpdateRegion();
_notificationManager->SendNotification(ConsoleNotificationType::GameLoaded);
_notificationManager->SendNotification(ConsoleNotificationType::GameLoaded, (void*)forPowerCycle);
_paused = false;
string modelName = _region == ConsoleRegion::Pal ? "PAL" : "NTSC";
string messageTitle = MessageManager::Localize("GameLoaded") + " (" + modelName + ")";
MessageManager::DisplayMessage(messageTitle, FolderUtilities::GetFilename(GetRomInfo().RomFile.GetFileName(), false));
if(!forPowerCycle) {
string modelName = _region == ConsoleRegion::Pal ? "PAL" : "NTSC";
string messageTitle = MessageManager::Localize("GameLoaded") + " (" + modelName + ")";
MessageManager::DisplayMessage(messageTitle, FolderUtilities::GetFilename(GetRomInfo().RomFile.GetFileName(), false));
}
if(stopRom) {
#ifndef LIBRETRO

View file

@ -113,6 +113,7 @@ public:
void ProcessEndOfFrame();
void Reset();
void ReloadRom(bool forPowerCycle);
void PowerCycle();
void PauseOnNextFrame();
@ -121,7 +122,7 @@ public:
void Resume();
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();
uint32_t GetMasterClockRate();
ConsoleRegion GetRegion();

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -39,6 +39,9 @@
this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripSeparator();
this.importExportToolStripMenuItem = 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.codeDataLoggerToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuResetCdlLog = new System.Windows.Forms.ToolStripMenuItem();
@ -140,9 +143,8 @@
this.grpCallstack = new System.Windows.Forms.GroupBox();
this.ctrlCallstack = new Mesen.GUI.Debugger.Controls.ctrlCallstack();
this.tsToolbar = new Mesen.GUI.Controls.ctrlMesenToolStrip();
this.toolStripMenuItem15 = new System.Windows.Forms.ToolStripSeparator();
this.mnuImportLabels = new System.Windows.Forms.ToolStripMenuItem();
this.mnuExportLabels = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem16 = new System.Windows.Forms.ToolStripSeparator();
this.mnuReloadRom = new System.Windows.Forms.ToolStripMenuItem();
this.ctrlMesenMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.ctrlSplitContainer)).BeginInit();
this.ctrlSplitContainer.Panel1.SuspendLayout();
@ -180,6 +182,8 @@
// fileToolStripMenuItem
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuReloadRom,
this.toolStripMenuItem16,
this.mnuSaveRomAs,
this.mnuSaveAsIps,
this.toolStripMenuItem14,
@ -231,6 +235,27 @@
this.mnuDbgIntegrationSettings.Text = "CC65/CA65 Integration Settings";
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
//
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
@ -1036,26 +1061,17 @@
this.tsToolbar.TabIndex = 3;
this.tsToolbar.Text = "ctrlMesenToolStrip1";
//
// toolStripMenuItem15
// toolStripMenuItem16
//
this.toolStripMenuItem15.Name = "toolStripMenuItem15";
this.toolStripMenuItem15.Size = new System.Drawing.Size(238, 6);
this.toolStripMenuItem16.Name = "toolStripMenuItem16";
this.toolStripMenuItem16.Size = new System.Drawing.Size(198, 6);
//
// mnuImportLabels
// mnuReloadRom
//
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);
this.mnuReloadRom.Image = global::Mesen.GUI.Properties.Resources.Refresh;
this.mnuReloadRom.Name = "mnuReloadRom";
this.mnuReloadRom.Size = new System.Drawing.Size(201, 22);
this.mnuReloadRom.Text = "Reload ROM";
//
// frmDebugger
//
@ -1203,5 +1219,7 @@
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem15;
private System.Windows.Forms.ToolStripMenuItem mnuImportLabels;
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.IO;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesen.GUI.Debugger
@ -145,6 +146,7 @@ namespace Mesen.GUI.Debugger
private void InitShortcuts()
{
mnuReloadRom.InitShortcut(this, nameof(DebuggerShortcutsConfig.ReloadRom));
mnuReset.InitShortcut(this, nameof(DebuggerShortcutsConfig.Reset));
mnuPowerCycle.InitShortcut(this, nameof(DebuggerShortcutsConfig.PowerCycle));
@ -165,9 +167,6 @@ namespace Mesen.GUI.Debugger
mnuToggleBreakpoint.InitShortcut(this, nameof(DebuggerShortcutsConfig.CodeWindow_ToggleBreakpoint));
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));
mnuGoToAddress.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoTo));
mnuGoToProgramCounter.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToProgramCounter));
@ -200,6 +199,7 @@ namespace Mesen.GUI.Debugger
mnuContinue.Click += (s, e) => { DebugApi.ResumeExecution(); };
mnuBreak.Click += (s, e) => { DebugApi.Step(_cpuType, 1, StepType.Step); };
mnuReloadRom.Click += (s, e) => { Task.Run(() => { EmuApi.ReloadRom(); }); };
mnuReset.Click += (s, e) => { EmuApi.Reset(); };
mnuPowerCycle.Click += (s, e) => { EmuApi.PowerCycle(); };
@ -445,7 +445,10 @@ namespace Mesen.GUI.Debugger
DebugState state = DebugApi.GetState();
this.BeginInvoke((MethodInvoker)(() => {
DebugWorkspaceManager.ImportDbgFile();
bool isPowerCycle = e.Parameter.ToInt32() != 0;
if(!isPowerCycle) {
DebugWorkspaceManager.ImportDbgFile();
}
LabelManager.RefreshLabels();
DebugApi.RefreshDisassembly(_cpuType);
UpdateDebugger(state, null);

View file

@ -4,6 +4,7 @@
<Form ID="frmMain" Title="Mesen-S">
<Control ID="mnuFile">File</Control>
<Control ID="mnuOpen">Open</Control>
<Control ID="mnuReloadRom">Reload ROM</Control>
<Control ID="mnuSaveState">Save State</Control>
<Control ID="mnuLoadState">Load State</Control>
<Control ID="mnuLoadLastSession">Load Last Session</Control>
@ -767,6 +768,7 @@
<Message ID="EmulatorShortcutMappings_Pause">Pause</Message>
<Message ID="EmulatorShortcutMappings_Reset">Reset</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_Exit">Exit</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.Reset: EmuApi.Reset(); 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.Exit: frmMain.Instance.Close(); restoreFullscreen = false; break;

View file

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

View file

@ -151,10 +151,12 @@
this.mnuDebugger = new System.Windows.Forms.ToolStripMenuItem();
this.mnuEventViewer = 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.mnuScriptWindow = 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.mnuTilemapViewer = new System.Windows.Forms.ToolStripMenuItem();
this.mnuTileViewer = new System.Windows.Forms.ToolStripMenuItem();
@ -172,8 +174,7 @@
this.mnuAbout = new System.Windows.Forms.ToolStripMenuItem();
this.pnlRenderer = new System.Windows.Forms.Panel();
this.ctrlRecentGames = new Mesen.GUI.Controls.ctrlRecentGames();
this.mnuAssembler = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem26 = new System.Windows.Forms.ToolStripSeparator();
this.mnuReloadRom = new System.Windows.Forms.ToolStripMenuItem();
this.mnuMain.SuspendLayout();
this.pnlRenderer.SuspendLayout();
this.SuspendLayout();
@ -204,6 +205,7 @@
//
this.mnuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuOpen,
this.mnuReloadRom,
this.toolStripMenuItem2,
this.mnuSaveState,
this.mnuLoadState,
@ -222,49 +224,49 @@
//
this.mnuOpen.Image = global::Mesen.GUI.Properties.Resources.Folder;
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";
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(133, 6);
this.toolStripMenuItem2.Size = new System.Drawing.Size(177, 6);
//
// 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.DropDownOpening += new System.EventHandler(this.mnuSaveState_DropDownOpening);
//
// 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.DropDownOpening += new System.EventHandler(this.mnuLoadState_DropDownOpening);
//
// toolStripMenuItem10
//
this.toolStripMenuItem10.Name = "toolStripMenuItem10";
this.toolStripMenuItem10.Size = new System.Drawing.Size(133, 6);
this.toolStripMenuItem10.Size = new System.Drawing.Size(177, 6);
//
// 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";
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(133, 6);
this.toolStripMenuItem6.Size = new System.Drawing.Size(177, 6);
//
// mnuExit
//
this.mnuExit.Image = global::Mesen.GUI.Properties.Resources.Exit;
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";
//
// mnuGame
@ -286,7 +288,7 @@
this.mnuPause.Enabled = false;
this.mnuPause.Image = global::Mesen.GUI.Properties.Resources.MediaPause;
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";
//
// mnuReset
@ -294,7 +296,7 @@
this.mnuReset.Enabled = false;
this.mnuReset.Image = global::Mesen.GUI.Properties.Resources.Refresh;
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";
//
// mnuPowerCycle
@ -302,19 +304,19 @@
this.mnuPowerCycle.Enabled = false;
this.mnuPowerCycle.Image = global::Mesen.GUI.Properties.Resources.PowerCycle;
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";
//
// toolStripMenuItem24
//
this.toolStripMenuItem24.Name = "toolStripMenuItem24";
this.toolStripMenuItem24.Size = new System.Drawing.Size(136, 6);
this.toolStripMenuItem24.Size = new System.Drawing.Size(177, 6);
//
// mnuPowerOff
//
this.mnuPowerOff.Image = global::Mesen.GUI.Properties.Resources.MediaStop;
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";
//
// mnuOptions
@ -1126,13 +1128,6 @@
this.mnuMemoryTools.Size = new System.Drawing.Size(183, 22);
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
//
this.mnuRegisterViewer.Image = global::Mesen.GUI.Properties.Resources.RegisterIcon;
@ -1140,13 +1135,6 @@
this.mnuRegisterViewer.Size = new System.Drawing.Size(183, 22);
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
//
this.mnuTraceLogger.Image = global::Mesen.GUI.Properties.Resources.LogWindow;
@ -1154,6 +1142,32 @@
this.mnuTraceLogger.Size = new System.Drawing.Size(183, 22);
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
//
this.toolStripMenuItem12.Name = "toolStripMenuItem12";
@ -1281,17 +1295,12 @@
this.ctrlRecentGames.TabIndex = 1;
this.ctrlRecentGames.Visible = false;
//
// mnuAssembler
// mnuReloadRom
//
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";
//
// toolStripMenuItem26
//
this.toolStripMenuItem26.Name = "toolStripMenuItem26";
this.toolStripMenuItem26.Size = new System.Drawing.Size(180, 6);
this.mnuReloadRom.Image = global::Mesen.GUI.Properties.Resources.Refresh;
this.mnuReloadRom.Name = "mnuReloadRom";
this.mnuReloadRom.Size = new System.Drawing.Size(180, 22);
this.mnuReloadRom.Text = "Reload ROM";
//
// frmMain
//
@ -1465,5 +1474,6 @@
private System.Windows.Forms.ToolStripMenuItem mnuProfiler;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem26;
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(); };
_shortcuts.BindShortcut(mnuOpen, EmulatorShortcut.OpenFile);
_shortcuts.BindShortcut(mnuReloadRom, EmulatorShortcut.ReloadRom, runningNotClientNotMovie);
_shortcuts.BindShortcut(mnuExit, EmulatorShortcut.Exit);
_shortcuts.BindShortcut(mnuIncreaseSpeed, EmulatorShortcut.IncreaseSpeed, 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 PowerCycle();
[DllImport(DllPath)] public static extern void ReloadRom();
[DllImport(DllPath)] public static extern void Pause();
[DllImport(DllPath)] public static extern void Resume();