From d2e499a3fc094d3b791b59aed208e1b37ad1bd71 Mon Sep 17 00:00:00 2001 From: "andres.delikat" Date: Mon, 21 Feb 2011 03:14:03 +0000 Subject: [PATCH] Ram Search - update values does 2 byte --- BizHawk.MultiClient/tools/RamSearch.cs | 32 ++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/BizHawk.MultiClient/tools/RamSearch.cs b/BizHawk.MultiClient/tools/RamSearch.cs index 16a61a0681..0109726f0e 100644 --- a/BizHawk.MultiClient/tools/RamSearch.cs +++ b/BizHawk.MultiClient/tools/RamSearch.cs @@ -19,8 +19,8 @@ namespace BizHawk.MultiClient //TODO: //Window position gets saved but doesn't load properly //Add to Ram watch fails to open ram watch if it has neve been opened - //Implement DWORD start new search - //Implement WORD & DWORD in UpdateValues + //Implement DWORD start new search & updateValues + //Little endian is bogus in start new search //Implement Auto-Search //Impelment File handling //Implement Preview search @@ -49,8 +49,30 @@ namespace BizHawk.MultiClient for (int x = 0; x < searchList.Count; x++) { searchList[x].prev = searchList[x].value; - - searchList[x].value = Global.Emulator.MainMemory.PeekByte(searchList[x].address); + switch (searchList[x].type) + { + case atype.BYTE: + searchList[x].value = Global.Emulator.MainMemory.PeekByte(searchList[x].address); + break; + case atype.WORD: + if (searchList[x].bigendian) + { + searchList[x].value = ((Global.Emulator.MainMemory.PeekByte(searchList[x].address) * 256) + + Global.Emulator.MainMemory.PeekByte((searchList[x].address) + 1)); + } + else + { + searchList[x].value = (Global.Emulator.MainMemory.PeekByte(searchList[x].address) + + (Global.Emulator.MainMemory.PeekByte((searchList[x].address) + 1) * 256)); + } + break; + case atype.DWORD: + //TODO + break; + default: + searchList[x].value = Global.Emulator.MainMemory.PeekByte(searchList[x].address); + break; + } if (searchList[x].prev != searchList[x].value) searchList[x].changecount++; @@ -302,7 +324,7 @@ namespace BizHawk.MultiClient if (GetBigEndian()) { searchList[x].prev = searchList[x].value = ((Global.Emulator.MainMemory.PeekByte(searchList[x].address) * 256) + - Global.Emulator.MainMemory.PeekByte((searchList[x + 1].address) + 1)); + Global.Emulator.MainMemory.PeekByte((searchList[x].address) + 1)); } else {