From 17e7c9f436fce464eca7109d019dcef417dbaa2f Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 2 Sep 2010 23:03:18 +0000 Subject: [PATCH] Win32 - Ramwatch - fix so 2 byte is little endian with 2 byte, hacky needs to be cleaned up --- src/drivers/win/ramwatch.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/drivers/win/ramwatch.cpp b/src/drivers/win/ramwatch.cpp index 2d357902..89c9a3ef 100644 --- a/src/drivers/win/ramwatch.cpp +++ b/src/drivers/win/ramwatch.cpp @@ -59,7 +59,15 @@ bool ResetWatches(); unsigned int GetCurrentValue(AddressWatcher& watch) { - return ReadValueAtHardwareAddress(watch.Address, watch.Size == 'd' ? 4 : watch.Size == 'w' ? 2 : 1); + unsigned int x = 0; + if (watch.Size == 2) //Do little endian + { + x = ReadValueAtHardwareAddress(watch.Address+1, 1) * 256; + x += ReadValueAtHardwareAddress(watch.Address, 1); + return x; + } + else + return ReadValueAtHardwareAddress(watch.Address, watch.Size == 'd' ? 4 : watch.Size == 'w' ? 2 : 1); } bool IsSameWatch(const AddressWatcher& l, const AddressWatcher& r)