From 7779b2f7dbd863bbde48499eb7caff4cbaea9477 Mon Sep 17 00:00:00 2001 From: Hathor86 Date: Thu, 10 Dec 2015 00:33:43 +0100 Subject: [PATCH] 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 --- BizHawk.Client.Common/tools/Watch/ByteWatch.cs | 9 ++++++++- BizHawk.Client.Common/tools/Watch/DwordWatch.cs | 9 ++++++++- BizHawk.Client.Common/tools/Watch/WordWatch.cs | 9 ++++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/BizHawk.Client.Common/tools/Watch/ByteWatch.cs b/BizHawk.Client.Common/tools/Watch/ByteWatch.cs index 18b62e4078..d9d592f0c4 100644 --- a/BizHawk.Client.Common/tools/Watch/ByteWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/ByteWatch.cs @@ -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; } diff --git a/BizHawk.Client.Common/tools/Watch/DwordWatch.cs b/BizHawk.Client.Common/tools/Watch/DwordWatch.cs index 860aad7ee7..ac589e4488 100644 --- a/BizHawk.Client.Common/tools/Watch/DwordWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/DwordWatch.cs @@ -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; } diff --git a/BizHawk.Client.Common/tools/Watch/WordWatch.cs b/BizHawk.Client.Common/tools/Watch/WordWatch.cs index d0e393be9c..f8251f2963 100644 --- a/BizHawk.Client.Common/tools/Watch/WordWatch.cs +++ b/BizHawk.Client.Common/tools/Watch/WordWatch.cs @@ -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; }