Debugger: Added highlight color customization to memory viewer

This commit is contained in:
Sour 2017-12-26 17:55:08 -05:00
parent c12122d69c
commit 3defa304c6
12 changed files with 633 additions and 72 deletions

View file

@ -136,6 +136,14 @@ namespace Mesen.GUI.Config
public bool RamHighlightChrReadBytes = false;
public bool RamHighlightCodeBytes = false;
public bool RamHighlightDataBytes = false;
public XmlColor RamReadColor = Color.Blue;
public XmlColor RamWriteColor = Color.Red;
public XmlColor RamExecColor = Color.Green;
public XmlColor RamCodeByteColor = Color.DarkSeaGreen;
public XmlColor RamDataByteColor = Color.LightSteelBlue;
public XmlColor RamChrDrawnByteColor = Color.DarkSeaGreen;
public XmlColor RamChrReadByteColor = Color.LightSteelBlue;
public Size MemoryViewerSize = new Size(0, 0);
public int WindowWidth = -1;

View file

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using Be.Windows.Forms;
using Mesen.GUI.Config;
namespace Mesen.GUI.Debugger
{
@ -108,21 +109,21 @@ namespace Mesen.GUI.Debugger
if(_cdlData != null) {
if((_cdlData[index] & 0x01) != 0 && _highlightCodeBytes) {
//Code
bgColor = Color.DarkSeaGreen;
bgColor = ConfigManager.Config.DebugInfo.RamCodeByteColor;
} else if((_cdlData[index] & 0x02) != 0 && _highlightDataBytes) {
//Data
bgColor = Color.LightSteelBlue;
bgColor = ConfigManager.Config.DebugInfo.RamDataByteColor;
}
}
if(_freezeState != null && _freezeState[index]) {
return Color.Magenta;
} else if(_showExec && _execStamps[index] != 0 && framesSinceExec >= 0 && (framesSinceExec < _framesToFade || _framesToFade == 0)) {
return Color.FromArgb(alpha, DarkerColor(Color.Green, (_framesToFade - framesSinceExec) / _framesToFade));
return Color.FromArgb(alpha, DarkerColor(ConfigManager.Config.DebugInfo.RamExecColor, (_framesToFade - framesSinceExec) / _framesToFade));
} else if(_showWrite && _writeStamps[index] != 0 && framesSinceWrite >= 0 && (framesSinceWrite < _framesToFade || _framesToFade == 0)) {
return Color.FromArgb(alpha, DarkerColor(Color.Red, (_framesToFade - framesSinceWrite) / _framesToFade));
return Color.FromArgb(alpha, DarkerColor(ConfigManager.Config.DebugInfo.RamWriteColor, (_framesToFade - framesSinceWrite) / _framesToFade));
} else if(_showRead && _readStamps[index] != 0 && framesSinceRead >= 0 && (framesSinceRead < _framesToFade || _framesToFade == 0)) {
return Color.FromArgb(alpha, DarkerColor(Color.Blue, (_framesToFade - framesSinceRead) / _framesToFade));
return Color.FromArgb(alpha, DarkerColor(ConfigManager.Config.DebugInfo.RamReadColor, (_framesToFade - framesSinceRead) / _framesToFade));
}
return Color.FromArgb(alpha, Color.Black);

View file

@ -1,6 +1,7 @@
using System;
using System.Drawing;
using Be.Windows.Forms;
using Mesen.GUI.Config;
namespace Mesen.GUI.Debugger
{
@ -35,10 +36,10 @@ namespace Mesen.GUI.Debugger
if(_cdlData != null) {
if((_cdlData[index] & 0x01) != 0 && _highlightDrawnBytes) {
//Drawn (CHR ROM)
bgColor = Color.DarkSeaGreen;
bgColor = ConfigManager.Config.DebugInfo.RamChrDrawnByteColor;
} else if((_cdlData[index] & 0x02) != 0 && _highlightReadBytes) {
//Read (CHR ROM)
bgColor = Color.LightSteelBlue;
bgColor = ConfigManager.Config.DebugInfo.RamChrReadByteColor;
}
}

View file

@ -355,7 +355,7 @@ namespace Mesen.GUI.Debugger
private void mnuConfigureColors_Click(object sender, EventArgs e)
{
using(frmAssemblerColors frm = new frmAssemblerColors()) {
if(frm.ShowDialog() == DialogResult.OK) {
if(frm.ShowDialog(this, this) == DialogResult.OK) {
UpdateCodeHighlighting();
}
}

View file

@ -38,6 +38,8 @@
this.lblAddress = new System.Windows.Forms.Label();
this.lblComment = new System.Windows.Forms.Label();
this.picOpcode = new System.Windows.Forms.PictureBox();
this.btnReset = new System.Windows.Forms.Button();
this.baseConfigPanel.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picComment)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picAddress)).BeginInit();
@ -48,8 +50,10 @@
//
// baseConfigPanel
//
this.baseConfigPanel.Controls.Add(this.btnReset);
this.baseConfigPanel.Location = new System.Drawing.Point(0, 210);
this.baseConfigPanel.Size = new System.Drawing.Size(238, 29);
this.baseConfigPanel.Size = new System.Drawing.Size(310, 29);
this.baseConfigPanel.Controls.SetChildIndex(this.btnReset, 0);
//
// tableLayoutPanel1
//
@ -76,7 +80,7 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
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(238, 210);
this.tableLayoutPanel1.Size = new System.Drawing.Size(310, 210);
this.tableLayoutPanel1.TabIndex = 2;
//
// picComment
@ -184,16 +188,28 @@
this.picOpcode.TabStop = false;
this.picOpcode.Click += new System.EventHandler(this.picColorPicker_Click);
//
// btnReset
//
this.btnReset.Location = new System.Drawing.Point(3, 3);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(102, 23);
this.btnReset.TabIndex = 4;
this.btnReset.Text = "Use default colors";
this.btnReset.UseVisualStyleBackColor = true;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// frmAssemblerColors
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(238, 239);
this.ClientSize = new System.Drawing.Size(310, 239);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "frmAssemblerColors";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Configure Colors...";
this.Controls.SetChildIndex(this.baseConfigPanel, 0);
this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);
this.baseConfigPanel.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picComment)).EndInit();
@ -218,5 +234,6 @@
private System.Windows.Forms.PictureBox picImmediate;
private System.Windows.Forms.PictureBox picLabelDefinition;
private System.Windows.Forms.PictureBox picOpcode;
private System.Windows.Forms.Button btnReset;
}
}

