2015-07-01 23:17:14 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Text;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
using Mesen.GUI.Config;
|
2016-01-10 19:56:40 -05:00
|
|
|
|
using Mesen.GUI.Forms;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Debugger
|
|
|
|
|
{
|
2016-01-10 19:56:40 -05:00
|
|
|
|
public partial class frmDebugger : BaseForm
|
2015-07-01 23:17:14 -04:00
|
|
|
|
{
|
2015-08-08 22:36:39 -04:00
|
|
|
|
private List<Form> _childForms = new List<Form>();
|
2015-08-05 20:40:10 -04:00
|
|
|
|
private InteropEmu.NotificationListener _notifListener;
|
|
|
|
|
private ctrlDebuggerCode _lastCodeWindow;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
|
|
|
|
|
public frmDebugger()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2015-08-02 19:27:02 -04:00
|
|
|
|
|
2016-06-04 15:38:48 -04:00
|
|
|
|
if(!this.DesignMode) {
|
|
|
|
|
this.mnuSplitView.Checked = ConfigManager.Config.DebugInfo.SplitView;
|
2016-06-05 10:26:05 -04:00
|
|
|
|
this.mnuPpuPartialDraw.Checked = ConfigManager.Config.DebugInfo.PpuPartialDraw;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
|
2016-06-04 15:38:48 -04:00
|
|
|
|
_lastCodeWindow = ctrlDebuggerCode;
|
2016-01-10 00:33:33 -05:00
|
|
|
|
|
2016-06-04 15:38:48 -04:00
|
|
|
|
this.ctrlDebuggerCode.SetConfig(ConfigManager.Config.DebugInfo.LeftView);
|
|
|
|
|
this.ctrlDebuggerCodeSplit.SetConfig(ConfigManager.Config.DebugInfo.RightView);
|
2016-06-04 14:43:13 -04:00
|
|
|
|
|
2016-06-04 15:38:48 -04:00
|
|
|
|
BreakpointManager.Breakpoints.Clear();
|
|
|
|
|
BreakpointManager.Breakpoints.AddRange(ConfigManager.Config.DebugInfo.Breakpoints);
|
|
|
|
|
BreakpointManager.BreakpointsChanged += BreakpointManager_BreakpointsChanged;
|
|
|
|
|
this.ctrlBreakpoints.RefreshList();
|
|
|
|
|
RefreshBreakpoints();
|
2016-06-05 11:51:46 -04:00
|
|
|
|
|
|
|
|
|
this.toolTip.SetToolTip(this.picWatchHelp,
|
|
|
|
|
"Most expressions/operators are accepted (C++ syntax)." + Environment.NewLine +
|
|
|
|
|
"Note: Use the $ prefix to denote hexadecimal values." + Environment.NewLine + Environment.NewLine +
|
|
|
|
|
"A/X/Y/PS/SP: Value of registers" + Environment.NewLine +
|
|
|
|
|
"Irq/Nmi: True if the Irq/Nmi flags are set" + Environment.NewLine +
|
|
|
|
|
"Cycle/Scanline: Current cycle (0-340)/scanline(-1 to 260) of the PPU" + Environment.NewLine +
|
|
|
|
|
"Value: Current value being read/written from/to memory" + Environment.NewLine +
|
|
|
|
|
"[<address>]: Value at address (CPU)" + Environment.NewLine + Environment.NewLine +
|
|
|
|
|
|
|
|
|
|
"Examples:" + Environment.NewLine +
|
|
|
|
|
"a == 10 || x == $23" + Environment.NewLine +
|
|
|
|
|
"scanline == 10 && (cycle >= 55 && cycle <= 100)" + Environment.NewLine +
|
|
|
|
|
"x == [$150] || y == [10]" + Environment.NewLine +
|
|
|
|
|
"[[$15] + y] -> Reads the value at address $15, adds Y to it and reads the value at the resulting address."
|
|
|
|
|
);
|
2016-06-04 15:38:48 -04:00
|
|
|
|
}
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnLoad(e);
|
|
|
|
|
|
|
|
|
|
_notifListener = new InteropEmu.NotificationListener();
|
|
|
|
|
_notifListener.OnNotification += _notifListener_OnNotification;
|
|
|
|
|
|
|
|
|
|
InteropEmu.DebugInitialize();
|
2015-08-02 22:19:12 -04:00
|
|
|
|
|
|
|
|
|
//Pause a few frames later to give the debugger a chance to disassemble some code
|
2016-01-26 16:47:21 -05:00
|
|
|
|
InteropEmu.DebugStep(30000);
|
2015-08-17 19:32:10 -04:00
|
|
|
|
|
|
|
|
|
UpdateCdlRatios();
|
|
|
|
|
tmrCdlRatios.Start();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UpdateCdlRatios()
|
|
|
|
|
{
|
|
|
|
|
CdlRatios ratios = new CdlRatios();
|
|
|
|
|
InteropEmu.DebugGetCdlRatios(ref ratios);
|
|
|
|
|
|
|
|
|
|
lblPrgAnalysisResult.Text = string.Format("{0:0.00}% (Code: {1:0.00}%, Data: {2:0.00}%, Unknown: {3:0.00}%)", ratios.PrgRatio * 100, ratios.CodeRatio * 100, ratios.DataRatio * 100, (1 - ratios.PrgRatio) * 100);
|
|
|
|
|
if(ratios.ChrRatio >= 0) {
|
|
|
|
|
lblChrAnalysisResult.Text = string.Format("{0:0.00}% (Drawn: {1:0.00}%, Read: {2:0.00}%, Unknown: {3:0.00}%)", ratios.ChrRatio * 100, ratios.ChrDrawnRatio * 100, ratios.ChrReadRatio * 100, (1 - ratios.ChrRatio) * 100);
|
|
|
|
|
} else {
|
|
|
|
|
lblChrAnalysisResult.Text = "N/A (CHR RAM)";
|
|
|
|
|
}
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-08 22:36:39 -04:00
|
|
|
|
private void _notifListener_OnNotification(InteropEmu.NotificationEventArgs e)
|
2015-07-01 23:17:14 -04:00
|
|
|
|
{
|
2016-06-04 08:55:52 -04:00
|
|
|
|
switch(e.NotificationType) {
|
|
|
|
|
case InteropEmu.ConsoleNotificationType.CodeBreak:
|
|
|
|
|
this.BeginInvoke((MethodInvoker)(() => UpdateDebugger()));
|
|
|
|
|
BreakpointManager.SetBreakpoints();
|
2016-06-05 10:26:05 -04:00
|
|
|
|
InteropEmu.DebugSetFlags(mnuPpuPartialDraw.Checked ? DebuggerFlags.PpuPartialDraw : DebuggerFlags.None);
|
2016-06-04 08:55:52 -04:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case InteropEmu.ConsoleNotificationType.GameReset:
|
|
|
|
|
case InteropEmu.ConsoleNotificationType.GameLoaded:
|
|
|
|
|
BreakpointManager.SetBreakpoints();
|
|
|
|
|
InteropEmu.DebugStep(1);
|
|
|
|
|
break;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool UpdateSplitView()
|
|
|
|
|
{
|
|
|
|
|
if(mnuSplitView.Checked) {
|
|
|
|
|
tlpTop.ColumnStyles[1].SizeType = SizeType.Percent;
|
2015-08-04 19:50:57 -04:00
|
|
|
|
tlpTop.ColumnStyles[0].Width = 50f;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
tlpTop.ColumnStyles[1].Width = 50f;
|
|
|
|
|
this.MinimumSize = new Size(1250, 650);
|
|
|
|
|
} else {
|
|
|
|
|
tlpTop.ColumnStyles[1].SizeType = SizeType.Absolute;
|
|
|
|
|
tlpTop.ColumnStyles[1].Width = 0f;
|
|
|
|
|
this.MinimumSize = new Size(1000, 650);
|
|
|
|
|
}
|
2015-08-03 21:53:46 -04:00
|
|
|
|
ctrlDebuggerCodeSplit.Visible = mnuSplitView.Checked;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
return mnuSplitView.Checked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UpdateDebugger()
|
|
|
|
|
{
|
|
|
|
|
if(InteropEmu.DebugIsCodeChanged()) {
|
|
|
|
|
string code = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(InteropEmu.DebugGetCode());
|
|
|
|
|
ctrlDebuggerCode.Code = code;
|
|
|
|
|
ctrlDebuggerCodeSplit.Code = code;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DebugState state = new DebugState();
|
|
|
|
|
InteropEmu.DebugGetState(ref state);
|
|
|
|
|
|
|
|
|
|
if(UpdateSplitView()) {
|
|
|
|
|
ctrlDebuggerCodeSplit.UpdateCode(true);
|
2015-08-02 19:27:02 -04:00
|
|
|
|
} else {
|
|
|
|
|
_lastCodeWindow = ctrlDebuggerCode;
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-02 19:27:02 -04:00
|
|
|
|
ctrlDebuggerCode.SelectActiveAddress(state.CPU.DebugPC);
|
|
|
|
|
ctrlDebuggerCodeSplit.SetActiveAddress(state.CPU.DebugPC);
|
|
|
|
|
RefreshBreakpoints();
|
|
|
|
|
|
2015-07-01 23:17:14 -04:00
|
|
|
|
ctrlConsoleStatus.UpdateStatus(ref state);
|
|
|
|
|
ctrlWatch.UpdateWatch();
|
2015-08-09 14:47:27 -04:00
|
|
|
|
ctrlCallstack.UpdateCallstack();
|
2015-08-21 22:42:44 -04:00
|
|
|
|
|
|
|
|
|
this.BringToFront();
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-02 19:27:02 -04:00
|
|
|
|
private void ClearActiveStatement()
|
|
|
|
|
{
|
|
|
|
|
ctrlDebuggerCode.ClearActiveAddress();
|
2015-08-09 20:47:50 -04:00
|
|
|
|
ctrlDebuggerCodeSplit.ClearActiveAddress();
|
2015-08-02 19:27:02 -04:00
|
|
|
|
RefreshBreakpoints();
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-09 13:15:43 -05:00
|
|
|
|
private void ToggleBreakpoint(bool toggleEnabled)
|
2015-07-01 23:17:14 -04:00
|
|
|
|
{
|
2016-01-10 00:33:33 -05:00
|
|
|
|
BreakpointManager.ToggleBreakpoint(_lastCodeWindow.GetCurrentLine(), toggleEnabled);
|
2015-08-02 19:27:02 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RefreshBreakpoints()
|
|
|
|
|
{
|
2016-06-04 14:43:13 -04:00
|
|
|
|
ConfigManager.Config.DebugInfo.Breakpoints = new List<Breakpoint>(BreakpointManager.Breakpoints);
|
|
|
|
|
ConfigManager.ApplyChanges();
|
|
|
|
|
|
2016-01-10 00:33:33 -05:00
|
|
|
|
ctrlDebuggerCodeSplit.HighlightBreakpoints();
|
|
|
|
|
ctrlDebuggerCode.HighlightBreakpoints();
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-08 22:36:39 -04:00
|
|
|
|
private void OpenChildForm(Form frm)
|
|
|
|
|
{
|
|
|
|
|
this._childForms.Add(frm);
|
|
|
|
|
frm.FormClosed += (obj, args) => {
|
|
|
|
|
this._childForms.Remove((Form)obj);
|
|
|
|
|
};
|
|
|
|
|
frm.Show();
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-01 23:17:14 -04:00
|
|
|
|
private void mnuContinue_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-08-02 19:27:02 -04:00
|
|
|
|
ClearActiveStatement();
|
2015-07-01 23:17:14 -04:00
|
|
|
|
InteropEmu.DebugRun();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void frmDebugger_FormClosed(object sender, FormClosedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugRelease();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuToggleBreakpoint_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2016-01-09 13:15:43 -05:00
|
|
|
|
ToggleBreakpoint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuDisableEnableBreakpoint_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ToggleBreakpoint(true);
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuBreak_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugStep(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuStepInto_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugStep(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuStepOut_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugStepOut();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuStepOver_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugStepOver();
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-05 10:29:54 -04:00
|
|
|
|
|
|
|
|
|
private void mnuRunPpuCycle_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugPpuStep(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuRunScanline_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugPpuStep(341);
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-01 23:17:14 -04:00
|
|
|
|
private void mnuRunOneFrame_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2016-06-05 10:29:54 -04:00
|
|
|
|
InteropEmu.DebugPpuStep(89341);
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
2015-08-17 21:59:22 -04:00
|
|
|
|
private void ctrlDebuggerCode_OnWatchAdded(AddressEventArgs args)
|
2015-07-01 23:17:14 -04:00
|
|
|
|
{
|
|
|
|
|
this.ctrlWatch.AddWatch(args.Address);
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-17 21:59:22 -04:00
|
|
|
|
private void ctrlDebuggerCode_OnSetNextStatement(AddressEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
UInt16 addr = (UInt16)args.Address;
|
|
|
|
|
InteropEmu.DebugSetNextStatement(addr);
|
|
|
|
|
this.UpdateDebugger();
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-01 23:17:14 -04:00
|
|
|
|
private void mnuFind_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-08-03 21:53:46 -04:00
|
|
|
|
_lastCodeWindow.OpenSearchBox();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuFindNext_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.FindNext();
|
|
|
|
|
}
|
2015-07-01 23:17:14 -04:00
|
|
|
|
|
2015-08-03 21:53:46 -04:00
|
|
|
|
private void mnuFindPrev_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.FindPrevious();
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuSplitView_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2016-06-04 14:43:13 -04:00
|
|
|
|
ConfigManager.Config.DebugInfo.SplitView = this.mnuSplitView.Checked;
|
|
|
|
|
ConfigManager.ApplyChanges();
|
|
|
|
|
|
2015-07-01 23:17:14 -04:00
|
|
|
|
UpdateDebugger();
|
|
|
|
|
}
|
2015-08-02 19:27:02 -04:00
|
|
|
|
|
|
|
|
|
private void mnuMemoryViewer_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-08-08 22:36:39 -04:00
|
|
|
|
OpenChildForm(new frmMemoryViewer());
|
2015-08-02 19:27:02 -04:00
|
|
|
|
}
|
|
|
|
|
|
2016-01-10 00:33:33 -05:00
|
|
|
|
private void BreakpointManager_BreakpointsChanged(object sender, EventArgs e)
|
2015-08-02 19:27:02 -04:00
|
|
|
|
{
|
|
|
|
|
RefreshBreakpoints();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ctrlDebuggerCode_Enter(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow = ctrlDebuggerCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ctrlDebuggerCodeSplit_Enter(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow = ctrlDebuggerCodeSplit;
|
|
|
|
|
}
|
2015-08-02 22:19:12 -04:00
|
|
|
|
|
2016-01-10 09:21:07 -05:00
|
|
|
|
private void mnuGoToAddress_Click(object sender, EventArgs e)
|
2015-08-02 22:19:12 -04:00
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.GoToAddress();
|
|
|
|
|
}
|
2015-08-04 19:50:57 -04:00
|
|
|
|
|
2016-01-10 09:21:07 -05:00
|
|
|
|
private void mnuGoToIrqHandler_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
int address = (InteropEmu.DebugGetMemoryValue(0xFFFF) << 8) | InteropEmu.DebugGetMemoryValue(0xFFFE);
|
|
|
|
|
_lastCodeWindow.ScrollToLineNumber(address);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuGoToNmiHandler_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2016-01-11 18:15:36 -05:00
|
|
|
|
int address = (InteropEmu.DebugGetMemoryValue(0xFFFB) << 8) | InteropEmu.DebugGetMemoryValue(0xFFFA);
|
2016-01-10 09:21:07 -05:00
|
|
|
|
_lastCodeWindow.ScrollToLineNumber(address);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuGoToResetHandler_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2016-01-11 18:15:36 -05:00
|
|
|
|
int address = (InteropEmu.DebugGetMemoryValue(0xFFFD) << 8) | InteropEmu.DebugGetMemoryValue(0xFFFC);
|
2016-01-10 09:21:07 -05:00
|
|
|
|
_lastCodeWindow.ScrollToLineNumber(address);
|
|
|
|
|
}
|
|
|
|
|
|
2015-08-04 19:50:57 -04:00
|
|
|
|
private void mnuIncreaseFontSize_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.FontSize++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuDecreaseFontSize_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.FontSize--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuResetFontSize_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.FontSize = 13;
|
|
|
|
|
}
|
2015-08-05 20:40:10 -04:00
|
|
|
|
|
|
|
|
|
private void mnuClose_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnFormClosed(FormClosedEventArgs e)
|
|
|
|
|
{
|
2015-08-08 22:36:39 -04:00
|
|
|
|
foreach(Form frm in this._childForms.ToArray()) {
|
2015-08-05 20:40:10 -04:00
|
|
|
|
frm.Close();
|
|
|
|
|
}
|
|
|
|
|
base.OnFormClosed(e);
|
|
|
|
|
}
|
2015-08-08 22:36:39 -04:00
|
|
|
|
|
|
|
|
|
private void mnuNametableViewer_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
OpenChildForm(new frmPpuViewer());
|
|
|
|
|
}
|
2015-08-09 14:47:27 -04:00
|
|
|
|
|
|
|
|
|
private void ctrlCallstack_FunctionSelected(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.ScrollToLineNumber((int)sender);
|
|
|
|
|
}
|
2015-08-17 19:32:10 -04:00
|
|
|
|
|
|
|
|
|
private void tmrCdlRatios_Tick(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
this.UpdateCdlRatios();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuLoadCdlFile_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
OpenFileDialog ofd = new OpenFileDialog();
|
|
|
|
|
ofd.Filter = "CDL files (*.cdl)|*.cdl";
|
|
|
|
|
if(ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
|
|
|
|
|
if(!InteropEmu.DebugLoadCdlFile(ofd.FileName)) {
|
|
|
|
|
MessageBox.Show("Could not load CDL file. The file selected file is invalid.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuSaveAsCdlFile_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveFileDialog sfd = new SaveFileDialog();
|
|
|
|
|
sfd.Filter = "CDL files (*.cdl)|*.cdl";
|
|
|
|
|
sfd.AddExtension = true;
|
|
|
|
|
if(sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) {
|
|
|
|
|
if(!InteropEmu.DebugSaveCdlFile(sfd.FileName)) {
|
|
|
|
|
MessageBox.Show("Error while trying to save CDL file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuResetCdlLog_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.DebugResetCdlLog();
|
|
|
|
|
}
|
2016-01-10 00:33:33 -05:00
|
|
|
|
|
|
|
|
|
private void ctrlBreakpoints_BreakpointNavigation(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
_lastCodeWindow.ScrollToLineNumber((int)((Breakpoint)sender).Address);
|
|
|
|
|
}
|
2016-01-10 19:56:40 -05:00
|
|
|
|
|
|
|
|
|
private void mnuTraceLogger_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
new frmTraceLogger().Show();
|
|
|
|
|
}
|
2016-06-04 15:38:48 -04:00
|
|
|
|
|
2016-06-05 10:26:05 -04:00
|
|
|
|
private void mnuPpuPartialDraw_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
ConfigManager.Config.DebugInfo.PpuPartialDraw = mnuPpuPartialDraw.Checked;
|
|
|
|
|
ConfigManager.ApplyChanges();
|
|
|
|
|
}
|
2015-07-01 23:17:14 -04:00
|
|
|
|
}
|
|
|
|
|
}
|