summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/xenia/cpu/mmio_handler.cc16
-rw-r--r--src/xenia/cpu/mmio_handler.h2
2 files changed, 13 insertions, 5 deletions
diff --git a/src/xenia/cpu/mmio_handler.cc b/src/xenia/cpu/mmio_handler.cc
index f12cb65d9..33bdaf889 100644
--- a/src/xenia/cpu/mmio_handler.cc
+++ b/src/xenia/cpu/mmio_handler.cc
@@ -240,12 +240,20 @@ bool MMIOHandler::IsRangeWatched(uint32_t physical_address, size_t length) {
for (auto it = access_watches_.begin(); it != access_watches_.end(); ++it) {
auto entry = *it;
if ((entry->address <= physical_address &&
- entry->address + entry->length > physical_address) ||
- (entry->address >= physical_address &&
- entry->address < physical_address + length)) {
- // This watch lies within the range.
+ entry->address + entry->length > physical_address + length)) {
+ // This range lies entirely within this watch.
return true;
}
+
+ // TODO(DrChat): Check if the range is partially covered, and subtract the
+ // covered portion if it is.
+ if ((entry->address <= physical_address &&
+ entry->address + entry->length > physical_address)) {
+ // The beginning of range lies partially within this watch.
+ } else if ((entry->address < physical_address + length &&
+ entry->address + entry->length > physical_address + length)) {
+ // The ending of this range lies partially within this watch.
+ }
}
return false;
diff --git a/src/xenia/cpu/mmio_handler.h b/src/xenia/cpu/mmio_handler.h
index e68a2e276..e61cd1c20 100644
--- a/src/xenia/cpu/mmio_handler.h
+++ b/src/xenia/cpu/mmio_handler.h
@@ -77,7 +77,7 @@ class MMIOHandler {
// Fires and clears any access watches that overlap this range.
void InvalidateRange(uint32_t physical_address, size_t length);
- // Returns true if /any/ part of this range is watched.
+ // Returns true if /all/ of this range is watched.
bool IsRangeWatched(uint32_t physical_address, size_t length);
protected: