Debugger: Memory Viewer - Added option to highlight the cursor's current row/column
This commit is contained in:
parent
b2b841421f
commit
8aa4d4a6ec
5 changed files with 83 additions and 27 deletions
|
@ -236,6 +236,7 @@ namespace Mesen.GUI.Config
|
||||||
public bool RamAutoRefresh = true;
|
public bool RamAutoRefresh = true;
|
||||||
public RefreshSpeed RamAutoRefreshSpeed = RefreshSpeed.Normal;
|
public RefreshSpeed RamAutoRefreshSpeed = RefreshSpeed.Normal;
|
||||||
public bool RamIgnoreRedundantWrites = false;
|
public bool RamIgnoreRedundantWrites = false;
|
||||||
|
public bool RamHighlightCurrentRowColumn = true;
|
||||||
public int RamColumnCount = 2;
|
public int RamColumnCount = 2;
|
||||||
|
|
||||||
public string RamFontFamily = BaseControl.MonospaceFontFamily;
|
public string RamFontFamily = BaseControl.MonospaceFontFamily;
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace Mesen.GUI.Debugger.Controls
|
||||||
this.ctrlHexBox.ShadowSelectionColor = Color.FromArgb(100, 60, 128, 200);
|
this.ctrlHexBox.ShadowSelectionColor = Color.FromArgb(100, 60, 128, 200);
|
||||||
this.ctrlHexBox.InfoBackColor = Color.FromArgb(235, 235, 235);
|
this.ctrlHexBox.InfoBackColor = Color.FromArgb(235, 235, 235);
|
||||||
this.ctrlHexBox.InfoForeColor = Color.Gray;
|
this.ctrlHexBox.InfoForeColor = Color.Gray;
|
||||||
|
this.ctrlHexBox.HighlightCurrentRowColumn = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnLoad(EventArgs e)
|
protected override void OnLoad(EventArgs e)
|
||||||
|
@ -420,6 +421,13 @@ namespace Mesen.GUI.Debugger.Controls
|
||||||
set { this.ctrlHexBox.ByteEditingMode = value; }
|
set { this.ctrlHexBox.ByteEditingMode = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public bool HighlightCurrentRowColumn
|
||||||
|
{
|
||||||
|
get { return this.ctrlHexBox.HighlightCurrentRowColumn; }
|
||||||
|
set { this.ctrlHexBox.HighlightCurrentRowColumn = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public delegate void ByteMouseHoverHandler(int address, Point position);
|
public delegate void ByteMouseHoverHandler(int address, Point position);
|
||||||
public event ByteMouseHoverHandler ByteMouseHover;
|
public event ByteMouseHoverHandler ByteMouseHover;
|
||||||
private void ctrlHexBox_MouseMove(object sender, MouseEventArgs e)
|
private void ctrlHexBox_MouseMove(object sender, MouseEventArgs e)
|
||||||
|
|
|
@ -2442,6 +2442,8 @@ namespace Be.Windows.Forms
|
||||||
r.Exclude(_recContent);
|
r.Exclude(_recContent);
|
||||||
e.Graphics.ExcludeClip(r);
|
e.Graphics.ExcludeClip(r);
|
||||||
|
|
||||||
|
e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.Default;
|
||||||
|
|
||||||
UpdateVisibilityBytes();
|
UpdateVisibilityBytes();
|
||||||
|
|
||||||
if(_caretVisible && _keyInterpreter.GetType() != typeof(StringKeyInterpreter)) {
|
if(_caretVisible && _keyInterpreter.GetType() != typeof(StringKeyInterpreter)) {
|
||||||
|
@ -2450,15 +2452,15 @@ namespace Be.Windows.Forms
|
||||||
e.Graphics.FillRectangle(Brushes.Yellow, _caretPos.X - 1, _caretPos.Y, caretWidth, caretHeight);
|
e.Graphics.FillRectangle(Brushes.Yellow, _caretPos.X - 1, _caretPos.Y, caretWidth, caretHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lineInfoVisible)
|
|
||||||
PaintLineInfo(e.Graphics, _startByte, _endByte);
|
|
||||||
|
|
||||||
PaintHexAndStringView(e.Graphics, _startByte, _endByte);
|
PaintHexAndStringView(e.Graphics, _startByte, _endByte);
|
||||||
if (_shadowSelectionVisible && _stringViewVisible)
|
if (_shadowSelectionVisible && _stringViewVisible)
|
||||||
PaintCurrentBytesSign(e.Graphics);
|
PaintCurrentBytesSign(e.Graphics);
|
||||||
|
|
||||||
|
if(_lineInfoVisible)
|
||||||
|
PaintLineInfo(e.Graphics, _startByte, _endByte);
|
||||||
if(_columnInfoVisible)
|
if(_columnInfoVisible)
|
||||||
PaintHeaderRow(e.Graphics);
|
PaintHeaderRow(e.Graphics);
|
||||||
|
|
||||||
if(_groupSeparatorVisible)
|
if(_groupSeparatorVisible)
|
||||||
PaintColumnSeparator(e.Graphics);
|
PaintColumnSeparator(e.Graphics);
|
||||||
|
|
||||||
|
@ -2483,6 +2485,7 @@ namespace Be.Windows.Forms
|
||||||
|
|
||||||
g.FillRectangle(backBrush, _recLineInfo.X-4, _recLineInfo.Y, _recLineInfo.Width, _recLineInfo.Height);
|
g.FillRectangle(backBrush, _recLineInfo.X-4, _recLineInfo.Y, _recLineInfo.Width, _recLineInfo.Height);
|
||||||
|
|
||||||
|
Point gp = GetGridBytePoint(_bytePos - _startByte);
|
||||||
for(int i = 0; i < maxLine; i++) {
|
for(int i = 0; i < maxLine; i++) {
|
||||||
long firstLineByte = (startByte + (_iHexMaxHBytes) * i) + _lineInfoOffset;
|
long firstLineByte = (startByte + (_iHexMaxHBytes) * i) + _lineInfoOffset;
|
||||||
|
|
||||||
|
@ -2496,6 +2499,13 @@ namespace Be.Windows.Forms
|
||||||
formattedInfo = new string('~', LineInfoCharCount);
|
formattedInfo = new string('~', LineInfoCharCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(gp.Y == i && _highlightCurrentRowColumn && !(_keyInterpreter is StringKeyInterpreter)) {
|
||||||
|
using(SolidBrush highlightBrush = new SolidBrush(Color.FromArgb(15, 0, 0, 0))) {
|
||||||
|
g.FillRectangle(highlightBrush, _recHex.X, bytePointF.Y, _recHex.Width - (int)(_charSize.Width*2.5), _charSize.Height);
|
||||||
|
}
|
||||||
|
g.FillRectangle(Brushes.White, _recLineInfo.X - 4, bytePointF.Y, _recLineInfo.Width, _charSize.Height);
|
||||||
|
}
|
||||||
|
|
||||||
g.DrawString(formattedInfo, Font, brush, new PointF(_recLineInfo.X, bytePointF.Y), _stringFormat);
|
g.DrawString(formattedInfo, Font, brush, new PointF(_recLineInfo.X, bytePointF.Y), _stringFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2507,6 +2517,18 @@ namespace Be.Windows.Forms
|
||||||
using(Brush brush = new SolidBrush(this.InfoForeColor)) {
|
using(Brush brush = new SolidBrush(this.InfoForeColor)) {
|
||||||
using(Brush backBrush = new SolidBrush(this.InfoBackColor)) {
|
using(Brush backBrush = new SolidBrush(this.InfoBackColor)) {
|
||||||
g.FillRectangle(backBrush, 0, 0, this.ClientRectangle.Width, _recLineInfo.Y);
|
g.FillRectangle(backBrush, 0, 0, this.ClientRectangle.Width, _recLineInfo.Y);
|
||||||
|
|
||||||
|
if(_highlightCurrentRowColumn && !(_keyInterpreter is StringKeyInterpreter)) {
|
||||||
|
Point gp = GetGridBytePoint(_bytePos - _startByte);
|
||||||
|
PointF bytePointF = GetBytePointF(gp);
|
||||||
|
float columnLeft = _recColumnInfo.Left + _charSize.Width * gp.X * 3 - _charSize.Width / 2;
|
||||||
|
using(SolidBrush highlightBrush = new SolidBrush(Color.FromArgb(15, 0, 0, 0))) {
|
||||||
|
g.FillRectangle(highlightBrush, columnLeft, _recHex.Y, _charSize.Width * 3, bytePointF.Y - _recHex.Y);
|
||||||
|
g.FillRectangle(highlightBrush, columnLeft, bytePointF.Y + _charSize.Height, _charSize.Width * 3, _recHex.Height - (bytePointF.Y - _recHex.Y) - _charSize.Height);
|
||||||
|
}
|
||||||
|
g.FillRectangle(Brushes.White, columnLeft, 0, _charSize.Width * 3, _recLineInfo.Y);
|
||||||
|
}
|
||||||
|
|
||||||
for(int col = 0; col < _iHexMaxHBytes; col++) {
|
for(int col = 0; col < _iHexMaxHBytes; col++) {
|
||||||
PaintColumnInfo(g, (byte)col, brush, col);
|
PaintColumnInfo(g, (byte)col, brush, col);
|
||||||
}
|
}
|
||||||
|
@ -2824,7 +2846,6 @@ namespace Be.Windows.Forms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.GammaCorrected;
|
|
||||||
g.DrawImage(bitmap, rec.Left, rec.Top);
|
g.DrawImage(bitmap, rec.Left, rec.Top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3262,12 +3283,7 @@ namespace Be.Windows.Forms
|
||||||
if (_byteProvider == value)
|
if (_byteProvider == value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(_keyInterpreter == null) {
|
|
||||||
if(value == null)
|
|
||||||
ActivateEmptyKeyInterpreter();
|
|
||||||
else
|
|
||||||
ActivateKeyInterpreter();
|
ActivateKeyInterpreter();
|
||||||
}
|
|
||||||
|
|
||||||
if (_byteProvider != null)
|
if (_byteProvider != null)
|
||||||
_byteProvider.LengthChanged -= new EventHandler(_byteProvider_LengthChanged);
|
_byteProvider.LengthChanged -= new EventHandler(_byteProvider_LengthChanged);
|
||||||
|
@ -3292,11 +3308,6 @@ namespace Be.Windows.Forms
|
||||||
SetPosition(0, 0);
|
SetPosition(0, 0);
|
||||||
SetSelectionLength(0);
|
SetSelectionLength(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_caretVisible)
|
|
||||||
UpdateCaret();
|
|
||||||
else
|
|
||||||
CreateCaret();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckCurrentLineChanged();
|
CheckCurrentLineChanged();
|
||||||
|
@ -3309,6 +3320,11 @@ namespace Be.Windows.Forms
|
||||||
UpdateVisibilityBytes();
|
UpdateVisibilityBytes();
|
||||||
UpdateRectanglePositioning();
|
UpdateRectanglePositioning();
|
||||||
|
|
||||||
|
if(_caretVisible)
|
||||||
|
UpdateCaret();
|
||||||
|
else
|
||||||
|
CreateCaret();
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3515,6 +3531,17 @@ namespace Be.Windows.Forms
|
||||||
}
|
}
|
||||||
} long _selectionLength;
|
} long _selectionLength;
|
||||||
|
|
||||||
|
[Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
||||||
|
public bool HighlightCurrentRowColumn
|
||||||
|
{
|
||||||
|
get { return _highlightCurrentRowColumn; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_highlightCurrentRowColumn = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool _highlightCurrentRowColumn;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the info color used for column info and line info. When this property is null, then ForeColor property is used.
|
/// Gets or sets the info color used for column info and line info. When this property is null, then ForeColor property is used.
|
||||||
|
|
27
GUI.NET/Debugger/frmMemoryViewer.Designer.cs
generated
27
GUI.NET/Debugger/frmMemoryViewer.Designer.cs
generated
|
@ -59,6 +59,7 @@
|
||||||
this.mnuCustomFadeSpeed = new System.Windows.Forms.ToolStripMenuItem();
|
this.mnuCustomFadeSpeed = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.dataTypeHighlightingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.dataTypeHighlightingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.mnuHighlightLabelledBytes = new System.Windows.Forms.ToolStripMenuItem();
|
this.mnuHighlightLabelledBytes = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.mnuHighlightBreakpoints = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator();
|
this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripSeparator();
|
||||||
this.mnuHighlightCodeBytes = new System.Windows.Forms.ToolStripMenuItem();
|
this.mnuHighlightCodeBytes = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.mnuHighlightDataBytes = new System.Windows.Forms.ToolStripMenuItem();
|
this.mnuHighlightDataBytes = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
@ -109,7 +110,7 @@
|
||||||
this.ctrlMemoryAccessCounters = new Mesen.GUI.Debugger.Controls.ctrlMemoryAccessCounters();
|
this.ctrlMemoryAccessCounters = new Mesen.GUI.Debugger.Controls.ctrlMemoryAccessCounters();
|
||||||
this.tpgProfiler = new System.Windows.Forms.TabPage();
|
this.tpgProfiler = new System.Windows.Forms.TabPage();
|
||||||
this.ctrlProfiler = new Mesen.GUI.Debugger.Controls.ctrlProfiler();
|
this.ctrlProfiler = new Mesen.GUI.Debugger.Controls.ctrlProfiler();
|
||||||
this.mnuHighlightBreakpoints = new System.Windows.Forms.ToolStripMenuItem();
|
this.mnuHighlightCurrentRowColumn = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.flowLayoutPanel1.SuspendLayout();
|
this.flowLayoutPanel1.SuspendLayout();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.tabMain.SuspendLayout();
|
this.tabMain.SuspendLayout();
|
||||||
|
@ -258,7 +259,8 @@
|
||||||
this.toolStripMenuItem10,
|
this.toolStripMenuItem10,
|
||||||
this.mnuIgnoreRedundantWrites,
|
this.mnuIgnoreRedundantWrites,
|
||||||
this.mnuEnablePerByteNavigation,
|
this.mnuEnablePerByteNavigation,
|
||||||
this.mnuByteEditingMode});
|
this.mnuByteEditingMode,
|
||||||
|
this.mnuHighlightCurrentRowColumn});
|
||||||
this.mnuView.Name = "mnuView";
|
this.mnuView.Name = "mnuView";
|
||||||
this.mnuView.Size = new System.Drawing.Size(44, 20);
|
this.mnuView.Size = new System.Drawing.Size(44, 20);
|
||||||
this.mnuView.Text = "View";
|
this.mnuView.Text = "View";
|
||||||
|
@ -383,6 +385,14 @@
|
||||||
this.mnuHighlightLabelledBytes.Text = "Labeled bytes";
|
this.mnuHighlightLabelledBytes.Text = "Labeled bytes";
|
||||||
this.mnuHighlightLabelledBytes.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
|
this.mnuHighlightLabelledBytes.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
|
||||||
//
|
//
|
||||||
|
// mnuHighlightBreakpoints
|
||||||
|
//
|
||||||
|
this.mnuHighlightBreakpoints.CheckOnClick = true;
|
||||||
|
this.mnuHighlightBreakpoints.Name = "mnuHighlightBreakpoints";
|
||||||
|
this.mnuHighlightBreakpoints.Size = new System.Drawing.Size(236, 22);
|
||||||
|
this.mnuHighlightBreakpoints.Text = "Breakpoints";
|
||||||
|
this.mnuHighlightBreakpoints.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
|
||||||
|
//
|
||||||
// toolStripMenuItem8
|
// toolStripMenuItem8
|
||||||
//
|
//
|
||||||
this.toolStripMenuItem8.Name = "toolStripMenuItem8";
|
this.toolStripMenuItem8.Name = "toolStripMenuItem8";
|
||||||
|
@ -790,13 +800,13 @@
|
||||||
this.ctrlProfiler.Size = new System.Drawing.Size(606, 343);
|
this.ctrlProfiler.Size = new System.Drawing.Size(606, 343);
|
||||||
this.ctrlProfiler.TabIndex = 0;
|
this.ctrlProfiler.TabIndex = 0;
|
||||||
//
|
//
|
||||||
// mnuHighlightBreakpoints
|
// mnuHighlightCurrentRowColumn
|
||||||
//
|
//
|
||||||
this.mnuHighlightBreakpoints.CheckOnClick = true;
|
this.mnuHighlightCurrentRowColumn.CheckOnClick = true;
|
||||||
this.mnuHighlightBreakpoints.Name = "mnuHighlightBreakpoints";
|
this.mnuHighlightCurrentRowColumn.Name = "mnuHighlightCurrentRowColumn";
|
||||||
this.mnuHighlightBreakpoints.Size = new System.Drawing.Size(236, 22);
|
this.mnuHighlightCurrentRowColumn.Size = new System.Drawing.Size(256, 22);
|
||||||
this.mnuHighlightBreakpoints.Text = "Breakpoints";
|
this.mnuHighlightCurrentRowColumn.Text = "Highlight current row/column";
|
||||||
this.mnuHighlightBreakpoints.Click += new System.EventHandler(this.mnuColorProviderOptions_Click);
|
this.mnuHighlightCurrentRowColumn.CheckedChanged += new System.EventHandler(this.mnuHighlightCurrentRowColumn_CheckedChanged);
|
||||||
//
|
//
|
||||||
// frmMemoryViewer
|
// frmMemoryViewer
|
||||||
//
|
//
|
||||||
|
@ -905,5 +915,6 @@
|
||||||
private System.Windows.Forms.ToolStripMenuItem mnuGoToAll;
|
private System.Windows.Forms.ToolStripMenuItem mnuGoToAll;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem14;
|
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem14;
|
||||||
private System.Windows.Forms.ToolStripMenuItem mnuHighlightBreakpoints;
|
private System.Windows.Forms.ToolStripMenuItem mnuHighlightBreakpoints;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem mnuHighlightCurrentRowColumn;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -50,6 +50,9 @@ namespace Mesen.GUI.Debugger
|
||||||
this.mnuIgnoreRedundantWrites.Checked = config.RamIgnoreRedundantWrites;
|
this.mnuIgnoreRedundantWrites.Checked = config.RamIgnoreRedundantWrites;
|
||||||
this.UpdateFlags();
|
this.UpdateFlags();
|
||||||
|
|
||||||
|
this.mnuHighlightCurrentRowColumn.Checked = config.RamHighlightCurrentRowColumn;
|
||||||
|
this.ctrlHexViewer.HighlightCurrentRowColumn = config.RamHighlightCurrentRowColumn;
|
||||||
|
|
||||||
this.mnuShowCharacters.Checked = config.RamShowCharacters;
|
this.mnuShowCharacters.Checked = config.RamShowCharacters;
|
||||||
this.mnuShowLabelInfoOnMouseOver.Checked = config.RamShowLabelInfo;
|
this.mnuShowLabelInfoOnMouseOver.Checked = config.RamShowLabelInfo;
|
||||||
|
|
||||||
|
@ -439,6 +442,7 @@ namespace Mesen.GUI.Debugger
|
||||||
ConfigManager.Config.DebugInfo.RamAutoRefresh = this.mnuAutoRefresh.Checked;
|
ConfigManager.Config.DebugInfo.RamAutoRefresh = this.mnuAutoRefresh.Checked;
|
||||||
|
|
||||||
ConfigManager.Config.DebugInfo.RamIgnoreRedundantWrites = this.mnuIgnoreRedundantWrites.Checked;
|
ConfigManager.Config.DebugInfo.RamIgnoreRedundantWrites = this.mnuIgnoreRedundantWrites.Checked;
|
||||||
|
ConfigManager.Config.DebugInfo.RamHighlightCurrentRowColumn = this.mnuHighlightCurrentRowColumn.Checked;
|
||||||
|
|
||||||
ConfigManager.Config.DebugInfo.RamShowCharacters = this.mnuShowCharacters.Checked;
|
ConfigManager.Config.DebugInfo.RamShowCharacters = this.mnuShowCharacters.Checked;
|
||||||
ConfigManager.Config.DebugInfo.RamShowLabelInfo = this.mnuShowLabelInfoOnMouseOver.Checked;
|
ConfigManager.Config.DebugInfo.RamShowLabelInfo = this.mnuShowLabelInfoOnMouseOver.Checked;
|
||||||
|
@ -743,5 +747,10 @@ namespace Mesen.GUI.Debugger
|
||||||
ConfigManager.ApplyChanges();
|
ConfigManager.ApplyChanges();
|
||||||
ctrlHexViewer.ByteEditingMode = ConfigManager.Config.DebugInfo.RamByteEditingMode;
|
ctrlHexViewer.ByteEditingMode = ConfigManager.Config.DebugInfo.RamByteEditingMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void mnuHighlightCurrentRowColumn_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
ctrlHexViewer.HighlightCurrentRowColumn = mnuHighlightCurrentRowColumn.Checked;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue