From a2a98415bf9ca98d8e2bf2166a2a3f5dceaa8227 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 10 Jun 2012 17:45:20 +0000 Subject: [PATCH] Ram Watch - show initial value of a watch when it is initially added (from adding it or loading a file). Fixes issue 74 --- BizHawk.MultiClient/tools/RamWatch.cs | 17 ++++++++++++++--- BizHawk.MultiClient/tools/Watch.cs | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/BizHawk.MultiClient/tools/RamWatch.cs b/BizHawk.MultiClient/tools/RamWatch.cs index 8b759bb56a..306232c60d 100644 --- a/BizHawk.MultiClient/tools/RamWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatch.cs @@ -316,6 +316,10 @@ namespace BizHawk.MultiClient if (result) { + foreach (Watch w in watchList) + { + InitializeAddress(w); + } if (!append) { currentFile = path; @@ -341,7 +345,7 @@ namespace BizHawk.MultiClient return q; } - void AddNewWatch() + private void AddNewWatch() { RamWatchNewWatch r = new RamWatchNewWatch(); @@ -350,16 +354,22 @@ namespace BizHawk.MultiClient Global.Sound.StopSound(); r.ShowDialog(); Global.Sound.StartSound(); - if (r.userSelected == true) { + InitializeAddress(r.watch); watchList.Add(r.watch); Changes(); - DisplayWatchList(); UpdateWatchCount(); + DisplayWatchList(); } } + private void InitializeAddress(Watch w) + { + w.PeekAddress(Domain); + w.changecount = 0; + } + void Changes() { changes = true; @@ -424,6 +434,7 @@ namespace BizHawk.MultiClient if (r.userSelected == true) { + InitializeAddress(r.watch); Changes(); watchList.Add(r.watch); DisplayWatchList(); diff --git a/BizHawk.MultiClient/tools/Watch.cs b/BizHawk.MultiClient/tools/Watch.cs index 9a95aaa716..35f9c2deca 100644 --- a/BizHawk.MultiClient/tools/Watch.cs +++ b/BizHawk.MultiClient/tools/Watch.cs @@ -53,7 +53,7 @@ namespace BizHawk.MultiClient bigendian = BigEndian; notes = Notes; changecount = 0; - prev = 0; + prev = Value; original = value; lastchange = 0; lastsearch = value;