From 702b60938124fe58cc5a7f333cdc8885ffc29e75 Mon Sep 17 00:00:00 2001 From: Sour Date: Fri, 3 May 2019 17:16:43 -0400 Subject: [PATCH] Debugger: Added CC65 integration settings --- UI/Config/DbgIntegrationConfig.cs | 22 ++ UI/Debugger/Config/DebugInfo.cs | 1 + UI/Debugger/Integration/DbgImporter.cs | 38 ++- .../frmIntegrationSettings.Designer.cs | 291 ++++++++++++++++++ .../Integration/frmIntegrationSettings.cs | 35 +++ .../Integration/frmIntegrationSettings.resx | 123 ++++++++ .../Workspace/DebugWorkspaceManager.cs | 10 +- UI/Debugger/frmDebugger.Designer.cs | 45 ++- UI/Debugger/frmDebugger.cs | 7 + UI/UI.csproj | 10 + 10 files changed, 558 insertions(+), 24 deletions(-) create mode 100644 UI/Config/DbgIntegrationConfig.cs create mode 100644 UI/Debugger/Integration/frmIntegrationSettings.Designer.cs create mode 100644 UI/Debugger/Integration/frmIntegrationSettings.cs create mode 100644 UI/Debugger/Integration/frmIntegrationSettings.resx diff --git a/UI/Config/DbgIntegrationConfig.cs b/UI/Config/DbgIntegrationConfig.cs new file mode 100644 index 0000000..4e64312 --- /dev/null +++ b/UI/Config/DbgIntegrationConfig.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Mesen.GUI.Config +{ + public class DbgIntegrationConfig + { + public bool AutoImport = true; + public bool ResetLabelsOnImport = true; + + public bool ImportCpuPrgRomLabels = true; + public bool ImportCpuWorkRamLabels = true; + public bool ImportCpuSaveRamLabels = true; + public bool ImportCpuComments = true; + + public bool ImportSpcRamLabels = true; + public bool ImportSpcComments = true; + } +} diff --git a/UI/Debugger/Config/DebugInfo.cs b/UI/Debugger/Config/DebugInfo.cs index bcc04a1..7c518b9 100644 --- a/UI/Debugger/Config/DebugInfo.cs +++ b/UI/Debugger/Config/DebugInfo.cs @@ -24,6 +24,7 @@ namespace Mesen.GUI.Config public TilemapViewerConfig TilemapViewer = new TilemapViewerConfig(); public TileViewerConfig TileViewer = new TileViewerConfig(); public SpriteViewerConfig SpriteViewer = new SpriteViewerConfig(); + public DbgIntegrationConfig DbgIntegration = new DbgIntegrationConfig(); public DebugInfo() { diff --git a/UI/Debugger/Integration/DbgImporter.cs b/UI/Debugger/Integration/DbgImporter.cs index d4cb6c4..6f2ca0f 100644 --- a/UI/Debugger/Integration/DbgImporter.cs +++ b/UI/Debugger/Integration/DbgImporter.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using Mesen.GUI.Config; using Mesen.GUI.Debugger.Labels; +using Mesen.GUI.Debugger.Workspace; using Mesen.GUI.Forms; namespace Mesen.GUI.Debugger.Integration @@ -558,6 +559,7 @@ namespace Mesen.GUI.Debugger.Integration private void LoadComments() { + DbgIntegrationConfig config = ConfigManager.Config.Debug.DbgIntegration; foreach(KeyValuePair kvp in _lines) { try { LineInfo line = kvp.Value; @@ -621,6 +623,12 @@ namespace Mesen.GUI.Debugger.Integration memoryType = SnesMemoryType.PrgRom; } + if(memoryType == SnesMemoryType.SpcRam && !config.ImportSpcComments) { + continue; + } else if(memoryType != SnesMemoryType.SpcRam && !config.ImportCpuComments) { + continue; + } + if(address >= 0 && memoryType != null) { CodeLabel label = this.CreateLabel(address, memoryType.Value, 1); if(label != null) { @@ -803,33 +811,31 @@ namespace Mesen.GUI.Debugger.Integration int labelCount = 0; - //TODO LABELS - //DebugImportConfig config = ConfigManager.Config.DebugInfo.ImportConfig; - //if(config.DbgImportComments) { + DbgIntegrationConfig config = ConfigManager.Config.Debug.DbgIntegration; + if(config.ImportCpuComments || config.ImportSpcComments) { LoadComments(); - //} + } List labels = new List(_romLabels.Count + _ramLabels.Count + _workRamLabels.Count + _saveRamLabels.Count); - //if(config.DbgImportPrgRomLabels) { + if(config.ImportCpuPrgRomLabels) { labels.AddRange(_romLabels.Values); labelCount += _romLabels.Count; - //} - //if(config.DbgImportRamLabels) { - labels.AddRange(_ramLabels.Values); - labelCount += _ramLabels.Count; - //} - //if(config.DbgImportWorkRamLabels) { + } + if(config.ImportCpuWorkRamLabels) { labels.AddRange(_workRamLabels.Values); labelCount += _workRamLabels.Count; - //} - //if(config.DbgImportSaveRamLabels) { + } + if(config.ImportCpuSaveRamLabels) { labels.AddRange(_saveRamLabels.Values); labelCount += _saveRamLabels.Count; - //} - //if(config.DbgImportSpcRamLabels) { + } + if(config.ImportSpcRamLabels) { labels.AddRange(_spcRamLabels.Values); labelCount += _spcRamLabels.Count; - //} + } + if(ConfigManager.Config.Debug.DbgIntegration.ResetLabelsOnImport) { + DebugWorkspaceManager.ResetLabels(); + } LabelManager.SetLabels(labels, true); if(!silent) { diff --git a/UI/Debugger/Integration/frmIntegrationSettings.Designer.cs b/UI/Debugger/Integration/frmIntegrationSettings.Designer.cs new file mode 100644 index 0000000..b4928bf --- /dev/null +++ b/UI/Debugger/Integration/frmIntegrationSettings.Designer.cs @@ -0,0 +1,291 @@ +namespace Mesen.GUI.Debugger +{ + partial class frmIntegrationSettings + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if(disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.grpSPC = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.chkSpcComments = new System.Windows.Forms.CheckBox(); + this.chkSpcRam = new System.Windows.Forms.CheckBox(); + this.grpCpu = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.chkCpuComments = new System.Windows.Forms.CheckBox(); + this.chkCpuWorkRam = new System.Windows.Forms.CheckBox(); + this.chkCpuPrgRom = new System.Windows.Forms.CheckBox(); + this.chkCpuSaveRam = new System.Windows.Forms.CheckBox(); + this.grpGeneral = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.chkResetLabelsOnImport = new System.Windows.Forms.CheckBox(); + this.chkAutoLoadDbgFiles = new System.Windows.Forms.CheckBox(); + this.tableLayoutPanel1.SuspendLayout(); + this.grpSPC.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.grpCpu.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.grpGeneral.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + this.SuspendLayout(); + // + // baseConfigPanel + // + this.baseConfigPanel.Location = new System.Drawing.Point(0, 196); + this.baseConfigPanel.Size = new System.Drawing.Size(419, 29); + this.baseConfigPanel.TabIndex = 4; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 2; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Controls.Add(this.grpSPC, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.grpCpu, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.grpGeneral, 0, 0); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(419, 196); + this.tableLayoutPanel1.TabIndex = 2; + // + // grpSPC + // + this.grpSPC.Controls.Add(this.tableLayoutPanel3); + this.grpSPC.Dock = System.Windows.Forms.DockStyle.Fill; + this.grpSPC.Location = new System.Drawing.Point(212, 75); + this.grpSPC.Name = "grpSPC"; + this.grpSPC.Size = new System.Drawing.Size(204, 118); + this.grpSPC.TabIndex = 1; + this.grpSPC.TabStop = false; + this.grpSPC.Text = "SPC700"; + // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 1; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Controls.Add(this.chkSpcComments, 0, 1); + this.tableLayoutPanel3.Controls.Add(this.chkSpcRam, 0, 0); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 16); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 3; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(198, 99); + this.tableLayoutPanel3.TabIndex = 0; + // + // chkSpcComments + // + this.chkSpcComments.AutoSize = true; + this.chkSpcComments.Location = new System.Drawing.Point(3, 26); + this.chkSpcComments.Name = "chkSpcComments"; + this.chkSpcComments.Size = new System.Drawing.Size(106, 17); + this.chkSpcComments.TabIndex = 2; + this.chkSpcComments.Text = "Import comments"; + this.chkSpcComments.UseVisualStyleBackColor = true; + // + // chkSpcRam + // + this.chkSpcRam.AutoSize = true; + this.chkSpcRam.Location = new System.Drawing.Point(3, 3); + this.chkSpcRam.Name = "chkSpcRam"; + this.chkSpcRam.Size = new System.Drawing.Size(136, 17); + this.chkSpcRam.TabIndex = 0; + this.chkSpcRam.Text = "Import SPC RAM labels"; + this.chkSpcRam.UseVisualStyleBackColor = true; + // + // grpCpu + // + this.grpCpu.Controls.Add(this.tableLayoutPanel2); + this.grpCpu.Dock = System.Windows.Forms.DockStyle.Fill; + this.grpCpu.Location = new System.Drawing.Point(3, 75); + this.grpCpu.Name = "grpCpu"; + this.grpCpu.Size = new System.Drawing.Size(203, 118); + this.grpCpu.TabIndex = 0; + this.grpCpu.TabStop = false; + this.grpCpu.Text = "CPU (65816)"; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 1; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Controls.Add(this.chkCpuComments, 0, 3); + this.tableLayoutPanel2.Controls.Add(this.chkCpuWorkRam, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.chkCpuPrgRom, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.chkCpuSaveRam, 0, 2); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 5; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(197, 99); + this.tableLayoutPanel2.TabIndex = 0; + // + // chkCpuComments + // + this.chkCpuComments.AutoSize = true; + this.chkCpuComments.Location = new System.Drawing.Point(3, 72); + this.chkCpuComments.Name = "chkCpuComments"; + this.chkCpuComments.Size = new System.Drawing.Size(106, 17); + this.chkCpuComments.TabIndex = 2; + this.chkCpuComments.Text = "Import comments"; + this.chkCpuComments.UseVisualStyleBackColor = true; + // + // chkCpuWorkRam + // + this.chkCpuWorkRam.AutoSize = true; + this.chkCpuWorkRam.Location = new System.Drawing.Point(3, 26); + this.chkCpuWorkRam.Name = "chkCpuWorkRam"; + this.chkCpuWorkRam.Size = new System.Drawing.Size(141, 17); + this.chkCpuWorkRam.TabIndex = 3; + this.chkCpuWorkRam.Text = "Import Work RAM labels"; + this.chkCpuWorkRam.UseVisualStyleBackColor = true; + // + // chkCpuPrgRom + // + this.chkCpuPrgRom.AutoSize = true; + this.chkCpuPrgRom.Location = new System.Drawing.Point(3, 3); + this.chkCpuPrgRom.Name = "chkCpuPrgRom"; + this.chkCpuPrgRom.Size = new System.Drawing.Size(139, 17); + this.chkCpuPrgRom.TabIndex = 1; + this.chkCpuPrgRom.Text = "Import PRG ROM labels"; + this.chkCpuPrgRom.UseVisualStyleBackColor = true; + // + // chkCpuSaveRam + // + this.chkCpuSaveRam.AutoSize = true; + this.chkCpuSaveRam.Location = new System.Drawing.Point(3, 49); + this.chkCpuSaveRam.Name = "chkCpuSaveRam"; + this.chkCpuSaveRam.Size = new System.Drawing.Size(140, 17); + this.chkCpuSaveRam.TabIndex = 4; + this.chkCpuSaveRam.Text = "Import Save RAM labels"; + this.chkCpuSaveRam.UseVisualStyleBackColor = true; + // + // grpGeneral + // + this.tableLayoutPanel1.SetColumnSpan(this.grpGeneral, 2); + this.grpGeneral.Controls.Add(this.tableLayoutPanel4); + this.grpGeneral.Dock = System.Windows.Forms.DockStyle.Fill; + this.grpGeneral.Location = new System.Drawing.Point(3, 3); + this.grpGeneral.Name = "grpGeneral"; + this.grpGeneral.Size = new System.Drawing.Size(413, 66); + this.grpGeneral.TabIndex = 2; + this.grpGeneral.TabStop = false; + this.grpGeneral.Text = "General Settings"; + // + // tableLayoutPanel4 + // + this.tableLayoutPanel4.ColumnCount = 1; + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel4.Controls.Add(this.chkResetLabelsOnImport, 0, 1); + this.tableLayoutPanel4.Controls.Add(this.chkAutoLoadDbgFiles, 0, 0); + this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 16); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + this.tableLayoutPanel4.RowCount = 3; + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel4.Size = new System.Drawing.Size(407, 47); + this.tableLayoutPanel4.TabIndex = 0; + // + // chkResetLabelsOnImport + // + this.chkResetLabelsOnImport.AutoSize = true; + this.chkResetLabelsOnImport.Location = new System.Drawing.Point(3, 26); + this.chkResetLabelsOnImport.Name = "chkResetLabelsOnImport"; + this.chkResetLabelsOnImport.Size = new System.Drawing.Size(360, 17); + this.chkResetLabelsOnImport.TabIndex = 2; + this.chkResetLabelsOnImport.Text = "Reset workspace labels to their default state before importing DBG files"; + this.chkResetLabelsOnImport.UseVisualStyleBackColor = true; + // + // chkAutoLoadDbgFiles + // + this.chkAutoLoadDbgFiles.AutoSize = true; + this.chkAutoLoadDbgFiles.Location = new System.Drawing.Point(3, 3); + this.chkAutoLoadDbgFiles.Name = "chkAutoLoadDbgFiles"; + this.chkAutoLoadDbgFiles.Size = new System.Drawing.Size(354, 17); + this.chkAutoLoadDbgFiles.TabIndex = 3; + this.chkAutoLoadDbgFiles.Text = "Automatically load DBG files when debugger opens or on power cycle"; + this.chkAutoLoadDbgFiles.UseVisualStyleBackColor = true; + // + // frmIntegrationSettings + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(419, 225); + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "frmIntegrationSettings"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "CC65/CA65 Integration Settings (DBG files)"; + this.Controls.SetChildIndex(this.baseConfigPanel, 0); + this.Controls.SetChildIndex(this.tableLayoutPanel1, 0); + this.tableLayoutPanel1.ResumeLayout(false); + this.grpSPC.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); + this.grpCpu.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.grpGeneral.ResumeLayout(false); + this.tableLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel4.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.GroupBox grpCpu; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; + private System.Windows.Forms.CheckBox chkCpuComments; + private System.Windows.Forms.CheckBox chkCpuPrgRom; + private System.Windows.Forms.GroupBox grpGeneral; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; + private System.Windows.Forms.CheckBox chkResetLabelsOnImport; + private System.Windows.Forms.CheckBox chkCpuWorkRam; + private System.Windows.Forms.CheckBox chkCpuSaveRam; + private System.Windows.Forms.GroupBox grpSPC; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3; + private System.Windows.Forms.CheckBox chkSpcComments; + private System.Windows.Forms.CheckBox chkSpcRam; + private System.Windows.Forms.CheckBox chkAutoLoadDbgFiles; + } +} \ No newline at end of file diff --git a/UI/Debugger/Integration/frmIntegrationSettings.cs b/UI/Debugger/Integration/frmIntegrationSettings.cs new file mode 100644 index 0000000..81657f8 --- /dev/null +++ b/UI/Debugger/Integration/frmIntegrationSettings.cs @@ -0,0 +1,35 @@ +using Mesen.GUI.Config; +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 frmIntegrationSettings : BaseConfigForm + { + public frmIntegrationSettings() + { + InitializeComponent(); + + Entity = ConfigManager.Config.Debug.DbgIntegration; + + AddBinding(nameof(DbgIntegrationConfig.AutoImport), chkAutoLoadDbgFiles); + AddBinding(nameof(DbgIntegrationConfig.ResetLabelsOnImport), chkResetLabelsOnImport); + + AddBinding(nameof(DbgIntegrationConfig.ImportCpuPrgRomLabels), chkCpuPrgRom); + AddBinding(nameof(DbgIntegrationConfig.ImportCpuWorkRamLabels), chkCpuWorkRam); + AddBinding(nameof(DbgIntegrationConfig.ImportCpuSaveRamLabels), chkCpuSaveRam); + AddBinding(nameof(DbgIntegrationConfig.ImportCpuComments), chkCpuComments); + + AddBinding(nameof(DbgIntegrationConfig.ImportSpcRamLabels), chkSpcRam); + AddBinding(nameof(DbgIntegrationConfig.ImportSpcComments), chkSpcComments); + } + } +} diff --git a/UI/Debugger/Integration/frmIntegrationSettings.resx b/UI/Debugger/Integration/frmIntegrationSettings.resx new file mode 100644 index 0000000..8766f29 --- /dev/null +++ b/UI/Debugger/Integration/frmIntegrationSettings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/UI/Debugger/Workspace/DebugWorkspaceManager.cs b/UI/Debugger/Workspace/DebugWorkspaceManager.cs index 007ee6a..e385366 100644 --- a/UI/Debugger/Workspace/DebugWorkspaceManager.cs +++ b/UI/Debugger/Workspace/DebugWorkspaceManager.cs @@ -1,4 +1,5 @@ -using Mesen.GUI.Debugger.Integration; +using Mesen.GUI.Config; +using Mesen.GUI.Debugger.Integration; using Mesen.GUI.Debugger.Labels; using System; using System.Collections.Generic; @@ -51,7 +52,7 @@ namespace Mesen.GUI.Debugger.Workspace } } - private static void ResetLabels() + public static void ResetLabels() { if(_workspace != null) { _workspace.CpuLabels = new List(); @@ -90,11 +91,14 @@ namespace Mesen.GUI.Debugger.Workspace public static void ImportDbgFile() { + if(!ConfigManager.Config.Debug.DbgIntegration.AutoImport) { + return; + } + RomInfo romInfo = EmuApi.GetRomInfo(); string dbgPath = Path.Combine(Path.GetDirectoryName(romInfo.RomPath), romInfo.GetRomName() + ".dbg"); if(File.Exists(dbgPath)) { DbgImporter import = new DbgImporter(); - ResetLabels(); import.Import(dbgPath, true); LabelManager.RefreshLabels(); } diff --git a/UI/Debugger/frmDebugger.Designer.cs b/UI/Debugger/frmDebugger.Designer.cs index c47a70f..ae1b6ab 100644 --- a/UI/Debugger/frmDebugger.Designer.cs +++ b/UI/Debugger/frmDebugger.Designer.cs @@ -88,6 +88,7 @@ this.toolStripMenuItem12 = new System.Windows.Forms.ToolStripSeparator(); this.mnuBreakOnBrk = new System.Windows.Forms.ToolStripMenuItem(); this.mnuBreakOnCop = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuBreakOnStp = new System.Windows.Forms.ToolStripMenuItem(); this.mnuBreakOnWdm = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator(); this.mnuBreakOnUnitRead = new System.Windows.Forms.ToolStripMenuItem(); @@ -118,7 +119,9 @@ this.grpCallstack = new System.Windows.Forms.GroupBox(); this.ctrlCallstack = new Mesen.GUI.Debugger.Controls.ctrlCallstack(); this.tsToolbar = new Mesen.GUI.Controls.ctrlMesenToolStrip(); - this.mnuBreakOnStp = new System.Windows.Forms.ToolStripMenuItem(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.importExportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.mnuDbgIntegrationSettings = new System.Windows.Forms.ToolStripMenuItem(); this.ctrlMesenMenuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ctrlSplitContainer)).BeginInit(); this.ctrlSplitContainer.Panel1.SuspendLayout(); @@ -143,6 +146,7 @@ // ctrlMesenMenuStrip1 // this.ctrlMesenMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, this.debugToolStripMenuItem, this.searchToolStripMenuItem, this.optionsToolStripMenuItem}); @@ -572,6 +576,12 @@ this.mnuBreakOnCop.Size = new System.Drawing.Size(261, 22); this.mnuBreakOnCop.Text = "Break on COP"; // + // mnuBreakOnStp + // + this.mnuBreakOnStp.Name = "mnuBreakOnStp"; + this.mnuBreakOnStp.Size = new System.Drawing.Size(261, 22); + this.mnuBreakOnStp.Text = "Break on STP"; + // // mnuBreakOnWdm // this.mnuBreakOnWdm.Name = "mnuBreakOnWdm"; @@ -837,11 +847,30 @@ this.tsToolbar.TabIndex = 3; this.tsToolbar.Text = "ctrlMesenToolStrip1"; // - // mnuBreakOnStp + // fileToolStripMenuItem // - this.mnuBreakOnStp.Name = "mnuBreakOnStp"; - this.mnuBreakOnStp.Size = new System.Drawing.Size(261, 22); - this.mnuBreakOnStp.Text = "Break on STP"; + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.importExportToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // importExportToolStripMenuItem + // + this.importExportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.mnuDbgIntegrationSettings}); + this.importExportToolStripMenuItem.Image = global::Mesen.GUI.Properties.Resources.Import; + this.importExportToolStripMenuItem.Name = "importExportToolStripMenuItem"; + this.importExportToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.importExportToolStripMenuItem.Text = "Import/Export"; + // + // mnuDbgIntegrationSettings + // + this.mnuDbgIntegrationSettings.Image = global::Mesen.GUI.Properties.Resources.Settings; + this.mnuDbgIntegrationSettings.Name = "mnuDbgIntegrationSettings"; + this.mnuDbgIntegrationSettings.Size = new System.Drawing.Size(241, 22); + this.mnuDbgIntegrationSettings.Text = "CC65/CA65 Integration Settings"; + this.mnuDbgIntegrationSettings.Click += new System.EventHandler(this.mnuDbgIntegrationSettings_Click); // // frmDebugger // @@ -853,6 +882,9 @@ this.Controls.Add(this.ctrlMesenMenuStrip1); this.Name = "frmDebugger"; this.Text = "Debugger"; + this.Controls.SetChildIndex(this.ctrlMesenMenuStrip1, 0); + this.Controls.SetChildIndex(this.tsToolbar, 0); + this.Controls.SetChildIndex(this.ctrlSplitContainer, 0); this.ctrlMesenMenuStrip1.ResumeLayout(false); this.ctrlMesenMenuStrip1.PerformLayout(); this.ctrlSplitContainer.Panel1.ResumeLayout(false); @@ -960,5 +992,8 @@ private System.Windows.Forms.ToolStripMenuItem mnuBreakOnPowerCycleReset; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem12; private System.Windows.Forms.ToolStripMenuItem mnuBreakOnStp; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem importExportToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem mnuDbgIntegrationSettings; } } \ No newline at end of file diff --git a/UI/Debugger/frmDebugger.cs b/UI/Debugger/frmDebugger.cs index d526a3f..8c99d90 100644 --- a/UI/Debugger/frmDebugger.cs +++ b/UI/Debugger/frmDebugger.cs @@ -385,6 +385,13 @@ namespace Mesen.GUI.Debugger ctrlDisassemblyView.CodeViewer.BaseFont = newFont; } + + private void mnuDbgIntegrationSettings_Click(object sender, EventArgs e) + { + using(frmIntegrationSettings frm = new frmIntegrationSettings()) { + frm.ShowDialog(); + } + } } public enum CpuVector diff --git a/UI/UI.csproj b/UI/UI.csproj index 104edbc..db0afe8 100644 --- a/UI/UI.csproj +++ b/UI/UI.csproj @@ -209,6 +209,7 @@ + @@ -283,6 +284,12 @@ frmBreakOn.cs + + Form + + + frmIntegrationSettings.cs + UserControl @@ -791,6 +798,9 @@ frmBreakOn.cs + + frmIntegrationSettings.cs + ctrlLabelList.cs