New Ram Watch - configurable previous value definitions
This commit is contained in:
parent
440185a229
commit
d1e36b62e1
|
@ -209,8 +209,9 @@ namespace BizHawk.MultiClient
|
||||||
public int RamWatchDiffIndex = 4;
|
public int RamWatchDiffIndex = 4;
|
||||||
public int RamWatchDomainIndex = 5;
|
public int RamWatchDomainIndex = 5;
|
||||||
public int RamWatchNotesIndex = 6;
|
public int RamWatchNotesIndex = 6;
|
||||||
|
|
||||||
public int RamWatchPrev_Type = 1;
|
public int RamWatchPrev_Type = 1;
|
||||||
|
public Watch.PreviousType RamWatchDefinePrevious = Watch.PreviousType.LastFrame;
|
||||||
|
|
||||||
// RamSearch Settings
|
// RamSearch Settings
|
||||||
public bool RamSearchSaveWindowPosition = true;
|
public bool RamSearchSaveWindowPosition = true;
|
||||||
|
|
|
@ -96,6 +96,7 @@
|
||||||
this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.DiffColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.DomainColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
this.NotesColumn = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||||
|
this.originalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.toolStrip1.SuspendLayout();
|
this.toolStrip1.SuspendLayout();
|
||||||
this.menuStrip1.SuspendLayout();
|
this.menuStrip1.SuspendLayout();
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
|
@ -604,23 +605,26 @@
|
||||||
//
|
//
|
||||||
this.definePreviousValueAsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.definePreviousValueAsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.previousFrameToolStripMenuItem,
|
this.previousFrameToolStripMenuItem,
|
||||||
this.lastChangeToolStripMenuItem});
|
this.lastChangeToolStripMenuItem,
|
||||||
this.definePreviousValueAsToolStripMenuItem.Enabled = false;
|
this.originalToolStripMenuItem});
|
||||||
this.definePreviousValueAsToolStripMenuItem.Name = "definePreviousValueAsToolStripMenuItem";
|
this.definePreviousValueAsToolStripMenuItem.Name = "definePreviousValueAsToolStripMenuItem";
|
||||||
this.definePreviousValueAsToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
this.definePreviousValueAsToolStripMenuItem.Size = new System.Drawing.Size(217, 22);
|
||||||
this.definePreviousValueAsToolStripMenuItem.Text = "Define Previous Value As";
|
this.definePreviousValueAsToolStripMenuItem.Text = "Define Previous Value As";
|
||||||
|
this.definePreviousValueAsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.definePreviousValueAsToolStripMenuItem_DropDownOpened);
|
||||||
//
|
//
|
||||||
// previousFrameToolStripMenuItem
|
// previousFrameToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.previousFrameToolStripMenuItem.Name = "previousFrameToolStripMenuItem";
|
this.previousFrameToolStripMenuItem.Name = "previousFrameToolStripMenuItem";
|
||||||
this.previousFrameToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
this.previousFrameToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
||||||
this.previousFrameToolStripMenuItem.Text = "Previous Frame";
|
this.previousFrameToolStripMenuItem.Text = "Previous Frame";
|
||||||
|
this.previousFrameToolStripMenuItem.Click += new System.EventHandler(this.previousFrameToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// lastChangeToolStripMenuItem
|
// lastChangeToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.lastChangeToolStripMenuItem.Name = "lastChangeToolStripMenuItem";
|
this.lastChangeToolStripMenuItem.Name = "lastChangeToolStripMenuItem";
|
||||||
this.lastChangeToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
this.lastChangeToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
||||||
this.lastChangeToolStripMenuItem.Text = "Last Change";
|
this.lastChangeToolStripMenuItem.Text = "Last Change";
|
||||||
|
this.lastChangeToolStripMenuItem.Click += new System.EventHandler(this.lastChangeToolStripMenuItem_Click);
|
||||||
//
|
//
|
||||||
// displayWatchesOnScreenToolStripMenuItem
|
// displayWatchesOnScreenToolStripMenuItem
|
||||||
//
|
//
|
||||||
|
@ -721,6 +725,13 @@
|
||||||
this.NotesColumn.Text = "Notes";
|
this.NotesColumn.Text = "Notes";
|
||||||
this.NotesColumn.Width = 128;
|
this.NotesColumn.Width = 128;
|
||||||
//
|
//
|
||||||
|
// originalToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.originalToolStripMenuItem.Name = "originalToolStripMenuItem";
|
||||||
|
this.originalToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
|
||||||
|
this.originalToolStripMenuItem.Text = "&Original";
|
||||||
|
this.originalToolStripMenuItem.Click += new System.EventHandler(this.originalToolStripMenuItem_Click);
|
||||||
|
//
|
||||||
// NewRamWatch
|
// NewRamWatch
|
||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
|
@ -814,5 +825,6 @@
|
||||||
private System.Windows.Forms.Label MessageLabel;
|
private System.Windows.Forms.Label MessageLabel;
|
||||||
private System.Windows.Forms.Label MemDomainLabel;
|
private System.Windows.Forms.Label MemDomainLabel;
|
||||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem originalToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -863,6 +863,42 @@ namespace BizHawk.MultiClient
|
||||||
saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamWatchSaveWindowPosition;
|
saveWindowPositionToolStripMenuItem.Checked = Global.Config.RamWatchSaveWindowPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void definePreviousValueAsToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
lastChangeToolStripMenuItem.Checked = false;
|
||||||
|
previousFrameToolStripMenuItem.Checked = false;
|
||||||
|
originalToolStripMenuItem.Checked = false;
|
||||||
|
|
||||||
|
switch (Global.Config.RamWatchDefinePrevious)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case Watch.PreviousType.LastFrame:
|
||||||
|
previousFrameToolStripMenuItem.Checked = true;
|
||||||
|
break;
|
||||||
|
case Watch.PreviousType.LastChange:
|
||||||
|
lastChangeToolStripMenuItem.Checked = true;
|
||||||
|
break;
|
||||||
|
case Watch.PreviousType.OriginalValue:
|
||||||
|
originalToolStripMenuItem.Checked = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void previousFrameToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchDefinePrevious = Watch.PreviousType.LastFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void lastChangeToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchDefinePrevious = Watch.PreviousType.LastChange;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void originalToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Global.Config.RamWatchDefinePrevious = Watch.PreviousType.OriginalValue;
|
||||||
|
}
|
||||||
|
|
||||||
private void displayWatchesOnScreenToolStripMenuItem_Click(object sender, EventArgs e)
|
private void displayWatchesOnScreenToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Global.Config.DisplayRamWatch ^= true;
|
Global.Config.DisplayRamWatch ^= true;
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
public enum WatchSize { Byte = 1, Word = 2, DWord = 4, Separator = 0 };
|
public enum WatchSize { Byte = 1, Word = 2, DWord = 4, Separator = 0 };
|
||||||
public enum DisplayType { Separator, Signed, Unsigned, Hex, Binary, FixedPoint_12_4, FixedPoint_20_12, Float };
|
public enum DisplayType { Separator, Signed, Unsigned, Hex, Binary, FixedPoint_12_4, FixedPoint_20_12, Float };
|
||||||
|
public enum PreviousType { OriginalValue = 0, LastSearch = 1, LastFrame = 2, LastChange = 3 };
|
||||||
|
|
||||||
public static string DisplayTypeToString(DisplayType type)
|
public static string DisplayTypeToString(DisplayType type)
|
||||||
{
|
{
|
||||||
|
@ -415,13 +416,31 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public string Notes { get; set; }
|
public string Notes { get; set; }
|
||||||
|
|
||||||
public void Update() //TODO: different notions of previous
|
public void Update()
|
||||||
{
|
{
|
||||||
_previous = _value;
|
switch (Global.Config.RamWatchDefinePrevious)
|
||||||
_value = GetByte();
|
|
||||||
if (_value != Previous)
|
|
||||||
{
|
{
|
||||||
ChangeCount++;
|
case PreviousType.LastSearch: //TODO
|
||||||
|
case PreviousType.OriginalValue:
|
||||||
|
/*Do Nothing*/
|
||||||
|
break;
|
||||||
|
case PreviousType.LastChange:
|
||||||
|
var temp = _value;
|
||||||
|
_value = GetByte();
|
||||||
|
if (_value != temp)
|
||||||
|
{
|
||||||
|
_previous = _value;
|
||||||
|
ChangeCount++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PreviousType.LastFrame:
|
||||||
|
_previous = _value;
|
||||||
|
_value = GetByte();
|
||||||
|
if (_value != Previous)
|
||||||
|
{
|
||||||
|
ChangeCount++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -515,13 +534,32 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public string Notes { get; set; }
|
public string Notes { get; set; }
|
||||||
|
|
||||||
public void Update() //TODO: different notions of previous
|
public void Update()
|
||||||
{
|
{
|
||||||
_previous = _value;
|
switch (Global.Config.RamWatchDefinePrevious)
|
||||||
_value = GetWord();
|
|
||||||
if (_value != Previous)
|
|
||||||
{
|
{
|
||||||
ChangeCount++;
|
case PreviousType.LastSearch: //TODO
|
||||||
|
case PreviousType.OriginalValue:
|
||||||
|
/*Do Nothing*/
|
||||||
|
break;
|
||||||
|
case PreviousType.LastChange:
|
||||||
|
var temp = _value;
|
||||||
|
_value = GetWord();
|
||||||
|
|
||||||
|
if (_value != temp)
|
||||||
|
{
|
||||||
|
_previous = temp;
|
||||||
|
ChangeCount++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PreviousType.LastFrame:
|
||||||
|
_previous = _value;
|
||||||
|
_value = GetWord();
|
||||||
|
if (_value != Previous)
|
||||||
|
{
|
||||||
|
ChangeCount++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -616,13 +654,31 @@ namespace BizHawk.MultiClient
|
||||||
|
|
||||||
public string Notes { get; set; }
|
public string Notes { get; set; }
|
||||||
|
|
||||||
public void Update() //TODO: different notions of previous
|
public void Update()
|
||||||
{
|
{
|
||||||
_previous = _value;
|
switch (Global.Config.RamWatchDefinePrevious)
|
||||||
_value = GetDWord();
|
|
||||||
if (_value != Previous)
|
|
||||||
{
|
{
|
||||||
ChangeCount++;
|
case PreviousType.LastSearch: //TODO
|
||||||
|
case PreviousType.OriginalValue:
|
||||||
|
/*Do Nothing*/
|
||||||
|
break;
|
||||||
|
case PreviousType.LastChange:
|
||||||
|
var temp = _value;
|
||||||
|
_value = GetDWord();
|
||||||
|
if (_value != temp)
|
||||||
|
{
|
||||||
|
_previous = _value;
|
||||||
|
ChangeCount++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case PreviousType.LastFrame:
|
||||||
|
_previous = _value;
|
||||||
|
_value = GetDWord();
|
||||||
|
if (_value != Previous)
|
||||||
|
{
|
||||||
|
ChangeCount++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue