Fix RamSearch value

Fix has been done on constructor of each watch. Call GetByte / Word /
DWord if value is 0.
It ensure that previous passed in parameters remains unchanged
This commit is contained in:
Hathor86 2015-12-10 00:33:43 +01:00
parent 2a6a2a7a8a
commit 7779b2f7db
3 changed files with 24 additions and 3 deletions

View File

@ -38,7 +38,14 @@ namespace BizHawk.Client.Common
internal ByteWatch(MemoryDomain domain, long address, DisplayType type, bool bigEndian, string note, byte value, byte previous, int changeCount)
: base(domain, address, WatchSize.Byte, type, bigEndian, note)
{
this._value = value;
if (value == 0)
{
value = GetByte();
}
else
{
this._value = value;
}
this._previous = previous;
this._changecount = changeCount;
}

View File

@ -38,7 +38,14 @@ namespace BizHawk.Client.Common
internal DWordWatch(MemoryDomain domain, long address, DisplayType type, bool bigEndian, string note, uint value, uint previous, int changeCount)
: base(domain, address, WatchSize.DWord, type, bigEndian, note)
{
this._value = value;
if (value == 0)
{
value = GetDWord();
}
else
{
this._value = value;
}
this._previous = previous;
this._changecount = changeCount;
}

View File

@ -38,7 +38,14 @@ namespace BizHawk.Client.Common
internal WordWatch(MemoryDomain domain, long address, DisplayType type, bool bigEndian, string note, ushort value, ushort previous, int changeCount)
: base(domain, address, WatchSize.Word, type, bigEndian, note)
{
this._value = value;
if (value == 0)
{
value = GetWord();
}
else
{
this._value = value;
}
this._previous = previous;
this._changecount = changeCount;
}