Ram Watch - show initial value of a watch when it is initially added (from adding it or loading a file). Fixes issue 74

This commit is contained in:
adelikat 2012-06-10 17:45:20 +00:00
parent 81198cc89f
commit a2a98415bf
2 changed files with 15 additions and 4 deletions

View File

@ -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();

View File

@ -53,7 +53,7 @@ namespace BizHawk.MultiClient
bigendian = BigEndian;
notes = Notes;
changecount = 0;
prev = 0;
prev = Value;
original = value;
lastchange = 0;
lastsearch = value;