2019-02-27 19:49:26 -05:00
|
|
|
|
using Mesen.GUI.Config;
|
2019-04-07 12:25:14 -04:00
|
|
|
|
using Mesen.GUI.Debugger.Code;
|
2019-02-27 19:49:26 -05:00
|
|
|
|
using Mesen.GUI.Forms;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Debugger
|
|
|
|
|
{
|
|
|
|
|
public partial class frmDebugger : BaseForm
|
|
|
|
|
{
|
2019-03-31 09:11:56 -04:00
|
|
|
|
private EntityBinder _entityBinder = new EntityBinder();
|
2019-02-27 19:49:26 -05:00
|
|
|
|
private NotificationListener _notifListener;
|
2019-04-07 12:25:14 -04:00
|
|
|
|
private CpuType _cpuType;
|
2019-02-27 19:49:26 -05:00
|
|
|
|
|
2019-04-07 12:25:14 -04:00
|
|
|
|
public CpuType CpuType { get { return _cpuType; } }
|
|
|
|
|
|
|
|
|
|
public frmDebugger(CpuType cpuType)
|
2019-02-27 19:49:26 -05:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2019-04-07 12:25:14 -04:00
|
|
|
|
|
|
|
|
|
_cpuType = cpuType;
|
|
|
|
|
|
2019-04-28 22:19:52 -04:00
|
|
|
|
ctrlLabelList.CpuType = cpuType;
|
|
|
|
|
|
2019-02-27 19:49:26 -05:00
|
|
|
|
if(DesignMode) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnLoad(e);
|
|
|
|
|
|
2019-04-07 12:25:14 -04:00
|
|
|
|
this.Text = _cpuType == CpuType.Cpu ? "CPU Debugger" : "SPC Debugger";
|
2019-02-27 19:49:26 -05:00
|
|
|
|
_notifListener = new NotificationListener();
|
|
|
|
|
_notifListener.OnNotification += OnNotificationReceived;
|
|
|
|
|
|
2019-04-07 12:25:14 -04:00
|
|
|
|
switch(_cpuType) {
|
|
|
|
|
case CpuType.Cpu: ctrlDisassemblyView.Initialize(new CpuDisassemblyManager(), new CpuLineStyleProvider()); break;
|
|
|
|
|
case CpuType.Spc: ctrlDisassemblyView.Initialize(new SpcDisassemblyManager(), new SpcLineStyleProvider()); break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctrlBreakpoints.CpuType = _cpuType;
|
2019-04-07 14:38:22 -04:00
|
|
|
|
ctrlWatch.CpuType = _cpuType;
|
|
|
|
|
|
2019-02-27 19:49:26 -05:00
|
|
|
|
InitShortcuts();
|
2019-03-23 22:13:37 -04:00
|
|
|
|
InitToolbar();
|
2019-03-31 09:22:01 -04:00
|
|
|
|
LoadConfig();
|
2019-03-31 09:11:56 -04:00
|
|
|
|
|
2019-03-30 23:44:45 -04:00
|
|
|
|
toolTip.SetToolTip(picWatchHelp, ctrlWatch.GetTooltipText());
|
|
|
|
|
|
2019-04-21 20:37:05 -04:00
|
|
|
|
BreakpointManager.AddCpuType(_cpuType);
|
2019-04-07 12:25:14 -04:00
|
|
|
|
DebugApi.Step(10000, StepType.CpuStep);
|
2019-02-27 19:49:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnClosing(CancelEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnClosing(e);
|
|
|
|
|
|
2019-03-31 09:11:56 -04:00
|
|
|
|
DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger;
|
|
|
|
|
cfg.WindowSize = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Size : this.Size;
|
|
|
|
|
cfg.WindowLocation = this.WindowState != FormWindowState.Normal ? this.RestoreBounds.Location : this.Location;
|
2019-03-31 09:22:01 -04:00
|
|
|
|
_entityBinder.UpdateObject();
|
2019-03-31 09:11:56 -04:00
|
|
|
|
ConfigManager.ApplyChanges();
|
|
|
|
|
|
2019-04-21 20:37:05 -04:00
|
|
|
|
BreakpointManager.RemoveCpuType(_cpuType);
|
|
|
|
|
|
2019-02-27 19:49:26 -05:00
|
|
|
|
if(this._notifListener != null) {
|
|
|
|
|
this._notifListener.Dispose();
|
|
|
|
|
this._notifListener = null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-30 21:47:30 -04:00
|
|
|
|
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
|
|
|
|
|
{
|
|
|
|
|
if(keyData == ConfigManager.Config.Debug.Shortcuts.ToggleBreakContinue) {
|
|
|
|
|
if(EmuApi.IsPaused()) {
|
|
|
|
|
DebugApi.ResumeExecution();
|
|
|
|
|
} else {
|
2019-04-07 12:25:14 -04:00
|
|
|
|
DebugApi.Step(1, _cpuType == CpuType.Cpu ? StepType.CpuStep : StepType.SpcStep);
|
2019-03-30 21:47:30 -04:00
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return base.ProcessCmdKey(ref msg, keyData);
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-27 19:49:26 -05:00
|
|
|
|
private void InitShortcuts()
|
|
|
|
|
{
|
|
|
|
|
mnuReset.InitShortcut(this, nameof(DebuggerShortcutsConfig.Reset));
|
|
|
|
|
mnuPowerCycle.InitShortcut(this, nameof(DebuggerShortcutsConfig.PowerCycle));
|
|
|
|
|
|
|
|
|
|
mnuContinue.InitShortcut(this, nameof(DebuggerShortcutsConfig.Continue));
|
|
|
|
|
mnuBreak.InitShortcut(this, nameof(DebuggerShortcutsConfig.Break));
|
|
|
|
|
mnuBreakIn.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakIn));
|
|
|
|
|
mnuBreakOn.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakOn));
|
|
|
|
|
|
|
|
|
|
mnuStepBack.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepBack));
|
|
|
|
|
mnuStepOut.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepOut));
|
|
|
|
|
mnuStepInto.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepInto));
|
|
|
|
|
mnuStepOver.InitShortcut(this, nameof(DebuggerShortcutsConfig.StepOver));
|
|
|
|
|
|
|
|
|
|
mnuRunPpuCycle.InitShortcut(this, nameof(DebuggerShortcutsConfig.RunPpuCycle));
|
|
|
|
|
mnuRunScanline.InitShortcut(this, nameof(DebuggerShortcutsConfig.RunPpuScanline));
|
|
|
|
|
mnuRunOneFrame.InitShortcut(this, nameof(DebuggerShortcutsConfig.RunPpuFrame));
|
2019-03-24 16:42:52 -04:00
|
|
|
|
|
2019-03-30 21:47:30 -04:00
|
|
|
|
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));
|
|
|
|
|
|
|
|
|
|
mnuGoToAddress.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoTo));
|
|
|
|
|
mnuGoToProgramCounter.InitShortcut(this, nameof(DebuggerShortcutsConfig.GoToProgramCounter));
|
|
|
|
|
|
|
|
|
|
mnuFind.InitShortcut(this, nameof(DebuggerShortcutsConfig.Find));
|
|
|
|
|
mnuFindNext.InitShortcut(this, nameof(DebuggerShortcutsConfig.FindNext));
|
|
|
|
|
mnuFindPrev.InitShortcut(this, nameof(DebuggerShortcutsConfig.FindPrev));
|
|
|
|
|
|
2019-03-30 22:58:57 -04:00
|
|
|
|
mnuBreakIn.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakIn));
|
|
|
|
|
mnuBreakOn.InitShortcut(this, nameof(DebuggerShortcutsConfig.BreakOn));
|
|
|
|
|
|
2019-03-31 00:20:54 -04:00
|
|
|
|
mnuIncreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.IncreaseFontSize));
|
|
|
|
|
mnuDecreaseFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.DecreaseFontSize));
|
|
|
|
|
mnuResetFontSize.InitShortcut(this, nameof(DebuggerShortcutsConfig.ResetFontSize));
|
|
|
|
|
|
2019-04-07 12:25:14 -04:00
|
|
|
|
mnuStepInto.Click += (s, e) => { DebugApi.Step(1, _cpuType == CpuType.Cpu ? StepType.CpuStep : StepType.SpcStep); };
|
|
|
|
|
mnuStepOver.Click += (s, e) => { DebugApi.Step(1, _cpuType == CpuType.Cpu ? StepType.CpuStepOver : StepType.SpcStepOver); };
|
|
|
|
|
mnuStepOut.Click += (s, e) => { DebugApi.Step(1, _cpuType == CpuType.Cpu ? StepType.CpuStepOut : StepType.SpcStepOut); };
|
2019-03-24 16:42:52 -04:00
|
|
|
|
mnuRunPpuCycle.Click += (s, e) => { DebugApi.Step(1, StepType.PpuStep); };
|
|
|
|
|
mnuRunScanline.Click += (s, e) => { DebugApi.Step(341, StepType.PpuStep); };
|
|
|
|
|
mnuRunOneFrame.Click += (s, e) => { DebugApi.Step(341*262, StepType.PpuStep); }; //TODO ntsc/pal
|
|
|
|
|
mnuContinue.Click += (s, e) => { DebugApi.ResumeExecution(); };
|
2019-03-30 21:47:30 -04:00
|
|
|
|
mnuBreak.Click += (s, e) => { DebugApi.Step(1); };
|
|
|
|
|
|
|
|
|
|
mnuReset.Click += (s, e) => { EmuApi.Reset(); };
|
|
|
|
|
mnuPowerCycle.Click += (s, e) => { EmuApi.PowerCycle(); };
|
|
|
|
|
|
|
|
|
|
mnuToggleBreakpoint.Click += (s, e) => { ctrlDisassemblyView.ToggleBreakpoint(); };
|
|
|
|
|
mnuEnableDisableBreakpoint.Click += (s, e) => { ctrlDisassemblyView.EnableDisableBreakpoint(); };
|
|
|
|
|
|
|
|
|
|
mnuGoToAddress.Click += (s, e) => { GoToAddress(); };
|
|
|
|
|
mnuGoToNmiHandler.Click += (s, e) => { GoToVector(CpuVector.Nmi); };
|
|
|
|
|
mnuGoToIrqHandler.Click += (s, e) => { GoToVector(CpuVector.Irq); };
|
|
|
|
|
mnuGoToResetHandler.Click += (s, e) => { GoToVector(CpuVector.Reset); };
|
|
|
|
|
mnuGoToBrkHandler.Click += (s, e) => { GoToVector(CpuVector.Brk); };
|
|
|
|
|
mnuGoToCopHandler.Click += (s, e) => { GoToVector(CpuVector.Cop); };
|
|
|
|
|
mnuGoToProgramCounter.Click += (s, e) => { ctrlDisassemblyView.GoToActiveAddress(); };
|
|
|
|
|
|
|
|
|
|
mnuFind.Click += (s, e) => { ctrlDisassemblyView.CodeViewer.OpenSearchBox(); };
|
|
|
|
|
mnuFindNext.Click += (s, e) => { ctrlDisassemblyView.CodeViewer.FindNext(); };
|
|
|
|
|
mnuFindPrev.Click += (s, e) => { ctrlDisassemblyView.CodeViewer.FindPrevious(); };
|
2019-03-30 22:58:57 -04:00
|
|
|
|
|
2019-04-07 18:05:14 -04:00
|
|
|
|
mnuBreakIn.Click += (s, e) => { using(frmBreakIn frm = new frmBreakIn(_cpuType)) { frm.ShowDialog(); } };
|
2019-03-30 22:58:57 -04:00
|
|
|
|
mnuBreakOn.Click += (s, e) => { using(frmBreakOn frm = new frmBreakOn()) { frm.ShowDialog(); } };
|
2019-03-31 00:20:54 -04:00
|
|
|
|
|
|
|
|
|
mnuIncreaseFontSize.Click += (s, e) => { ctrlDisassemblyView.CodeViewer.TextZoom += 10; };
|
|
|
|
|
mnuDecreaseFontSize.Click += (s, e) => { ctrlDisassemblyView.CodeViewer.TextZoom -= 10; };
|
|
|
|
|
mnuResetFontSize.Click += (s, e) => { ctrlDisassemblyView.CodeViewer.TextZoom = 100; };
|
2019-02-27 19:49:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-23 22:13:37 -04:00
|
|
|
|
private void InitToolbar()
|
|
|
|
|
{
|
|
|
|
|
tsToolbar.AddItemsToToolbar(
|
|
|
|
|
mnuContinue, mnuBreak, null,
|
2019-03-30 21:47:30 -04:00
|
|
|
|
mnuStepInto, mnuStepOver, mnuStepOut, null,
|
2019-03-23 22:13:37 -04:00
|
|
|
|
mnuRunPpuCycle, mnuRunScanline, mnuRunOneFrame, null,
|
2019-03-30 21:47:30 -04:00
|
|
|
|
mnuToggleBreakpoint, mnuEnableDisableBreakpoint, null,
|
2019-03-23 22:13:37 -04:00
|
|
|
|
mnuBreakIn, null, mnuBreakOn
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-31 09:22:01 -04:00
|
|
|
|
private void LoadConfig()
|
|
|
|
|
{
|
|
|
|
|
DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger;
|
|
|
|
|
_entityBinder.Entity = cfg;
|
|
|
|
|
_entityBinder.AddBinding(nameof(cfg.ShowByteCode), mnuShowByteCode);
|
|
|
|
|
|
|
|
|
|
mnuShowByteCode.CheckedChanged += (s, e) => { ctrlDisassemblyView.CodeViewer.ShowContentNotes = mnuShowByteCode.Checked; };
|
|
|
|
|
|
|
|
|
|
_entityBinder.UpdateUI();
|
|
|
|
|
|
|
|
|
|
Font font = new Font(cfg.FontFamily, cfg.FontSize, cfg.FontStyle);
|
|
|
|
|
ctrlDisassemblyView.CodeViewer.BaseFont = font;
|
|
|
|
|
ctrlDisassemblyView.CodeViewer.TextZoom = cfg.TextZoom;
|
|
|
|
|
|
|
|
|
|
if(!cfg.WindowSize.IsEmpty) {
|
|
|
|
|
this.StartPosition = FormStartPosition.Manual;
|
|
|
|
|
this.Size = cfg.WindowSize;
|
|
|
|
|
this.Location = cfg.WindowLocation;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-30 21:47:30 -04:00
|
|
|
|
private void UpdateContinueAction()
|
|
|
|
|
{
|
|
|
|
|
bool paused = EmuApi.IsPaused();
|
|
|
|
|
mnuContinue.Enabled = paused;
|
|
|
|
|
mnuBreak.Enabled = !paused;
|
|
|
|
|
|
|
|
|
|
if(!paused) {
|
|
|
|
|
ctrlDisassemblyView.SetActiveAddress(null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-28 22:19:52 -04:00
|
|
|
|
public void GoToAddress(int address)
|
|
|
|
|
{
|
|
|
|
|
ctrlDisassemblyView.GoToAddress((int)address);
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-30 21:47:30 -04:00
|
|
|
|
private void GoToAddress()
|
|
|
|
|
{
|
|
|
|
|
GoToAddress address = new GoToAddress();
|
2019-04-07 12:25:14 -04:00
|
|
|
|
using(frmGoToLine frm = new frmGoToLine(address, _cpuType == CpuType.Spc ? 4 : 6)) {
|
2019-03-30 21:47:30 -04:00
|
|
|
|
frm.StartPosition = FormStartPosition.CenterParent;
|
|
|
|
|
if(frm.ShowDialog(ctrlDisassemblyView) == DialogResult.OK) {
|
|
|
|
|
ctrlDisassemblyView.GoToAddress((int)address.Address);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private int GetVectorAddress(CpuVector vector)
|
|
|
|
|
{
|
|
|
|
|
uint address = (uint)vector;
|
|
|
|
|
byte lsb = DebugApi.GetMemoryValue(SnesMemoryType.CpuMemory, address);
|
|
|
|
|
byte msb = DebugApi.GetMemoryValue(SnesMemoryType.CpuMemory, address + 1);
|
|
|
|
|
return (msb << 8) | lsb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void GoToVector(CpuVector vector)
|
|
|
|
|
{
|
|
|
|
|
ctrlDisassemblyView.GoToAddress(GetVectorAddress(vector));
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-30 22:41:37 -04:00
|
|
|
|
private void UpdateDebugger(DebugState state, int? activeAddress)
|
|
|
|
|
{
|
2019-04-07 12:25:14 -04:00
|
|
|
|
if(_cpuType == CpuType.Cpu) {
|
|
|
|
|
ctrlCpuStatus.UpdateStatus(state);
|
|
|
|
|
} else {
|
|
|
|
|
ctrlCpuStatus.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(_cpuType == CpuType.Spc) {
|
|
|
|
|
ctrlSpcStatus.UpdateStatus(state);
|
|
|
|
|
} else {
|
|
|
|
|
ctrlSpcStatus.Visible = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ctrlPpuStatus.UpdateStatus(state);
|
2019-03-30 22:41:37 -04:00
|
|
|
|
ctrlDisassemblyView.UpdateCode();
|
|
|
|
|
ctrlDisassemblyView.SetActiveAddress(activeAddress);
|
|
|
|
|
ctrlWatch.UpdateWatch(true);
|
2019-04-07 12:25:14 -04:00
|
|
|
|
ctrlCallstack.UpdateCallstack(_cpuType);
|
2019-03-30 22:41:37 -04:00
|
|
|
|
}
|
|
|
|
|
|
2019-02-27 19:49:26 -05:00
|
|
|
|
private void OnNotificationReceived(NotificationEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
switch(e.NotificationType) {
|
2019-03-30 22:41:37 -04:00
|
|
|
|
case ConsoleNotificationType.GameLoaded: {
|
|
|
|
|
DebugState state = DebugApi.GetState();
|
|
|
|
|
this.BeginInvoke((MethodInvoker)(() => {
|
|
|
|
|
UpdateDebugger(state, null);
|
2019-04-21 20:37:05 -04:00
|
|
|
|
BreakpointManager.SetBreakpoints();
|
2019-03-30 22:41:37 -04:00
|
|
|
|
}));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-30 21:47:30 -04:00
|
|
|
|
case ConsoleNotificationType.PpuFrameDone:
|
|
|
|
|
this.BeginInvoke((MethodInvoker)(() => {
|
|
|
|
|
UpdateContinueAction();
|
|
|
|
|
}));
|
|
|
|
|
break;
|
|
|
|
|
|
2019-03-30 22:41:37 -04:00
|
|
|
|
case ConsoleNotificationType.CodeBreak: {
|
2019-02-27 19:49:26 -05:00
|
|
|
|
DebugState state = DebugApi.GetState();
|
2019-04-07 12:25:14 -04:00
|
|
|
|
int activeAddress = _cpuType == CpuType.Cpu ? (int)((state.Cpu.K << 16) | state.Cpu.PC) : (int)state.Spc.PC;
|
2019-02-27 19:49:26 -05:00
|
|
|
|
|
|
|
|
|
this.BeginInvoke((MethodInvoker)(() => {
|
2019-03-30 21:47:30 -04:00
|
|
|
|
UpdateContinueAction();
|
2019-03-30 22:41:37 -04:00
|
|
|
|
UpdateDebugger(state, activeAddress);
|
2019-02-27 19:49:26 -05:00
|
|
|
|
}));
|
|
|
|
|
break;
|
2019-03-30 22:41:37 -04:00
|
|
|
|
}
|
2019-02-27 19:49:26 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-24 12:05:51 -04:00
|
|
|
|
private void ctrlCallstack_FunctionSelected(uint address)
|
|
|
|
|
{
|
|
|
|
|
ctrlDisassemblyView.ScrollToAddress(address);
|
|
|
|
|
}
|
2019-03-30 21:47:30 -04:00
|
|
|
|
|
|
|
|
|
private void mnuPreferences_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
using(frmDbgPreferences frm = new frmDbgPreferences()) {
|
|
|
|
|
frm.ShowDialog(sender, this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ctrlBreakpoints_BreakpointNavigation(Breakpoint bp)
|
|
|
|
|
{
|
|
|
|
|
ctrlDisassemblyView.GoToAddress(bp.GetRelativeAddress());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void mnuGoTo_DropDownOpening(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
mnuGoToNmiHandler.Text = "NMI Handler ($" + GetVectorAddress(CpuVector.Nmi).ToString("X4") + ")";
|
|
|
|
|
mnuGoToIrqHandler.Text = "IRQ Handler ($" + GetVectorAddress(CpuVector.Irq).ToString("X4") + ")";
|
|
|
|
|
mnuGoToResetHandler.Text = "Reset Handler ($" + GetVectorAddress(CpuVector.Reset).ToString("X4") + ")";
|
|
|
|
|
mnuGoToBrkHandler.Text = "BRK Handler ($" + GetVectorAddress(CpuVector.Brk).ToString("X4") + ")";
|
|
|
|
|
mnuGoToCopHandler.Text = "COP Handler ($" + GetVectorAddress(CpuVector.Cop).ToString("X4") + ")";
|
|
|
|
|
}
|
2019-03-31 00:20:54 -04:00
|
|
|
|
|
|
|
|
|
private void mnuSelectFont_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Font newFont = FontDialogHelper.SelectFont(ctrlDisassemblyView.CodeViewer.BaseFont);
|
|
|
|
|
|
2019-03-31 09:11:56 -04:00
|
|
|
|
DebuggerInfo cfg = ConfigManager.Config.Debug.Debugger;
|
|
|
|
|
cfg.FontFamily = newFont.FontFamily.Name;
|
|
|
|
|
cfg.FontStyle = newFont.Style;
|
|
|
|
|
cfg.FontSize = newFont.Size;
|
2019-03-31 00:20:54 -04:00
|
|
|
|
ConfigManager.ApplyChanges();
|
|
|
|
|
|
|
|
|
|
ctrlDisassemblyView.CodeViewer.BaseFont = newFont;
|
|
|
|
|
}
|
2019-03-30 21:47:30 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum CpuVector
|
|
|
|
|
{
|
|
|
|
|
Reset = 0xFFFC,
|
|
|
|
|
Nmi = 0xFFEA,
|
|
|
|
|
Irq = 0xFFEE,
|
|
|
|
|
Brk = 0xFFE6,
|
|
|
|
|
Cop = 0xFFE4,
|
2019-02-27 19:49:26 -05:00
|
|
|
|
}
|
|
|
|
|
}
|