From 126978d9604652ee84455c759fb9b3067853888a Mon Sep 17 00:00:00 2001 From: Triang3l Date: Fri, 16 Aug 2019 08:49:48 +0300 Subject: [PATCH] [Memory] Fix memory watch addresses --- src/xenia/memory.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xenia/memory.cc b/src/xenia/memory.cc index 516877faf..d69783bfe 100644 --- a/src/xenia/memory.cc +++ b/src/xenia/memory.cc @@ -1513,7 +1513,7 @@ void PhysicalHeap::WatchPhysicalWrite(uint32_t physical_address, // Protect the pages and mark them as watched. Don't mark non-writable pages // as watched, so true access violations can still occur there. - uint8_t* protect_base = TranslateRelative(0); + uint8_t* protect_base = membase_ + heap_base_; uint32_t protect_system_page_first = UINT32_MAX; for (uint32_t i = system_page_first; i <= system_page_last; ++i) { uint64_t page_bit = uint64_t(1) << (i & 63); @@ -1671,7 +1671,7 @@ bool PhysicalHeap::TriggerWatches(uint32_t virtual_address, uint32_t length, // Unprotect ranges that need unprotection. if (unprotect) { - uint8_t* protect_base = TranslateRelative(0); + uint8_t* protect_base = membase_ + heap_base_; uint32_t unprotect_system_page_first = UINT32_MAX; for (uint32_t i = system_page_first; i <= system_page_last; ++i) { // Check if need to allow writing to this page.