From de3a14ae075238d4599d55aea45d4da2631ef06b Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Thu, 24 Feb 2011 04:56:24 +0000 Subject: [PATCH] Ram Watch - change counts column --- BizHawk.MultiClient/tools/RamWatch.Designer.cs | 10 ++++++++++ BizHawk.MultiClient/tools/RamWatch.cs | 16 ++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/BizHawk.MultiClient/tools/RamWatch.Designer.cs b/BizHawk.MultiClient/tools/RamWatch.Designer.cs index 90f94b0fa8..29abda4e23 100644 --- a/BizHawk.MultiClient/tools/RamWatch.Designer.cs +++ b/BizHawk.MultiClient/tools/RamWatch.Designer.cs @@ -59,6 +59,7 @@ this.WatchListView = new BizHawk.VirtualListView(); this.Address = new System.Windows.Forms.ColumnHeader(); this.Value = new System.Windows.Forms.ColumnHeader(); + this.ChangeCounts = new System.Windows.Forms.ColumnHeader(); this.Notes = new System.Windows.Forms.ColumnHeader(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -314,6 +315,7 @@ this.WatchListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.Address, this.Value, + this.ChangeCounts, this.Notes}); this.WatchListView.ContextMenuStrip = this.contextMenuStrip1; this.WatchListView.FullRowSelect = true; @@ -338,6 +340,13 @@ // this.Value.Text = "Value"; this.Value.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.Value.Width = 59; + // + // ChangeCounts + // + this.ChangeCounts.Text = "Changes"; + this.ChangeCounts.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.ChangeCounts.Width = 54; // // Notes // @@ -633,6 +642,7 @@ private System.Windows.Forms.ToolStrip toolStrip1; private System.Windows.Forms.ColumnHeader Address; private System.Windows.Forms.ColumnHeader Value; + private System.Windows.Forms.ColumnHeader ChangeCounts; private System.Windows.Forms.ColumnHeader Notes; private System.Windows.Forms.Label WatchCountLabel; private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem; diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index ec92ad6240..336736b57b 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -19,11 +19,10 @@ namespace BizHawk.MultiClient //TODO: //On Movie UP/Down set highlighted items to be what the user had selected (in their new position) //DisplayWatches needs to do value display properly like updatevalues, or just run update values - //When Watch object has a changes member, display in watch list with a reset changes function - //Ability to watch in different memory domains - + //Ability to watch in different memory domains + //Reset Changecounts function + //Option to high change counts? //IDEAS: - //OPtion to show a change count column //Option to show previous value //Option to show change from previous value @@ -50,7 +49,12 @@ namespace BizHawk.MultiClient public void UpdateValues() { for (int x = 0; x < watchList.Count; x++) + { + watchList[x].prev = watchList[x].value; watchList[x].PeekAddress(Global.Emulator.MainMemory); + if (watchList[x].value != watchList[x].prev) + watchList[x].changecount++; + } WatchListView.Refresh(); } @@ -123,6 +127,10 @@ namespace BizHawk.MultiClient } } if (column == 2) + { + text = watchList[index].changecount.ToString(); + } + if (column == 3) { if (watchList[index].type == atype.SEPARATOR) text = "";