View file

@ -50,5 +50,14 @@ namespace Mesen.GUI.Debugger
ConfigManager.ApplyChanges();
}
}
private void btnReset_Click(object sender, EventArgs e)
{
picOpcode.BackColor = Color.DarkSlateGray;
picLabelDefinition.BackColor = Color.Blue;
picImmediate.BackColor = Color.Chocolate;
picAddress.BackColor = Color.DarkRed;
picComment.BackColor = Color.Green;
}
}
}

View file

@ -58,6 +58,12 @@
this.mnuFadeNever = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator();
this.mnuCustomFadeSpeed = new System.Windows.Forms.ToolStripMenuItem();
this.dataTypeHighlightingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHighlightCodeBytes = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHighlightDataBytes = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator();
this.mnuHighlightChrDrawnBytes = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHighlightChrReadBytes = new System.Windows.Forms.ToolStripMenuItem();
this.fadeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHideUnusedBytes = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHideReadBytes = new System.Windows.Forms.ToolStripMenuItem();
@ -88,12 +94,7 @@
this.tpgProfiler = new System.Windows.Forms.TabPage();
this.ctrlProfiler = new Mesen.GUI.Debugger.Controls.ctrlProfiler();
this.tmrRefresh = new System.Windows.Forms.Timer(this.components);
this.dataTypeHighlightingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHighlightCodeBytes = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHighlightDataBytes = new System.Windows.Forms.ToolStripMenuItem();
this.mnuHighlightChrDrawnBytes = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem11 = new System.Windows.Forms.ToolStripSeparator();
this.mnuHighlightChrReadBytes = new System.Windows.Forms.ToolStripMenuItem();
this.mnuConfigureColors = new System.Windows.Forms.ToolStripMenuItem();
this.flowLayoutPanel1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout();
@ -243,8 +244,9 @@
this.dataTypeHighlightingToolStripMenuItem,
this.fadeToolStripMenuItem,
this.toolStripMenuItem5,
this.mnuRefresh,
this.mnuConfigureColors,
this.fontSizeToolStripMenuItem,
this.mnuRefresh,
this.toolStripMenuItem2,
this.mnuAutoRefresh,
this.mnuShowCharacters});
@ -268,7 +270,7 @@
//
this.mnuHightlightReads.CheckOnClick = true;
this.mnuHightlightReads.Name = "mnuHightlightReads";
this.mnuHightlightReads.Size = new System.Drawing.Size(152, 22);
this.mnuHightlightReads.Size = new System.Drawing.Size(133, 22);
this.mnuHightlightReads.Text = "Reads";
this.mnuHightlightReads.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
//
@ -276,7 +278,7 @@
//
this.mnuHighlightWrites.CheckOnClick = true;
this.mnuHighlightWrites.Name = "mnuHighlightWrites";
this.mnuHighlightWrites.Size = new System.Drawing.Size(152, 22);
this.mnuHighlightWrites.Size = new System.Drawing.Size(133, 22);
this.mnuHighlightWrites.Text = "Writes";
this.mnuHighlightWrites.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
//
@ -284,14 +286,14 @@
//
this.mnuHighlightExecution.CheckOnClick = true;
this.mnuHighlightExecution.Name = "mnuHighlightExecution";
this.mnuHighlightExecution.Size = new System.Drawing.Size(152, 22);
this.mnuHighlightExecution.Size = new System.Drawing.Size(133, 22);
this.mnuHighlightExecution.Text = "Execution";
this.mnuHighlightExecution.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
//
// toolStripMenuItem6
//
this.toolStripMenuItem6.Name = "toolStripMenuItem6";
this.toolStripMenuItem6.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem6.Size = new System.Drawing.Size(130, 6);
//
// fadeSpeedToolStripMenuItem
//
@ -303,13 +305,13 @@
this.toolStripMenuItem7,
this.mnuCustomFadeSpeed});
this.fadeSpeedToolStripMenuItem.Name = "fadeSpeedToolStripMenuItem";
this.fadeSpeedToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.fadeSpeedToolStripMenuItem.Size = new System.Drawing.Size(133, 22);
this.fadeSpeedToolStripMenuItem.Text = "Fade speed";
//
// mnuFadeSlow
//
this.mnuFadeSlow.Name = "mnuFadeSlow";
this.mnuFadeSlow.Size = new System.Drawing.Size(152, 22);
this.mnuFadeSlow.Size = new System.Drawing.Size(136, 22);
this.mnuFadeSlow.Text = "Slow";
this.mnuFadeSlow.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
//
@ -318,36 +320,81 @@
this.mnuFadeNormal.Checked = true;
this.mnuFadeNormal.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnuFadeNormal.Name = "mnuFadeNormal";
this.mnuFadeNormal.Size = new System.Drawing.Size(152, 22);
this.mnuFadeNormal.Size = new System.Drawing.Size(136, 22);
this.mnuFadeNormal.Text = "Normal";
this.mnuFadeNormal.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
//
// mnuFadeFast
//
this.mnuFadeFast.Name = "mnuFadeFast";
this.mnuFadeFast.Size = new System.Drawing.Size(152, 22);
this.mnuFadeFast.Size = new System.Drawing.Size(136, 22);
this.mnuFadeFast.Text = "Fast";
this.mnuFadeFast.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
//
// mnuFadeNever
//
this.mnuFadeNever.Name = "mnuFadeNever";
this.mnuFadeNever.Size = new System.Drawing.Size(152, 22);
this.mnuFadeNever.Size = new System.Drawing.Size(136, 22);
this.mnuFadeNever.Text = "Do not fade";
this.mnuFadeNever.Click += new System.EventHandler(this.mnuFadeSpeed_Click);
//
// toolStripMenuItem7
//
this.toolStripMenuItem7.Name = "toolStripMenuItem7";
this.toolStripMenuItem7.Size = new System.Drawing.Size(149, 6);
this.toolStripMenuItem7.Size = new System.Drawing.Size(133, 6);
//
// mnuCustomFadeSpeed
//
this.mnuCustomFadeSpeed.Name = "mnuCustomFadeSpeed";
this.mnuCustomFadeSpeed.Size = new System.Drawing.Size(152, 22);
this.mnuCustomFadeSpeed.Size = new System.Drawing.Size(136, 22);
this.mnuCustomFadeSpeed.Text = "Custom...";
this.mnuCustomFadeSpeed.Click += new System.EventHandler(this.mnuCustomFadeSpeed_Click);
//
// dataTypeHighlightingToolStripMenuItem
//
this.dataTypeHighlightingToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuHighlightCodeBytes,
this.mnuHighlightDataBytes,
this.toolStripMenuItem11,
this.mnuHighlightChrDrawnBytes,
this.mnuHighlightChrReadBytes});
this.dataTypeHighlightingToolStripMenuItem.Name = "dataTypeHighlightingToolStripMenuItem";
this.dataTypeHighlightingToolStripMenuItem.Size = new System.Drawing.Size(228, 22);
this.dataTypeHighlightingToolStripMenuItem.Text = "Data Type Highlighting";
//
// mnuHighlightCodeBytes
//
this.mnuHighlightCodeBytes.CheckOnClick = true;
this.mnuHighlightCodeBytes.Name = "mnuHighlightCodeBytes";
this.mnuHighlightCodeBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightCodeBytes.Text = "Code bytes (PRG ROM)";
//
// mnuHighlightDataBytes
//
this.mnuHighlightDataBytes.CheckOnClick = true;
this.mnuHighlightDataBytes.Name = "mnuHighlightDataBytes";
this.mnuHighlightDataBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightDataBytes.Text = "Data bytes (PRG ROM)";
//
// toolStripMenuItem11
//
this.toolStripMenuItem11.Name = "toolStripMenuItem11";
this.toolStripMenuItem11.Size = new System.Drawing.Size(201, 6);
//
// mnuHighlightChrDrawnBytes
//
this.mnuHighlightChrDrawnBytes.CheckOnClick = true;
this.mnuHighlightChrDrawnBytes.Name = "mnuHighlightChrDrawnBytes";
this.mnuHighlightChrDrawnBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightChrDrawnBytes.Text = "Drawn bytes (CHR ROM)";
//
// mnuHighlightChrReadBytes
//
this.mnuHighlightChrReadBytes.CheckOnClick = true;
this.mnuHighlightChrReadBytes.Name = "mnuHighlightChrReadBytes";
this.mnuHighlightChrReadBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightChrReadBytes.Text = "Read bytes (CHR ROM)";
//
// fadeToolStripMenuItem
//
this.fadeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -618,50 +665,13 @@
this.tmrRefresh.Enabled = true;
this.tmrRefresh.Tick += new System.EventHandler(this.tmrRefresh_Tick);
//
// dataTypeHighlightingToolStripMenuItem
// mnuConfigureColors
//
this.dataTypeHighlightingToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.mnuHighlightCodeBytes,
this.mnuHighlightDataBytes,
this.toolStripMenuItem11,
this.mnuHighlightChrDrawnBytes,
this.mnuHighlightChrReadBytes});
this.dataTypeHighlightingToolStripMenuItem.Name = "dataTypeHighlightingToolStripMenuItem";
this.dataTypeHighlightingToolStripMenuItem.Size = new System.Drawing.Size(228, 22);
this.dataTypeHighlightingToolStripMenuItem.Text = "Data Type Highlighting";
//
// mnuHighlightCodeBytes
//
this.mnuHighlightCodeBytes.CheckOnClick = true;
this.mnuHighlightCodeBytes.Name = "mnuHighlightCodeBytes";
this.mnuHighlightCodeBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightCodeBytes.Text = "Code bytes (PRG ROM)";
//
// mnuHighlightDataBytes
//
this.mnuHighlightDataBytes.CheckOnClick = true;
this.mnuHighlightDataBytes.Name = "mnuHighlightDataBytes";
this.mnuHighlightDataBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightDataBytes.Text = "Data bytes (PRG ROM)";
//
// mnuHighlightChrDrawnBytes
//
this.mnuHighlightChrDrawnBytes.CheckOnClick = true;
this.mnuHighlightChrDrawnBytes.Name = "mnuHighlightChrDrawnBytes";
this.mnuHighlightChrDrawnBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightChrDrawnBytes.Text = "Drawn bytes (CHR ROM)";
//
// toolStripMenuItem11
//
this.toolStripMenuItem11.Name = "toolStripMenuItem11";
this.toolStripMenuItem11.Size = new System.Drawing.Size(201, 6);
//
// mnuHighlightChrReadBytes
//
this.mnuHighlightChrReadBytes.CheckOnClick = true;
this.mnuHighlightChrReadBytes.Name = "mnuHighlightChrReadBytes";
this.mnuHighlightChrReadBytes.Size = new System.Drawing.Size(204, 22);
this.mnuHighlightChrReadBytes.Text = "Read bytes (CHR ROM)";
this.mnuConfigureColors.Image = global::Mesen.GUI.Properties.Resources.PipetteSmall;
this.mnuConfigureColors.Name = "mnuConfigureColors";
this.mnuConfigureColors.Size = new System.Drawing.Size(228, 22);
this.mnuConfigureColors.Text = "Configure Colors";
this.mnuConfigureColors.Click += new System.EventHandler(this.mnuConfigureColors_Click);
//
// frmMemoryViewer
//
@ -756,5 +766,6 @@
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem11;
private System.Windows.Forms.ToolStripMenuItem mnuHighlightChrDrawnBytes;
private System.Windows.Forms.ToolStripMenuItem mnuHighlightChrReadBytes;
private System.Windows.Forms.ToolStripMenuItem mnuConfigureColors;
}
}

View file

@ -493,5 +493,14 @@ namespace Mesen.GUI.Debugger
this.UpdateConfig();
this.UpdateByteColorProvider();
}
private void mnuConfigureColors_Click(object sender, EventArgs e)
{
using(frmMemoryViewerColors frm = new frmMemoryViewerColors()) {
if(frm.ShowDialog(this, this) == DialogResult.OK) {
this.RefreshData();
}
}
}
}
}

View file

@ -0,0 +1,304 @@
namespace Mesen.GUI.Debugger
{
partial class frmMemoryViewerColors
{
/// <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.picChrDrawnByte = new System.Windows.Forms.PictureBox();
this.lblChrDrawnByte = new System.Windows.Forms.Label();
this.lblCodeByte = new System.Windows.Forms.Label();
this.lblRead = new System.Windows.Forms.Label();
this.picRead = new System.Windows.Forms.PictureBox();
this.lblWrite = new System.Windows.Forms.Label();
this.lblExecute = new System.Windows.Forms.Label();
this.picCodeByte = new System.Windows.Forms.PictureBox();
this.picWrite = new System.Windows.Forms.PictureBox();
this.picExecute = new System.Windows.Forms.PictureBox();
this.picDataByte = new System.Windows.Forms.PictureBox();
this.picChrReadByte = new System.Windows.Forms.PictureBox();
this.lblChrReadByte = new System.Windows.Forms.Label();
this.lblDataByte = new System.Windows.Forms.Label();
this.btnReset = new System.Windows.Forms.Button();
this.baseConfigPanel.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picChrDrawnByte)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picRead)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picCodeByte)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picWrite)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picExecute)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picDataByte)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.picChrReadByte)).BeginInit();
this.SuspendLayout();
//
// baseConfigPanel
//
this.baseConfigPanel.Controls.Add(this.btnReset);
this.baseConfigPanel.Location = new System.Drawing.Point(0, 122);
this.baseConfigPanel.Size = new System.Drawing.Size(453, 29);
this.baseConfigPanel.Controls.SetChildIndex(this.btnReset, 0);
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 8;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Controls.Add(this.picChrDrawnByte, 1, 2);
this.tableLayoutPanel1.Controls.Add(this.lblChrDrawnByte, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.lblCodeByte, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.lblRead, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.picRead, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.lblWrite, 3, 0);
this.tableLayoutPanel1.Controls.Add(this.lblExecute, 6, 0);
this.tableLayoutPanel1.Controls.Add(this.picCodeByte, 1, 1);
this.tableLayoutPanel1.Controls.Add(this.picWrite, 4, 0);
this.tableLayoutPanel1.Controls.Add(this.picExecute, 7, 0);
this.tableLayoutPanel1.Controls.Add(this.picDataByte, 4, 1);
this.tableLayoutPanel1.Controls.Add(this.picChrReadByte, 4, 2);
this.tableLayoutPanel1.Controls.Add(this.lblChrReadByte, 3, 2);
this.tableLayoutPanel1.Controls.Add(this.lblDataByte, 3, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 6;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
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(453, 122);
this.tableLayoutPanel1.TabIndex = 2;
//
// picChrDrawnByte
//
this.picChrDrawnByte.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picChrDrawnByte.Cursor = System.Windows.Forms.Cursors.Hand;
this.picChrDrawnByte.Location = new System.Drawing.Point(102, 79);
this.picChrDrawnByte.Name = "picChrDrawnByte";
this.picChrDrawnByte.Size = new System.Drawing.Size(32, 32);
this.picChrDrawnByte.TabIndex = 7;
this.picChrDrawnByte.TabStop = false;
this.picChrDrawnByte.Click += new System.EventHandler(this.picColorPicker_Click);
//
// lblChrDrawnByte
//
this.lblChrDrawnByte.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblChrDrawnByte.AutoSize = true;
this.lblChrDrawnByte.Location = new System.Drawing.Point(3, 88);
this.lblChrDrawnByte.Name = "lblChrDrawnByte";
this.lblChrDrawnByte.Size = new System.Drawing.Size(91, 13);
this.lblChrDrawnByte.TabIndex = 4;
this.lblChrDrawnByte.Text = "CHR Drawn Byte:";
//
// lblCodeByte
//
this.lblCodeByte.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblCodeByte.AutoSize = true;
this.lblCodeByte.Location = new System.Drawing.Point(3, 50);
this.lblCodeByte.Name = "lblCodeByte";
this.lblCodeByte.Size = new System.Drawing.Size(59, 13);
this.lblCodeByte.TabIndex = 2;
this.lblCodeByte.Text = "Code Byte:";
//
// lblRead
//
this.lblRead.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblRead.AutoSize = true;
this.lblRead.Location = new System.Drawing.Point(3, 12);
this.lblRead.Name = "lblRead";
this.lblRead.Size = new System.Drawing.Size(36, 13);
this.lblRead.TabIndex = 0;
this.lblRead.Text = "Read:";
//
// picRead
//
this.picRead.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picRead.Cursor = System.Windows.Forms.Cursors.Hand;
this.picRead.Location = new System.Drawing.Point(102, 3);
this.picRead.Name = "picRead";
this.picRead.Size = new System.Drawing.Size(32, 32);
this.picRead.TabIndex = 5;
this.picRead.TabStop = false;
this.picRead.Click += new System.EventHandler(this.picColorPicker_Click);
//
// lblWrite
//
this.lblWrite.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblWrite.AutoSize = true;
this.lblWrite.Location = new System.Drawing.Point(160, 12);
this.lblWrite.Name = "lblWrite";
this.lblWrite.Size = new System.Drawing.Size(35, 13);
this.lblWrite.TabIndex = 10;
this.lblWrite.Text = "Write:";
//
// lblExecute
//
this.lblExecute.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblExecute.AutoSize = true;
this.lblExecute.Location = new System.Drawing.Point(317, 12);
this.lblExecute.Name = "lblExecute";
this.lblExecute.Size = new System.Drawing.Size(49, 13);
this.lblExecute.TabIndex = 11;
this.lblExecute.Text = "Execute:";
//
// picCodeByte
//
this.picCodeByte.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picCodeByte.Cursor = System.Windows.Forms.Cursors.Hand;
this.picCodeByte.Location = new System.Drawing.Point(102, 41);
this.picCodeByte.Name = "picCodeByte";
this.picCodeByte.Size = new System.Drawing.Size(32, 32);
this.picCodeByte.TabIndex = 6;
this.picCodeByte.TabStop = false;
this.picCodeByte.Click += new System.EventHandler(this.picColorPicker_Click);
//
// picWrite
//
this.picWrite.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picWrite.Cursor = System.Windows.Forms.Cursors.Hand;
this.picWrite.Location = new System.Drawing.Point(259, 3);
this.picWrite.Name = "picWrite";
this.picWrite.Size = new System.Drawing.Size(32, 32);
this.picWrite.TabIndex = 8;
this.picWrite.TabStop = false;
this.picWrite.Click += new System.EventHandler(this.picColorPicker_Click);
//
// picExecute
//
this.picExecute.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picExecute.Cursor = System.Windows.Forms.Cursors.Hand;
this.picExecute.Location = new System.Drawing.Point(416, 3);
this.picExecute.Name = "picExecute";
this.picExecute.Size = new System.Drawing.Size(32, 32);
this.picExecute.TabIndex = 9;
this.picExecute.TabStop = false;
this.picExecute.Click += new System.EventHandler(this.picColorPicker_Click);
//
// picDataByte
//
this.picDataByte.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picDataByte.Cursor = System.Windows.Forms.Cursors.Hand;
this.picDataByte.Location = new System.Drawing.Point(259, 41);
this.picDataByte.Name = "picDataByte";
this.picDataByte.Size = new System.Drawing.Size(32, 32);
this.picDataByte.TabIndex = 12;
this.picDataByte.TabStop = false;
this.picDataByte.Click += new System.EventHandler(this.picColorPicker_Click);
//
// picChrReadByte
//
this.picChrReadByte.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picChrReadByte.Cursor = System.Windows.Forms.Cursors.Hand;
this.picChrReadByte.Location = new System.Drawing.Point(259, 79);
this.picChrReadByte.Name = "picChrReadByte";
this.picChrReadByte.Size = new System.Drawing.Size(32, 32);
this.picChrReadByte.TabIndex = 13;
this.picChrReadByte.TabStop = false;
this.picChrReadByte.Click += new System.EventHandler(this.picColorPicker_Click);
//
// lblChrReadByte
//
this.lblChrReadByte.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblChrReadByte.AutoSize = true;
this.lblChrReadByte.Location = new System.Drawing.Point(160, 88);
this.lblChrReadByte.Name = "lblChrReadByte";
this.lblChrReadByte.Size = new System.Drawing.Size(86, 13);
this.lblChrReadByte.TabIndex = 3;
this.lblChrReadByte.Text = "CHR Read Byte:";
//
// lblDataByte
//
this.lblDataByte.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblDataByte.AutoSize = true;
this.lblDataByte.Location = new System.Drawing.Point(160, 50);
this.lblDataByte.Name = "lblDataByte";
this.lblDataByte.Size = new System.Drawing.Size(57, 13);
this.lblDataByte.TabIndex = 1;
this.lblDataByte.Text = "Data Byte:";
//
// btnReset
//
this.btnReset.Location = new System.Drawing.Point(3, 3);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(102, 23);
this.btnReset.TabIndex = 3;
this.btnReset.Text = "Use default colors";
this.btnReset.UseVisualStyleBackColor = true;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// frmMemoryViewerColors
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(453, 151);
this.Controls.Add(this.tableLayoutPanel1);
this.Name = "frmMemoryViewerColors";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Configure Colors...";
this.Controls.SetChildIndex(this.baseConfigPanel, 0);
this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);
this.baseConfigPanel.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false);
this.tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.picChrDrawnByte)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picRead)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picCodeByte)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picWrite)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picExecute)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picDataByte)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.picChrReadByte)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
private System.Windows.Forms.Label lblChrDrawnByte;
private System.Windows.Forms.Label lblCodeByte;
private System.Windows.Forms.Label lblRead;
private System.Windows.Forms.Label lblChrReadByte;
private System.Windows.Forms.Label lblDataByte;
private System.Windows.Forms.PictureBox picExecute;
private System.Windows.Forms.PictureBox picWrite;
private System.Windows.Forms.PictureBox picChrDrawnByte;
private System.Windows.Forms.PictureBox picCodeByte;
private System.Windows.Forms.PictureBox picRead;
private System.Windows.Forms.Label lblWrite;
private System.Windows.Forms.Label lblExecute;
private System.Windows.Forms.PictureBox picDataByte;
private System.Windows.Forms.PictureBox picChrReadByte;
private System.Windows.Forms.Button btnReset;
}
}

View file

@ -0,0 +1,69 @@
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;
using Mesen.GUI.Config;
using Mesen.GUI.Forms;
namespace Mesen.GUI.Debugger
{
public partial class frmMemoryViewerColors : BaseConfigForm
{
public frmMemoryViewerColors()
{
InitializeComponent();
picRead.BackColor = ConfigManager.Config.DebugInfo.RamReadColor;
picWrite.BackColor = ConfigManager.Config.DebugInfo.RamWriteColor;
picExecute.BackColor = ConfigManager.Config.DebugInfo.RamExecColor;
picCodeByte.BackColor = ConfigManager.Config.DebugInfo.RamCodeByteColor;
picDataByte.BackColor = ConfigManager.Config.DebugInfo.RamDataByteColor;
picChrDrawnByte.BackColor = ConfigManager.Config.DebugInfo.RamChrDrawnByteColor;
picChrReadByte.BackColor = ConfigManager.Config.DebugInfo.RamChrReadByteColor;
}
private void picColorPicker_Click(object sender, EventArgs e)
{
using(ColorDialog cd = new ColorDialog()) {
cd.SolidColorOnly = true;
cd.AllowFullOpen = true;
cd.FullOpen = true;
cd.Color = ((PictureBox)sender).BackColor;
if(cd.ShowDialog() == DialogResult.OK) {
((PictureBox)sender).BackColor = cd.Color;
}
}
}
protected override void OnFormClosing(FormClosingEventArgs e)
{
base.OnFormClosing(e);
if(DialogResult == DialogResult.OK) {
ConfigManager.Config.DebugInfo.RamReadColor = picRead.BackColor;
ConfigManager.Config.DebugInfo.RamWriteColor = picWrite.BackColor;
ConfigManager.Config.DebugInfo.RamExecColor = picExecute.BackColor;
ConfigManager.Config.DebugInfo.RamCodeByteColor = picCodeByte.BackColor;
ConfigManager.Config.DebugInfo.RamDataByteColor = picDataByte.BackColor;
ConfigManager.Config.DebugInfo.RamChrDrawnByteColor = picChrDrawnByte.BackColor;
ConfigManager.Config.DebugInfo.RamChrReadByteColor = picChrReadByte.BackColor;
ConfigManager.ApplyChanges();
}
}
private void btnReset_Click(object sender, EventArgs e)
{
picRead.BackColor = Color.Blue;
picWrite.BackColor = Color.Red;
picExecute.BackColor = Color.Green;
picCodeByte.BackColor = Color.DarkSeaGreen;
picDataByte.BackColor = Color.LightSteelBlue;
picChrDrawnByte.BackColor = Color.DarkSeaGreen;
picChrReadByte.BackColor = Color.LightSteelBlue;
}
}
}

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

@ -486,6 +486,12 @@
<Compile Include="Debugger\frmAssembler.Designer.cs">
<DependentUpon>frmAssembler.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\frmMemoryViewerColors.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Debugger\frmMemoryViewerColors.Designer.cs">
<DependentUpon>frmMemoryViewerColors.cs</DependentUpon>
</Compile>
<Compile Include="Debugger\frmAssemblerColors.cs">
<SubType>Form</SubType>
</Compile>
@ -1101,6 +1107,9 @@
<EmbeddedResource Include="Debugger\frmAssembler.resx">
<DependentUpon>frmAssembler.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\frmMemoryViewerColors.resx">
<DependentUpon>frmMemoryViewerColors.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Debugger\frmAssemblerColors.resx">
<DependentUpon>frmAssemblerColors.cs</DependentUpon>
</EmbeddedResource>