From 0022b60b4fbe546c490bbb400db3cf2bf4a4c60a Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Mon, 12 Sep 2011 23:36:27 +0000 Subject: [PATCH] Watch object - update the PeekAddress() function to update the prev and changecount values. Fix Ram Search and Ram Watch UpdateValues() functions based on this change --- BizHawk.MultiClient/tools/RamSearch.cs | 5 ----- BizHawk.MultiClient/tools/RamWatch.cs | 4 ---- BizHawk.MultiClient/tools/Watch.cs | 5 +++++ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index eeb759eeac..37481b4906 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -81,12 +81,7 @@ namespace BizHawk.MultiClient sortedCol = ""; for (int x = 0; x < searchList.Count; x++) { - searchList[x].prev = searchList[x].value; searchList[x].PeekAddress(Domain); - - if (searchList[x].prev != searchList[x].value) - searchList[x].changecount++; - } if (AutoSearchCheckBox.Checked) DoSearch(); diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index 87ce3ebf51..9df3043a02 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -66,15 +66,11 @@ namespace BizHawk.MultiClient public void UpdateValues() { - if ((!this.IsHandleCreated || this.IsDisposed) && !Global.Config.DisplayRamWatch) return; for (int x = 0; x < watchList.Count; x++) { - watchList[x].prev = watchList[x].value; watchList[x].PeekAddress(Domain); - if (watchList[x].value != watchList[x].prev) - watchList[x].changecount++; } if (Global.Config.DisplayRamWatch) diff --git a/BizHawk.MultiClient/tools/Watch.cs b/BizHawk.MultiClient/tools/Watch.cs index 22de490400..3099e46855 100644 --- a/BizHawk.MultiClient/tools/Watch.cs +++ b/BizHawk.MultiClient/tools/Watch.cs @@ -161,6 +161,8 @@ namespace BizHawk.MultiClient if (type == atype.SEPARATOR) return; + prev = value; + switch (type) { case atype.BYTE: @@ -173,6 +175,9 @@ namespace BizHawk.MultiClient PeekDWord(domain); break; } + + if (value != prev) + changecount++; } private void PokeByte(MemoryDomain domain)