Debugger: Added CC65 integration settings

This commit is contained in:
Sour 2019-05-03 17:16:43 -04:00
parent 148b1ed17f
commit 702b609381
10 changed files with 558 additions and 24 deletions

View file

@ -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;
}
}

View file

@ -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()
{

View file

@ -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<int, LineInfo> 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<CodeLabel> labels = new List<CodeLabel>(_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) {

View file

@ -0,0 +1,291 @@
namespace Mesen.GUI.Debugger
{
partial class frmIntegrationSettings
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if(disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View file

@ -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);
}
}
}

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -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<CodeLabel>();
@ -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();
}

View file

@ -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;
}
}

View file

@ -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

View file

@ -209,6 +209,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Config\AudioConfig.cs" />
<Compile Include="Config\DbgIntegrationConfig.cs" />
<Compile Include="Config\AviRecordConfig.cs" />
<Compile Include="Config\BaseConfig.cs" />
<Compile Include="Config\ConfigAttributes.cs" />
@ -283,6 +284,12 @@
<DependentUpon>frmBreakOn.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\Integration\DbgImporter.cs" />
<Compile Include="Debugger\Integration\frmIntegrationSettings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Debugger\Integration\frmIntegrationSettings.Designer.cs">
<DependentUpon>frmIntegrationSettings.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\Labels\CodeLabel.cs" />
<Compile Include="Debugger\Labels\ctrlLabelList.cs">
<SubType>UserControl</SubType>
@ -791,6 +798,9 @@
<EmbeddedResource Include="Debugger\frmBreakOn.resx">
<DependentUpon>frmBreakOn.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\Integration\frmIntegrationSettings.resx">
<DependentUpon>frmIntegrationSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\Labels\ctrlLabelList.resx">
<DependentUpon>ctrlLabelList.cs</DependentUpon>
</EmbeddedResource>