2016-06-04 14:43:13 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Drawing.Imaging;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
2016-11-24 18:30:08 -05:00
|
|
|
|
using System.Xml;
|
2016-11-23 23:46:01 -05:00
|
|
|
|
using System.Xml.Serialization;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
using Mesen.GUI.Debugger;
|
2016-12-18 12:43:20 -05:00
|
|
|
|
using Mesen.GUI.Controls;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Config
|
|
|
|
|
{
|
2016-12-04 14:02:22 -05:00
|
|
|
|
public enum ByteCodePosition
|
|
|
|
|
{
|
|
|
|
|
Hidden,
|
|
|
|
|
Left,
|
|
|
|
|
Below
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum PrgAddressPosition
|
|
|
|
|
{
|
|
|
|
|
Hidden,
|
|
|
|
|
Replace,
|
2018-03-03 12:01:16 -05:00
|
|
|
|
Below,
|
|
|
|
|
Inline
|
2016-12-04 14:02:22 -05:00
|
|
|
|
}
|
|
|
|
|
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public class DebugViewInfo
|
|
|
|
|
{
|
2018-03-18 19:57:56 -04:00
|
|
|
|
public bool ShowSourceAsComments = false;
|
2016-12-04 14:02:22 -05:00
|
|
|
|
public ByteCodePosition ByteCodePosition = ByteCodePosition.Hidden;
|
|
|
|
|
public PrgAddressPosition PrgAddressPosition = PrgAddressPosition.Hidden;
|
2018-03-03 10:41:59 -05:00
|
|
|
|
public int TextZoom = 100;
|
2019-01-03 12:14:37 -05:00
|
|
|
|
public bool UsingSourceView = false;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
}
|
|
|
|
|
|
2016-11-23 23:46:01 -05:00
|
|
|
|
public class DebugWorkspace
|
|
|
|
|
{
|
|
|
|
|
public List<Breakpoint> Breakpoints = new List<Breakpoint>();
|
|
|
|
|
public List<string> WatchValues = new List<string>();
|
|
|
|
|
public List<CodeLabel> Labels = new List<CodeLabel>();
|
2017-02-26 19:18:01 -05:00
|
|
|
|
public List<string> TblMappings = null;
|
2016-11-23 23:46:01 -05:00
|
|
|
|
private string _filePath;
|
|
|
|
|
|
|
|
|
|
public static DebugWorkspace GetWorkspace()
|
|
|
|
|
{
|
|
|
|
|
RomInfo info = InteropEmu.GetRomInfo();
|
|
|
|
|
return Deserialize(Path.Combine(ConfigManager.DebuggerFolder, info.GetRomName() + ".Workspace.xml"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static DebugWorkspace Deserialize(string path)
|
|
|
|
|
{
|
2018-06-11 19:27:35 -04:00
|
|
|
|
DebugWorkspace config = new DebugWorkspace();
|
2016-11-23 23:46:01 -05:00
|
|
|
|
|
|
|
|
|
if(File.Exists(path)) {
|
|
|
|
|
try {
|
|
|
|
|
XmlSerializer xmlSerializer = new XmlSerializer(typeof(DebugWorkspace));
|
|
|
|
|
using(TextReader textReader = new StreamReader(path)) {
|
|
|
|
|
config = (DebugWorkspace)xmlSerializer.Deserialize(textReader);
|
|
|
|
|
}
|
|
|
|
|
} catch { }
|
2017-08-31 23:29:33 -04:00
|
|
|
|
}
|
2016-11-23 23:46:01 -05:00
|
|
|
|
|
|
|
|
|
config._filePath = path;
|
|
|
|
|
|
|
|
|
|
return config;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Save()
|
|
|
|
|
{
|
|
|
|
|
try {
|
2016-11-24 18:30:08 -05:00
|
|
|
|
XmlWriterSettings ws = new XmlWriterSettings();
|
|
|
|
|
ws.NewLineHandling = NewLineHandling.Entitize;
|
2019-05-27 16:48:07 -04:00
|
|
|
|
ws.Indent = true;
|
2016-11-24 18:30:08 -05:00
|
|
|
|
|
2016-11-23 23:46:01 -05:00
|
|
|
|
XmlSerializer xmlSerializer = new XmlSerializer(typeof(DebugWorkspace));
|
2016-11-24 18:30:08 -05:00
|
|
|
|
using(XmlWriter xmlWriter = XmlWriter.Create(_filePath, ws)) {
|
|
|
|
|
xmlSerializer.Serialize(xmlWriter, this);
|
2016-11-23 23:46:01 -05:00
|
|
|
|
}
|
|
|
|
|
} catch {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-05-26 01:14:37 -04:00
|
|
|
|
|
|
|
|
|
public enum StatusFlagFormat
|
|
|
|
|
{
|
|
|
|
|
Hexadecimal = 0,
|
|
|
|
|
Text = 1,
|
|
|
|
|
CompactText = 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TraceLoggerOptions
|
|
|
|
|
{
|
|
|
|
|
public bool ShowByteCode;
|
|
|
|
|
public bool ShowRegisters;
|
|
|
|
|
public bool ShowCpuCycles;
|
|
|
|
|
public bool ShowPpuCycles;
|
|
|
|
|
public bool ShowPpuScanline;
|
|
|
|
|
public bool ShowPpuFrames;
|
|
|
|
|
public bool ShowExtraInfo;
|
|
|
|
|
public bool IndentCode;
|
|
|
|
|
public bool ShowEffectiveAddresses;
|
|
|
|
|
public bool ShowMemoryValues;
|
|
|
|
|
public bool UseLabels;
|
|
|
|
|
public bool ExtendZeroPage;
|
|
|
|
|
public bool UseWindowsEol = !Program.IsMono;
|
|
|
|
|
|
|
|
|
|
public StatusFlagFormat StatusFormat;
|
|
|
|
|
|
|
|
|
|
public bool OverrideFormat;
|
|
|
|
|
public string Format;
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public class DebugInfo
|
|
|
|
|
{
|
2017-08-30 18:31:27 -04:00
|
|
|
|
private const int MaxRecentScripts = 10;
|
|
|
|
|
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public DebugViewInfo LeftView;
|
|
|
|
|
public DebugViewInfo RightView;
|
2016-11-21 22:34:47 -05:00
|
|
|
|
|
2018-07-06 00:10:10 -04:00
|
|
|
|
public InteropEmu.ConsoleId DebugConsoleId = InteropEmu.ConsoleId.Master;
|
|
|
|
|
|
2018-03-03 10:41:59 -05:00
|
|
|
|
public string FontFamily = BaseControl.MonospaceFontFamily;
|
|
|
|
|
public FontStyle FontStyle = FontStyle.Regular;
|
|
|
|
|
public float FontSize = BaseControl.DefaultFontSize;
|
|
|
|
|
|
2016-11-21 22:34:47 -05:00
|
|
|
|
public bool ShowOnlyDisassembledCode = true;
|
2016-12-05 23:35:07 -05:00
|
|
|
|
public bool DisplayOpCodesInLowerCase = false;
|
|
|
|
|
public bool ShowEffectiveAddresses = true;
|
2018-01-03 18:48:16 -05:00
|
|
|
|
|
2018-09-08 13:16:17 -04:00
|
|
|
|
public bool AutoCreateJumpLabels = false;
|
|
|
|
|
public bool ShowJumpLabels = false;
|
|
|
|
|
|
2018-01-03 18:48:16 -05:00
|
|
|
|
public bool DisassembleVerifiedData = false;
|
|
|
|
|
public bool DisassembleUnidentifiedData = false;
|
|
|
|
|
|
|
|
|
|
public bool ShowVerifiedData = false;
|
|
|
|
|
public bool ShowUnidentifiedData = false;
|
2016-11-21 22:34:47 -05:00
|
|
|
|
|
2018-03-25 15:52:03 -04:00
|
|
|
|
public bool ShowCommentsInLabelList = false;
|
2018-03-25 15:51:04 -04:00
|
|
|
|
|
2018-12-23 00:10:00 -05:00
|
|
|
|
public bool ShowBreakNotifications = true;
|
2018-12-23 11:56:28 -05:00
|
|
|
|
public bool ShowInstructionProgression = true;
|
2019-01-21 18:21:45 -05:00
|
|
|
|
public bool ShowSelectionLength = false;
|
2018-12-23 11:56:28 -05:00
|
|
|
|
|
2018-07-25 18:23:24 -04:00
|
|
|
|
public bool AlwaysScrollToCenter = false;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public bool SplitView = false;
|
2018-06-05 20:11:56 -04:00
|
|
|
|
public bool VerticalLayout = false;
|
2019-01-31 19:45:25 -05:00
|
|
|
|
public WatchFormatStyle WatchFormat = WatchFormatStyle.Hex;
|
2017-12-31 17:22:54 -05:00
|
|
|
|
public bool ShowBreakpointLabels = true;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public Point EventViewerLocation;
|
2019-11-19 22:28:45 -05:00
|
|
|
|
public Size EventViewerSize;
|
2019-11-20 19:12:08 -05:00
|
|
|
|
public bool EventViewerAutoRefresh = true;
|
|
|
|
|
public RefreshSpeed EventViewerAutoRefreshSpeed = RefreshSpeed.Normal;
|
2018-03-15 17:40:58 -04:00
|
|
|
|
public bool EventViewerRefreshOnBreak = true;
|
2019-11-13 22:25:23 -05:00
|
|
|
|
public bool EventViewerShowPpuWrite2000 = true;
|
|
|
|
|
public bool EventViewerShowPpuWrite2001 = true;
|
|
|
|
|
public bool EventViewerShowPpuWrite2003 = true;
|
|
|
|
|
public bool EventViewerShowPpuWrite2004 = true;
|
|
|
|
|
public bool EventViewerShowPpuWrite2005 = true;
|
|
|
|
|
public bool EventViewerShowPpuWrite2006 = true;
|
|
|
|
|
public bool EventViewerShowPpuWrite2007 = true;
|
|
|
|
|
public bool EventViewerShowPpuRead2002 = true;
|
|
|
|
|
public bool EventViewerShowPpuRead2004 = true;
|
|
|
|
|
public bool EventViewerShowPpuRead2007 = true;
|
2018-02-18 22:41:50 -05:00
|
|
|
|
public bool EventViewerShowMapperRegisterWrites = true;
|
|
|
|
|
public bool EventViewerShowMapperRegisterReads = true;
|
2020-04-24 18:17:03 -04:00
|
|
|
|
public bool EventViewerShowApuRegisterWrites = true;
|
|
|
|
|
public bool EventViewerShowApuRegisterReads = true;
|
|
|
|
|
public bool EventViewerShowControlRegisterWrites = true;
|
|
|
|
|
public bool EventViewerShowControlRegisterReads = true;
|
2018-02-18 22:41:50 -05:00
|
|
|
|
public bool EventViewerShowNmi = true;
|
|
|
|
|
public bool EventViewerShowIrq = true;
|
|
|
|
|
public bool EventViewerShowSpriteZeroHit = true;
|
|
|
|
|
public bool EventViewerShowMarkedBreakpoints = true;
|
2019-11-13 22:50:52 -05:00
|
|
|
|
public bool EventViewerShowDmcDmaReads = true;
|
2018-07-26 21:29:56 -04:00
|
|
|
|
public bool EventViewerShowPreviousFrameEvents = true;
|
2019-11-19 22:28:45 -05:00
|
|
|
|
public bool EventViewerShowNtscBorders = true;
|
2018-02-18 22:41:50 -05:00
|
|
|
|
|
2018-02-19 23:23:26 -05:00
|
|
|
|
public XmlColor EventViewerMapperRegisterWriteColor = ColorTranslator.FromHtml("#007597");
|
|
|
|
|
public XmlColor EventViewerMapperRegisterReadColor = ColorTranslator.FromHtml("#C92929");
|
2020-04-24 18:17:03 -04:00
|
|
|
|
public XmlColor EventViewerApuRegisterWriteColor = ColorTranslator.FromHtml("#977500");
|
|
|
|
|
public XmlColor EventViewerApuRegisterReadColor = ColorTranslator.FromHtml("#F47522");
|
|
|
|
|
public XmlColor EventViewerControlRegisterWriteColor = ColorTranslator.FromHtml("#009775");
|
|
|
|
|
public XmlColor EventViewerControlRegisterReadColor = ColorTranslator.FromHtml("#29F929");
|
2018-02-19 23:23:26 -05:00
|
|
|
|
public XmlColor EventViewerNmiColor = ColorTranslator.FromHtml("#ABADAC");
|
|
|
|
|
public XmlColor EventViewerIrqColor = ColorTranslator.FromHtml("#F9FEAC");
|
2019-11-13 22:50:52 -05:00
|
|
|
|
public XmlColor EventViewerDmcDmaReadColor = ColorTranslator.FromHtml("#A9FEFC");
|
2018-02-19 23:23:26 -05:00
|
|
|
|
public XmlColor EventViewerSpriteZeroHitColor = ColorTranslator.FromHtml("#9F93C6");
|
|
|
|
|
public XmlColor EventViewerBreakpointColor = ColorTranslator.FromHtml("#1898E4");
|
2019-11-13 22:25:23 -05:00
|
|
|
|
|
|
|
|
|
public XmlColor EventViewerPpuRegisterWrite2000Color = ColorTranslator.FromHtml("#FF5E5E");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterWrite2001Color = ColorTranslator.FromHtml("#8E33FF");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterWrite2003Color = ColorTranslator.FromHtml("#FF84E0");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterWrite2004Color = ColorTranslator.FromHtml("#FAFF39");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterWrite2005Color = ColorTranslator.FromHtml("#2EFF28");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterWrite2006Color = ColorTranslator.FromHtml("#3D2DFF");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterWrite2007Color = ColorTranslator.FromHtml("#FF060D");
|
|
|
|
|
|
|
|
|
|
public XmlColor EventViewerPpuRegisterRead2002Color = ColorTranslator.FromHtml("#FF8224");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterRead2004Color = ColorTranslator.FromHtml("#24A672");
|
|
|
|
|
public XmlColor EventViewerPpuRegisterRead2007Color = ColorTranslator.FromHtml("#6AF0FF");
|
2018-02-18 22:41:50 -05:00
|
|
|
|
|
2018-03-06 20:34:15 -05:00
|
|
|
|
public bool CopyAddresses = false;
|
|
|
|
|
public bool CopyByteCode = false;
|
2018-03-22 18:59:00 -04:00
|
|
|
|
public bool CopyComments = false;
|
2018-03-06 20:34:15 -05:00
|
|
|
|
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public Point? PpuWindowLocation = null;
|
2019-01-19 18:56:08 -05:00
|
|
|
|
|
|
|
|
|
public Point? PpuNametableViewerLocation = null;
|
|
|
|
|
public Point? PpuChrViewerLocation = null;
|
|
|
|
|
public Point? PpuSpriteViewerLocation = null;
|
|
|
|
|
public Point? PpuPaletteViewerLocation = null;
|
|
|
|
|
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public bool PpuAutoRefresh = true;
|
2019-01-14 22:48:57 -05:00
|
|
|
|
public RefreshSpeed PpuAutoRefreshSpeed = RefreshSpeed.Normal;
|
2018-03-15 17:40:58 -04:00
|
|
|
|
public bool PpuRefreshOnBreak = true;
|
2019-01-19 12:08:14 -05:00
|
|
|
|
public bool PpuShowInformationOverlay = true;
|
2016-06-05 10:26:05 -04:00
|
|
|
|
public bool PpuPartialDraw = false;
|
2018-02-16 20:05:15 -05:00
|
|
|
|
public bool PpuShowPreviousFrame = false;
|
2018-03-03 13:11:45 -05:00
|
|
|
|
public bool HidePauseIcon = false;
|
2016-12-02 18:10:37 -05:00
|
|
|
|
public bool ShowPpuScrollOverlay = true;
|
2019-01-19 14:50:47 -05:00
|
|
|
|
public bool ShowAttributeColorsOnly = false;
|
2016-12-04 10:47:48 -05:00
|
|
|
|
public bool ShowTileGrid = false;
|
|
|
|
|
public bool ShowAttributeGrid = false;
|
2017-08-20 12:06:45 -04:00
|
|
|
|
public bool HighlightChrTile = false;
|
2018-02-20 22:21:51 -05:00
|
|
|
|
public bool NtViewerUseGrayscalePalette = false;
|
2018-04-14 22:55:31 -04:00
|
|
|
|
public bool NtViewerHighlightTileUpdates = false;
|
|
|
|
|
public bool NtViewerHighlightAttributeUpdates = false;
|
2019-01-13 18:32:27 -05:00
|
|
|
|
public bool NtViewerIgnoreRedundantWrites = false;
|
2019-01-19 20:53:15 -05:00
|
|
|
|
public bool SpriteViewerDisplaySpriteOutlines = false;
|
2018-01-01 00:31:16 -05:00
|
|
|
|
|
2018-07-28 22:08:12 -04:00
|
|
|
|
public int ChrViewerSelectedPalette = 0;
|
|
|
|
|
public CdlHighlightType ChrViewerHighlightType = CdlHighlightType.None;
|
2018-01-01 00:31:16 -05:00
|
|
|
|
public bool ChrViewerUseAutoPalette = true;
|
|
|
|
|
public bool ChrViewerUseLargeSprites = false;
|
2018-07-28 15:32:38 -04:00
|
|
|
|
public bool ChrViewerShowSingleColorTilesInGrayscale = false;
|
2018-01-01 00:31:16 -05:00
|
|
|
|
|
2016-12-02 18:10:37 -05:00
|
|
|
|
public int PpuDisplayCycle = 0;
|
|
|
|
|
public int PpuDisplayScanline = 241;
|
2018-01-02 11:11:50 -05:00
|
|
|
|
|
|
|
|
|
public bool ShowCodePreview = true;
|
2018-02-10 23:01:16 -05:00
|
|
|
|
public bool ShowOpCodeTooltips = true;
|
2018-05-20 18:53:27 -04:00
|
|
|
|
public bool OnlyShowTooltipsOnShift = false;
|
2018-01-02 11:11:50 -05:00
|
|
|
|
|
2018-02-16 18:05:48 -05:00
|
|
|
|
public bool ShowToolbar = true;
|
|
|
|
|
|
2016-09-04 18:08:16 -04:00
|
|
|
|
public bool ShowCpuMemoryMapping = true;
|
|
|
|
|
public bool ShowPpuMemoryMapping = true;
|
2016-12-06 22:50:27 -05:00
|
|
|
|
|
|
|
|
|
public bool ShowRightPanel = true;
|
|
|
|
|
public bool ShowBottomPanel = true;
|
|
|
|
|
public int LeftPanelWidth = 930;
|
|
|
|
|
public int TopPanelHeight = 450;
|
2016-09-04 18:08:16 -04:00
|
|
|
|
|
2018-01-03 18:48:16 -05:00
|
|
|
|
public XmlColor CodeVerifiedDataColor = Color.FromArgb(255, 252, 236);
|
|
|
|
|
public XmlColor CodeUnidentifiedDataColor = Color.FromArgb(255, 242, 242);
|
|
|
|
|
public XmlColor CodeUnexecutedCodeColor = Color.FromArgb(225, 244, 228);
|
|
|
|
|
|
|
|
|
|
public XmlColor CodeExecBreakpointColor = Color.FromArgb(140, 40, 40);
|
|
|
|
|
public XmlColor CodeWriteBreakpointColor = Color.FromArgb(40, 120, 80);
|
|
|
|
|
public XmlColor CodeReadBreakpointColor = Color.FromArgb(40, 40, 200);
|
|
|
|
|
public XmlColor CodeActiveStatementColor = Color.Yellow;
|
2018-01-03 21:33:04 -05:00
|
|
|
|
public XmlColor CodeEffectiveAddressColor = Color.SteelBlue;
|
2018-01-03 18:48:16 -05:00
|
|
|
|
|
2018-02-23 10:18:25 -05:00
|
|
|
|
public bool RamHighDensityTextMode = false;
|
2018-02-23 12:45:49 -05:00
|
|
|
|
public bool RamEnablePerByteNavigation = false;
|
2018-03-10 13:41:01 -05:00
|
|
|
|
public bool RamByteEditingMode = false;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public bool RamAutoRefresh = true;
|
2018-01-14 14:03:43 -05:00
|
|
|
|
public RefreshSpeed RamAutoRefreshSpeed = RefreshSpeed.Normal;
|
2018-01-15 22:20:51 -05:00
|
|
|
|
public bool RamIgnoreRedundantWrites = false;
|
2019-01-15 00:22:56 -05:00
|
|
|
|
public bool RamHighlightCurrentRowColumn = true;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public int RamColumnCount = 2;
|
2018-03-03 10:41:59 -05:00
|
|
|
|
|
|
|
|
|
public string RamFontFamily = BaseControl.MonospaceFontFamily;
|
|
|
|
|
public FontStyle RamFontStyle = FontStyle.Regular;
|
2016-12-18 12:43:20 -05:00
|
|
|
|
public float RamFontSize = BaseControl.DefaultFontSize;
|
2018-03-03 10:41:59 -05:00
|
|
|
|
public int RamTextZoom = 100;
|
|
|
|
|
|
2017-02-26 18:58:48 -05:00
|
|
|
|
public bool RamShowCharacters = true;
|
2017-12-26 18:29:47 -05:00
|
|
|
|
public bool RamShowLabelInfo = true;
|
2017-03-01 20:52:15 -05:00
|
|
|
|
public bool RamHighlightExecution = true;
|
|
|
|
|
public bool RamHighlightWrites = true;
|
|
|
|
|
public bool RamHighlightReads = true;
|
|
|
|
|
public int RamFadeSpeed = 300;
|
2017-12-26 17:33:46 -05:00
|
|
|
|
public bool RamHideUnusedBytes = false;
|
|
|
|
|
public bool RamHideReadBytes = false;
|
|
|
|
|
public bool RamHideWrittenBytes = false;
|
|
|
|
|
public bool RamHideExecutedBytes = false;
|
2019-01-03 14:27:10 -05:00
|
|
|
|
public bool RamHighlightBreakpoints = false;
|
2017-12-27 12:03:35 -05:00
|
|
|
|
public bool RamHighlightLabelledBytes = false;
|
2017-12-26 17:33:46 -05:00
|
|
|
|
public bool RamHighlightChrDrawnBytes = false;
|
|
|
|
|
public bool RamHighlightChrReadBytes = false;
|
|
|
|
|
public bool RamHighlightCodeBytes = false;
|
|
|
|
|
public bool RamHighlightDataBytes = false;
|
2017-12-29 13:39:57 -05:00
|
|
|
|
public bool RamHighlightDmcDataBytes = false;
|
2017-12-26 17:55:08 -05:00
|
|
|
|
public XmlColor RamReadColor = Color.Blue;
|
|
|
|
|
public XmlColor RamWriteColor = Color.Red;
|
|
|
|
|
public XmlColor RamExecColor = Color.Green;
|
2017-12-27 12:03:35 -05:00
|
|
|
|
public XmlColor RamLabelledByteColor = Color.LightPink;
|
2017-12-26 17:55:08 -05:00
|
|
|
|
public XmlColor RamCodeByteColor = Color.DarkSeaGreen;
|
|
|
|
|
public XmlColor RamDataByteColor = Color.LightSteelBlue;
|
2017-12-29 13:39:57 -05:00
|
|
|
|
public XmlColor RamDmcDataByteColor = Color.Gold;
|
2017-12-26 17:55:08 -05:00
|
|
|
|
public XmlColor RamChrDrawnByteColor = Color.DarkSeaGreen;
|
|
|
|
|
public XmlColor RamChrReadByteColor = Color.LightSteelBlue;
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public DebugMemoryType RamMemoryType = DebugMemoryType.CpuMemory;
|
2017-12-26 17:55:08 -05:00
|
|
|
|
|
2017-10-05 19:59:24 -04:00
|
|
|
|
public Size MemoryViewerSize = new Size(0, 0);
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public Point MemoryViewerLocation;
|
|
|
|
|
public Point? ApuViewerLocation;
|
2019-01-19 20:00:48 -05:00
|
|
|
|
|
|
|
|
|
public Size ProfilerSize = new Size(0, 0);
|
|
|
|
|
public Point ProfilerLocation;
|
2019-01-29 17:21:23 -05:00
|
|
|
|
|
|
|
|
|
public Size WatchWindowSize = new Size(0, 0);
|
|
|
|
|
public Point WatchWindowLocation;
|
2016-06-04 14:43:13 -04:00
|
|
|
|
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public Point WindowLocation;
|
2016-11-26 20:58:27 -05:00
|
|
|
|
public int WindowWidth = -1;
|
|
|
|
|
public int WindowHeight = -1;
|
|
|
|
|
|
2016-11-28 20:57:53 -05:00
|
|
|
|
public int BreakInCount = 1;
|
2018-02-16 19:33:20 -05:00
|
|
|
|
public BreakInMetric BreakInMetric = BreakInMetric.CpuCycles;
|
2016-11-28 20:57:53 -05:00
|
|
|
|
|
2018-03-15 18:34:00 -04:00
|
|
|
|
public int BreakOnValue = 241;
|
|
|
|
|
|
2016-12-01 20:45:13 -05:00
|
|
|
|
public bool FindOccurrencesMatchCase = false;
|
|
|
|
|
public bool FindOccurrencesMatchWholeWord = false;
|
|
|
|
|
public string FindOccurrencesLastSearch = string.Empty;
|
2016-11-27 19:43:17 -05:00
|
|
|
|
|
2019-01-27 13:45:57 -05:00
|
|
|
|
public bool AutoLoadDbgFiles = true;
|
2017-08-19 22:00:12 -04:00
|
|
|
|
public bool AutoLoadCdlFiles = false;
|
2016-12-04 09:43:43 -05:00
|
|
|
|
public bool DisableDefaultLabels = false;
|
2016-12-01 21:43:32 -05:00
|
|
|
|
|
2018-07-10 00:04:59 -04:00
|
|
|
|
public bool RefreshWhileRunning = false;
|
2018-02-14 21:09:43 -05:00
|
|
|
|
public bool ShowMemoryValuesInCodeWindow = true;
|
2017-06-29 13:47:49 -04:00
|
|
|
|
|
2020-11-15 11:08:42 -07:00
|
|
|
|
public bool ReloadRomOnPowerCycle = false;
|
|
|
|
|
|
2016-12-04 09:37:01 -05:00
|
|
|
|
public bool BreakOnOpen = true;
|
2016-12-04 09:53:25 -05:00
|
|
|
|
public bool BreakOnReset = true;
|
2017-03-04 16:18:28 -05:00
|
|
|
|
public bool BreakOnUnofficialOpcodes = true;
|
|
|
|
|
public bool BreakOnBrk = false;
|
2017-06-29 13:55:12 -04:00
|
|
|
|
public bool BreakOnDebuggerFocus = false;
|
2018-02-20 21:59:56 -05:00
|
|
|
|
public bool BreakOnCrash = false;
|
2018-07-06 17:54:56 -04:00
|
|
|
|
public bool BreakOnDecayedOamRead = false;
|
2019-11-11 20:19:45 -05:00
|
|
|
|
public bool BreakOnPpu2006ScrollGlitch = false;
|
2018-06-07 19:32:34 -04:00
|
|
|
|
public bool BreakOnUninitMemoryRead = false;
|
2019-12-12 20:55:18 -05:00
|
|
|
|
public bool BreakOnBusConflict = false;
|
2018-08-21 19:41:07 -04:00
|
|
|
|
public bool BreakOnInit = true;
|
|
|
|
|
public bool BreakOnPlay = false;
|
2018-12-24 15:21:21 -05:00
|
|
|
|
public bool BreakOnFirstCycle = true;
|
2021-07-14 23:04:42 +08:00
|
|
|
|
public bool BreakOnUnlogged = false;
|
2016-12-04 09:37:01 -05:00
|
|
|
|
|
2018-02-24 11:07:27 -05:00
|
|
|
|
public bool BringToFrontOnPause = false;
|
|
|
|
|
public bool BringToFrontOnBreak = true;
|
|
|
|
|
|
2017-03-16 21:34:28 -04:00
|
|
|
|
public TraceLoggerOptions TraceLoggerOptions;
|
2017-03-04 15:18:00 -05:00
|
|
|
|
public bool TraceAutoRefresh = true;
|
|
|
|
|
public int TraceLineCount = 1000;
|
2017-08-06 16:23:22 -04:00
|
|
|
|
public Size TraceLoggerSize = new Size(0, 0);
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public Point TraceLoggerLocation;
|
2017-03-04 15:18:00 -05:00
|
|
|
|
|
2018-03-03 10:41:59 -05:00
|
|
|
|
public string TraceFontFamily = BaseControl.MonospaceFontFamily;
|
|
|
|
|
public FontStyle TraceFontStyle = FontStyle.Regular;
|
|
|
|
|
public float TraceFontSize = BaseControl.DefaultFontSize;
|
|
|
|
|
public int TraceTextZoom = 100;
|
|
|
|
|
|
2017-08-30 18:31:27 -04:00
|
|
|
|
public Size ScriptWindowSize = new Size(0, 0);
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public Point ScriptWindowLocation;
|
2017-08-30 18:31:27 -04:00
|
|
|
|
public int ScriptCodeWindowHeight = 0;
|
|
|
|
|
public List<string> RecentScripts = new List<string>();
|
|
|
|
|
public bool SaveScriptBeforeRun = true;
|
2020-05-03 14:57:24 -04:00
|
|
|
|
public bool AutoRestartScript = true;
|
2017-09-01 14:57:02 -04:00
|
|
|
|
public ScriptStartupBehavior ScriptStartupBehavior = ScriptStartupBehavior.ShowTutorial;
|
|
|
|
|
public bool AutoLoadLastScript = true;
|
2018-03-03 10:41:59 -05:00
|
|
|
|
public string ScriptFontFamily = BaseControl.MonospaceFontFamily;
|
|
|
|
|
public FontStyle ScriptFontStyle = FontStyle.Regular;
|
|
|
|
|
public float ScriptFontSize = BaseControl.DefaultFontSize;
|
2017-08-30 18:31:27 -04:00
|
|
|
|
public int ScriptZoom = 100;
|
2018-09-02 15:37:13 -04:00
|
|
|
|
public UInt32 ScriptTimeout = 1000;
|
2017-08-30 18:31:27 -04:00
|
|
|
|
|
2017-08-31 23:29:33 -04:00
|
|
|
|
public bool AssemblerCodeHighlighting = true;
|
2018-01-03 21:33:04 -05:00
|
|
|
|
public XmlColor AssemblerOpcodeColor = Color.FromArgb(22, 37, 37);
|
2018-01-07 13:37:52 -05:00
|
|
|
|
public XmlColor AssemblerLabelDefinitionColor = Color.Blue;
|
2017-08-31 23:29:33 -04:00
|
|
|
|
public XmlColor AssemblerImmediateColor = Color.Chocolate;
|
|
|
|
|
public XmlColor AssemblerAddressColor = Color.DarkRed;
|
|
|
|
|
public XmlColor AssemblerCommentColor = Color.Green;
|
|
|
|
|
public Size AssemblerSize = new Size(0, 0);
|
2018-06-05 18:35:47 -04:00
|
|
|
|
public Point AssemblerLocation;
|
2018-03-03 10:41:59 -05:00
|
|
|
|
public string AssemblerFontFamily = BaseControl.MonospaceFontFamily;
|
|
|
|
|
public FontStyle AssemblerFontStyle = FontStyle.Regular;
|
|
|
|
|
public float AssemblerFontSize = BaseControl.DefaultFontSize;
|
2017-08-31 23:29:33 -04:00
|
|
|
|
public int AssemblerZoom = 100;
|
|
|
|
|
|
2018-06-23 18:29:15 -04:00
|
|
|
|
public Point? TextHookerWindowLocation = null;
|
|
|
|
|
public bool TextHookerAutoRefresh = true;
|
|
|
|
|
public bool TextHookerRefreshOnBreak = true;
|
|
|
|
|
public int TextHookerDisplayCycle = 0;
|
|
|
|
|
public int TextHookerDisplayScanline = 241;
|
|
|
|
|
public List<CharMap> TextHookerCharMappings = new List<CharMap>();
|
|
|
|
|
public bool TextHookerAdjustViewportScrolling = true;
|
|
|
|
|
public bool TextHookerIgnoreMirroredNametables = true;
|
|
|
|
|
public bool TextHookerAutoCopyToClipboard = false;
|
|
|
|
|
|
2019-01-12 22:20:43 -05:00
|
|
|
|
public string ExternalEditorPath;
|
|
|
|
|
public string ExternalEditorArguments;
|
|
|
|
|
|
2018-03-10 09:58:24 -05:00
|
|
|
|
public DebuggerShortcutsConfig Shortcuts = new DebuggerShortcutsConfig();
|
2018-03-27 19:46:15 -04:00
|
|
|
|
public DebugImportConfig ImportConfig = new DebugImportConfig();
|
2018-03-10 09:58:24 -05:00
|
|
|
|
|
2016-06-04 14:43:13 -04:00
|
|
|
|
public DebugInfo()
|
|
|
|
|
{
|
|
|
|
|
LeftView = new DebugViewInfo();
|
|
|
|
|
RightView = new DebugViewInfo();
|
2017-03-16 21:34:28 -04:00
|
|
|
|
TraceLoggerOptions = new TraceLoggerOptions() {
|
|
|
|
|
ShowByteCode = true,
|
|
|
|
|
ShowCpuCycles = false,
|
|
|
|
|
ShowEffectiveAddresses = true,
|
|
|
|
|
ShowExtraInfo = true,
|
|
|
|
|
ShowPpuFrames = false,
|
|
|
|
|
ShowPpuCycles = true,
|
|
|
|
|
ShowPpuScanline = true,
|
|
|
|
|
ShowRegisters = true,
|
|
|
|
|
UseLabels = false,
|
|
|
|
|
StatusFormat = StatusFlagFormat.Hexadecimal
|
|
|
|
|
};
|
2019-01-12 22:20:43 -05:00
|
|
|
|
|
|
|
|
|
if(ExternalEditorPath == null || ExternalEditorArguments == null) {
|
|
|
|
|
ExternalEditorPath = "";
|
|
|
|
|
ExternalEditorArguments = "";
|
|
|
|
|
|
|
|
|
|
//Setup a default editor when possible
|
|
|
|
|
if(Program.IsMono) {
|
|
|
|
|
string geditPath = "/usr/bin/gedit";
|
|
|
|
|
string katePath = "/usr/bin/kate";
|
|
|
|
|
if(File.Exists(geditPath)) {
|
|
|
|
|
ExternalEditorPath = geditPath;
|
|
|
|
|
ExternalEditorArguments = "+%L %F";
|
|
|
|
|
} else if(File.Exists(katePath)) {
|
|
|
|
|
ExternalEditorPath = katePath;
|
|
|
|
|
ExternalEditorArguments = "%F -l %L";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
string notepadPath32 = "C:\\Program Files (x86)\\Notepad++\\notepad++.exe";
|
|
|
|
|
string notepadPath64 = "C:\\Program Files\\Notepad++\\notepad++.exe";
|
|
|
|
|
if(File.Exists(notepadPath32)) {
|
|
|
|
|
ExternalEditorPath = notepadPath32;
|
|
|
|
|
ExternalEditorArguments = "%F -n%L";
|
|
|
|
|
} else if(File.Exists(notepadPath64)) {
|
|
|
|
|
ExternalEditorPath = notepadPath64;
|
|
|
|
|
ExternalEditorArguments = "%F -n%L";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-06-04 14:43:13 -04:00
|
|
|
|
}
|
2017-08-30 18:31:27 -04:00
|
|
|
|
|
2018-02-20 21:59:56 -05:00
|
|
|
|
static public void ApplyConfig()
|
|
|
|
|
{
|
|
|
|
|
InteropEmu.SetFlag(EmulationFlags.BreakOnCrash, ConfigManager.Config.DebugInfo.BreakOnCrash);
|
2018-09-02 15:37:13 -04:00
|
|
|
|
InteropEmu.DebugSetScriptTimeout(ConfigManager.Config.DebugInfo.ScriptTimeout);
|
2018-02-20 21:59:56 -05:00
|
|
|
|
}
|
|
|
|
|
|
2017-08-30 18:31:27 -04:00
|
|
|
|
public void AddRecentScript(string scriptFile)
|
|
|
|
|
{
|
|
|
|
|
string existingItem = RecentScripts.Where((file) => file == scriptFile).FirstOrDefault();
|
|
|
|
|
if(existingItem != null) {
|
|
|
|
|
RecentScripts.Remove(existingItem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
RecentScripts.Insert(0, scriptFile);
|
|
|
|
|
if(RecentScripts.Count > DebugInfo.MaxRecentScripts) {
|
|
|
|
|
RecentScripts.RemoveAt(DebugInfo.MaxRecentScripts);
|
|
|
|
|
}
|
|
|
|
|
ConfigManager.ApplyChanges();
|
|
|
|
|
}
|
2016-06-04 14:43:13 -04:00
|
|
|
|
}
|
2017-08-31 23:29:33 -04:00
|
|
|
|
|
2018-03-27 19:46:15 -04:00
|
|
|
|
public class DebugImportConfig
|
|
|
|
|
{
|
2018-07-28 15:18:01 -04:00
|
|
|
|
public bool ResetLabelsOnImport = true;
|
|
|
|
|
|
2018-03-27 19:46:15 -04:00
|
|
|
|
public bool DbgImportRamLabels = true;
|
2019-01-10 20:36:56 -05:00
|
|
|
|
public bool DbgImportWorkRamLabels = true;
|
|
|
|
|
public bool DbgImportSaveRamLabels = true;
|
2018-03-27 19:46:15 -04:00
|
|
|
|
public bool DbgImportPrgRomLabels = true;
|
|
|
|
|
public bool DbgImportComments = true;
|
|
|
|
|
|
|
|
|
|
public bool MlbImportInternalRamLabels = true;
|
|
|
|
|
public bool MlbImportWorkRamLabels = true;
|
|
|
|
|
public bool MlbImportSaveRamLabels = true;
|
|
|
|
|
public bool MlbImportRegisterLabels = true;
|
|
|
|
|
public bool MlbImportPrgRomLabels = true;
|
|
|
|
|
public bool MlbImportComments = true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-01 14:57:02 -04:00
|
|
|
|
public enum ScriptStartupBehavior
|
|
|
|
|
{
|
|
|
|
|
ShowTutorial = 0,
|
|
|
|
|
ShowBlankWindow = 1,
|
|
|
|
|
LoadLastScript = 2
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-14 14:03:43 -05:00
|
|
|
|
public enum RefreshSpeed
|
|
|
|
|
{
|
|
|
|
|
Low = 0,
|
|
|
|
|
Normal = 1,
|
|
|
|
|
High = 2
|
|
|
|
|
}
|
2017-09-01 14:57:02 -04:00
|
|
|
|
|
2018-02-16 19:33:20 -05:00
|
|
|
|
public enum BreakInMetric
|
|
|
|
|
{
|
|
|
|
|
CpuCycles,
|
|
|
|
|
CpuInstructions,
|
|
|
|
|
PpuCycles,
|
|
|
|
|
Scanlines,
|
|
|
|
|
Frames
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-31 23:29:33 -04:00
|
|
|
|
public class XmlColor
|
|
|
|
|
{
|
|
|
|
|
private Color _color = Color.Black;
|
|
|
|
|
|
|
|
|
|
public XmlColor() { }
|
|
|
|
|
public XmlColor(Color c) { _color = c; }
|
|
|
|
|
|
|
|
|
|
[XmlIgnore]
|
|
|
|
|
public Color Color
|
|
|
|
|
{
|
|
|
|
|
get { return _color; }
|
|
|
|
|
set { _color = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static implicit operator Color(XmlColor x)
|
|
|
|
|
{
|
|
|
|
|
return x.Color;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static implicit operator XmlColor(Color c)
|
|
|
|
|
{
|
|
|
|
|
return new XmlColor(c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
public string ColorString
|
|
|
|
|
{
|
|
|
|
|
get { return ColorTranslator.ToHtml(_color); }
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
_color = ColorTranslator.FromHtml(value);
|
|
|
|
|
} catch(Exception) {
|
|
|
|
|
_color = Color.Black;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-06-23 18:29:15 -04:00
|
|
|
|
|
|
|
|
|
public class CharMap
|
|
|
|
|
{
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
public string Key;
|
|
|
|
|
[XmlAttribute]
|
|
|
|
|
public string Value;
|
|
|
|
|
}
|
2016-06-04 14:43:13 -04:00
|
|
|
|
}
|