From 06330c1c122e4bcd6855e6afbeb2efd78da23b27 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 28 Sep 2013 18:02:08 +0000 Subject: [PATCH] Ram Search Engine - fix searching for signed 1-byte and 2-byte (many other types still broken) --- .../tools/Watch/RamSearchEngine.cs | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/BizHawk.MultiClient/tools/Watch/RamSearchEngine.cs b/BizHawk.MultiClient/tools/Watch/RamSearchEngine.cs index 4a202e894e..da16a6ce6a 100644 --- a/BizHawk.MultiClient/tools/Watch/RamSearchEngine.cs +++ b/BizHawk.MultiClient/tools/Watch/RamSearchEngine.cs @@ -619,13 +619,34 @@ namespace BizHawk.MultiClient default: case Watch.WatchSize.Byte: var theByte = _settings.Domain.PeekByte(addr); - return theByte; + if (_settings.Type == Watch.DisplayType.Signed) + { + return (sbyte)theByte; + } + else + { + return theByte; + } case Watch.WatchSize.Word: var theWord = _settings.Domain.PeekWord(addr, _settings.BigEndian ? Endian.Big : Endian.Little); - return theWord; + if (_settings.Type == Watch.DisplayType.Signed) + { + return (short)theWord; + } + else + { + return theWord; + } case Watch.WatchSize.DWord: var theDWord = _settings.Domain.PeekDWord(addr, _settings.BigEndian ? Endian.Big : Endian.Little); - return (int)theDWord; + if (_settings.Type == Watch.DisplayType.Signed) + { + return (int)theDWord; + } + else + { + return (int)theDWord; //TODO + } } }