From d764c28bd8caf3dee4483bf84abfa9aeb779edad Mon Sep 17 00:00:00 2001 From: Sour Date: Thu, 10 Jan 2019 20:36:56 -0500 Subject: [PATCH] Debugger: Import Settings - Add specific options for Work/Save RAM for DBG file imports --- GUI.NET/Config/DebugInfo.cs | 2 + GUI.NET/Debugger/DbgImporter.cs | 13 +++++-- .../Debugger/frmImportSettings.Designer.cs | 39 ++++++++++++++++--- GUI.NET/Debugger/frmImportSettings.cs | 2 + 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/GUI.NET/Config/DebugInfo.cs b/GUI.NET/Config/DebugInfo.cs index c974462e..391ec14b 100644 --- a/GUI.NET/Config/DebugInfo.cs +++ b/GUI.NET/Config/DebugInfo.cs @@ -402,6 +402,8 @@ namespace Mesen.GUI.Config public bool ResetLabelsOnImport = true; public bool DbgImportRamLabels = true; + public bool DbgImportWorkRamLabels = true; + public bool DbgImportSaveRamLabels = true; public bool DbgImportPrgRomLabels = true; public bool DbgImportComments = true; diff --git a/GUI.NET/Debugger/DbgImporter.cs b/GUI.NET/Debugger/DbgImporter.cs index 754e0838..f78cdf40 100644 --- a/GUI.NET/Debugger/DbgImporter.cs +++ b/GUI.NET/Debugger/DbgImporter.cs @@ -765,10 +765,17 @@ namespace Mesen.GUI.Debugger } if(config.DbgImportRamLabels) { labels.AddRange(_ramLabels.Values); - labels.AddRange(_workRamLabels.Values); - labels.AddRange(_saveRamLabels.Values); - labelCount += _ramLabels.Count + _workRamLabels.Count + _saveRamLabels.Count; + labelCount += _ramLabels.Count; } + if(config.DbgImportWorkRamLabels) { + labels.AddRange(_workRamLabels.Values); + labelCount += _workRamLabels.Count; + } + if(config.DbgImportSaveRamLabels) { + labels.AddRange(_saveRamLabels.Values); + labelCount += _saveRamLabels.Count; + } + LabelManager.SetLabels(labels, true); if(!silent) { diff --git a/GUI.NET/Debugger/frmImportSettings.Designer.cs b/GUI.NET/Debugger/frmImportSettings.Designer.cs index 9b8f2983..fafd2cc8 100644 --- a/GUI.NET/Debugger/frmImportSettings.Designer.cs +++ b/GUI.NET/Debugger/frmImportSettings.Designer.cs @@ -33,6 +33,8 @@ this.chkDbgImportComments = new System.Windows.Forms.CheckBox(); this.chkDbgImportPrgRomLabels = new System.Windows.Forms.CheckBox(); this.chkDbgImportRamLabels = new System.Windows.Forms.CheckBox(); + this.chkDbgImportWorkRamLabels = new System.Windows.Forms.CheckBox(); + this.chkDbgImportSaveRamLabels = new System.Windows.Forms.CheckBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.chkMlbImportPrgRomLabels = new System.Windows.Forms.CheckBox(); @@ -90,25 +92,28 @@ // this.tableLayoutPanel2.ColumnCount = 1; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Controls.Add(this.chkDbgImportComments, 0, 2); - this.tableLayoutPanel2.Controls.Add(this.chkDbgImportPrgRomLabels, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.chkDbgImportComments, 0, 4); this.tableLayoutPanel2.Controls.Add(this.chkDbgImportRamLabels, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.chkDbgImportWorkRamLabels, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.chkDbgImportPrgRomLabels, 0, 3); + this.tableLayoutPanel2.Controls.Add(this.chkDbgImportSaveRamLabels, 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 = 4; + this.tableLayoutPanel2.RowCount = 6; + 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()); 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, 151); this.tableLayoutPanel2.TabIndex = 0; // // chkDbgImportComments // this.chkDbgImportComments.AutoSize = true; - this.chkDbgImportComments.Location = new System.Drawing.Point(3, 49); + this.chkDbgImportComments.Location = new System.Drawing.Point(3, 95); this.chkDbgImportComments.Name = "chkDbgImportComments"; this.chkDbgImportComments.Size = new System.Drawing.Size(106, 17); this.chkDbgImportComments.TabIndex = 2; @@ -118,7 +123,7 @@ // chkDbgImportPrgRomLabels // this.chkDbgImportPrgRomLabels.AutoSize = true; - this.chkDbgImportPrgRomLabels.Location = new System.Drawing.Point(3, 26); + this.chkDbgImportPrgRomLabels.Location = new System.Drawing.Point(3, 72); this.chkDbgImportPrgRomLabels.Name = "chkDbgImportPrgRomLabels"; this.chkDbgImportPrgRomLabels.Size = new System.Drawing.Size(139, 17); this.chkDbgImportPrgRomLabels.TabIndex = 1; @@ -135,6 +140,26 @@ this.chkDbgImportRamLabels.Text = "Import RAM labels"; this.chkDbgImportRamLabels.UseVisualStyleBackColor = true; // + // chkDbgImportWorkRamLabels + // + this.chkDbgImportWorkRamLabels.AutoSize = true; + this.chkDbgImportWorkRamLabels.Location = new System.Drawing.Point(3, 26); + this.chkDbgImportWorkRamLabels.Name = "chkDbgImportWorkRamLabels"; + this.chkDbgImportWorkRamLabels.Size = new System.Drawing.Size(141, 17); + this.chkDbgImportWorkRamLabels.TabIndex = 3; + this.chkDbgImportWorkRamLabels.Text = "Import Work RAM labels"; + this.chkDbgImportWorkRamLabels.UseVisualStyleBackColor = true; + // + // chkDbgImportSaveRamLabels + // + this.chkDbgImportSaveRamLabels.AutoSize = true; + this.chkDbgImportSaveRamLabels.Location = new System.Drawing.Point(3, 49); + this.chkDbgImportSaveRamLabels.Name = "chkDbgImportSaveRamLabels"; + this.chkDbgImportSaveRamLabels.Size = new System.Drawing.Size(140, 17); + this.chkDbgImportSaveRamLabels.TabIndex = 4; + this.chkDbgImportSaveRamLabels.Text = "Import Save RAM labels"; + this.chkDbgImportSaveRamLabels.UseVisualStyleBackColor = true; + // // groupBox2 // this.groupBox2.Controls.Add(this.tableLayoutPanel3); @@ -310,5 +335,7 @@ private System.Windows.Forms.GroupBox grpGeneral; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel4; private System.Windows.Forms.CheckBox chkResetLabelsOnImport; + private System.Windows.Forms.CheckBox chkDbgImportWorkRamLabels; + private System.Windows.Forms.CheckBox chkDbgImportSaveRamLabels; } } \ No newline at end of file diff --git a/GUI.NET/Debugger/frmImportSettings.cs b/GUI.NET/Debugger/frmImportSettings.cs index 4531205e..6ccc6725 100644 --- a/GUI.NET/Debugger/frmImportSettings.cs +++ b/GUI.NET/Debugger/frmImportSettings.cs @@ -24,6 +24,8 @@ namespace Mesen.GUI.Debugger AddBinding("DbgImportRamLabels", chkDbgImportRamLabels); AddBinding("DbgImportPrgRomLabels", chkDbgImportPrgRomLabels); + AddBinding("DbgImportWorkRamLabels", chkDbgImportWorkRamLabels); + AddBinding("DbgImportSaveRamLabels", chkDbgImportSaveRamLabels); AddBinding("DbgImportComments", chkDbgImportComments); AddBinding("MlbImportInternalRamLabels", chkMlbImportInternalRamLabels);