From 60402fe54d5fbf3f67c6b470e773ec83feb7bba4 Mon Sep 17 00:00:00 2001 From: Sour Date: Fri, 23 Feb 2018 08:49:14 -0500 Subject: [PATCH] Debugger: Fixed CPU breakpoints on registers --- Core/Debugger.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/Debugger.cpp b/Core/Debugger.cpp index 397c5de3..4b37861c 100644 --- a/Core/Debugger.cpp +++ b/Core/Debugger.cpp @@ -270,6 +270,7 @@ void Debugger::ProcessBreakpoints(BreakpointType type, OperationInfo &operationI uint32_t absoluteAddr; AddressTypeInfo info { -1, AddressType::InternalRam }; PpuAddressTypeInfo ppuInfo { -1, PpuAddressType::None }; + bool isPpuBreakpoint = false; switch(type) { case BreakpointType::Execute: case BreakpointType::ReadRam: @@ -282,6 +283,7 @@ void Debugger::ProcessBreakpoints(BreakpointType type, OperationInfo &operationI case BreakpointType::WriteVram: GetPpuAbsoluteAddressAndType(operationInfo.Address, &ppuInfo); absoluteAddr = ppuInfo.Address; + isPpuBreakpoint = true; break; } @@ -305,8 +307,8 @@ void Debugger::ProcessBreakpoints(BreakpointType type, OperationInfo &operationI Breakpoint &breakpoint = breakpoints[i]; if( type == BreakpointType::Global || - info.Address >= 0 && breakpoint.Matches(operationInfo.Address, info) || - type >= BreakpointType::ReadVram && breakpoint.Matches(operationInfo.Address, ppuInfo) + !isPpuBreakpoint && breakpoint.Matches(operationInfo.Address, info) || + isPpuBreakpoint && breakpoint.Matches(operationInfo.Address, ppuInfo) ) { if(!breakpoint.HasCondition()) { processBreakpoint(breakpoint);