From d335555277bcb02ba0d753335ef59ecbbac64b87 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 23 Jun 2015 17:37:09 -0700 Subject: [PATCH] Manually page align address range for write watch. --- src/xenia/cpu/mmio_handler.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xenia/cpu/mmio_handler.cc b/src/xenia/cpu/mmio_handler.cc index 4de22c4ec..95f5a2e54 100644 --- a/src/xenia/cpu/mmio_handler.cc +++ b/src/xenia/cpu/mmio_handler.cc @@ -104,7 +104,9 @@ uintptr_t MMIOHandler::AddPhysicalWriteWatch(uint32_t guest_address, // This means we need to round up, which will cause spurious access // violations and invalidations. // TODO(benvanik): only invalidate if actually within the region? - length = xe::round_up(length, xe::page_size()); + length = + xe::round_up(length + (base_address % xe::page_size()), xe::page_size()); + base_address = base_address - (base_address % xe::page_size()); // Add to table. The slot reservation may evict a previous watch, which // could include our target, so we do it first.