From c433b3fe333a8134c72f6d331a68a0400b4192f6 Mon Sep 17 00:00:00 2001 From: Sour Date: Thu, 5 Dec 2019 23:36:00 -0500 Subject: [PATCH] Debugger: Fixed CPU read/write breakpoints breaking on PPU memory read/writes (e.g vram, cgram, oam) --- Core/Breakpoint.cpp | 2 +- Core/DebugUtilities.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Core/Breakpoint.cpp b/Core/Breakpoint.cpp index 0386458..a0ff408 100644 --- a/Core/Breakpoint.cpp +++ b/Core/Breakpoint.cpp @@ -5,7 +5,7 @@ bool Breakpoint::Matches(uint32_t memoryAddr, AddressInfo &info) { - if(_memoryType <= DebugUtilities::GetLastCpuMemoryType()) { + if(_memoryType <= DebugUtilities::GetLastCpuMemoryType() && !DebugUtilities::IsPpuMemory(info.Type)) { if(_startAddr == -1) { return true; } else if(_endAddr == -1) { diff --git a/Core/DebugUtilities.h b/Core/DebugUtilities.h index 3541a58..913a619 100644 --- a/Core/DebugUtilities.h +++ b/Core/DebugUtilities.h @@ -25,6 +25,19 @@ public: return SnesMemoryType::GsuMemory; } + static bool IsPpuMemory(SnesMemoryType memType) + { + switch(memType) { + case SnesMemoryType::VideoRam: + case SnesMemoryType::SpriteRam: + case SnesMemoryType::CGRam: + return true; + + default: + return false; + } + } + static constexpr CpuType GetLastCpuType() { return CpuType::Cx4;