diff --git a/pcsx2/DebugTools/Breakpoints.cpp b/pcsx2/DebugTools/Breakpoints.cpp index 2fe40510dd..6bed7d3cbf 100644 --- a/pcsx2/DebugTools/Breakpoints.cpp +++ b/pcsx2/DebugTools/Breakpoints.cpp @@ -347,14 +347,15 @@ void CBreakPoints::ExecMemCheckJitCleanup() void CBreakPoints::SetSkipFirst(u32 pc) { breakSkipFirstAt_ = pc & addressMask; -// breakSkipFirstTicks_ = CoreTiming::GetTicks(); + breakSkipFirstTicks_ = r5900Debug.getCycles(); } + u32 CBreakPoints::CheckSkipFirst(u32 cmpPc) { cmpPc &= addressMask; u32 pc = breakSkipFirstAt_; - if (pc == cmpPc) - return 1; + if (breakSkipFirstTicks_ == r5900Debug.getCycles()) + return pc; return 0; } diff --git a/pcsx2/DebugTools/DebugInterface.cpp b/pcsx2/DebugTools/DebugInterface.cpp index ac33f05149..fd7635c8bd 100644 --- a/pcsx2/DebugTools/DebugInterface.cpp +++ b/pcsx2/DebugTools/DebugInterface.cpp @@ -480,6 +480,11 @@ bool R5900DebugInterface::isValidAddress(u32 addr) } +u32 R5900DebugInterface::getCycles() +{ + return cpuRegs.cycle; +} + // // R3000DebugInterface // @@ -701,3 +706,8 @@ bool R3000DebugInterface::isValidAddress(u32 addr) return !(addr & 0x40000000) && vtlb_GetPhyPtr(addr & 0x1FFFFFFF) != NULL; } + +u32 R3000DebugInterface::getCycles() +{ + return psxRegs.cycle; +} diff --git a/pcsx2/DebugTools/DebugInterface.h b/pcsx2/DebugTools/DebugInterface.h index 246b9c5ab4..4bba43bb36 100644 --- a/pcsx2/DebugTools/DebugInterface.h +++ b/pcsx2/DebugTools/DebugInterface.h @@ -31,6 +31,7 @@ public: virtual std::string disasm(u32 address) = 0; virtual bool isValidAddress(u32 address) = 0; + virtual u32 getCycles() = 0; bool initExpression(const char* exp, PostfixExpression& dest); bool parseExpression(PostfixExpression& exp, u64& dest); @@ -67,6 +68,7 @@ public: virtual std::string disasm(u32 address); virtual bool isValidAddress(u32 address); + virtual u32 getCycles(); }; @@ -97,6 +99,7 @@ public: virtual std::string disasm(u32 address); virtual bool isValidAddress(u32 address); + virtual u32 getCycles(); }; extern R5900DebugInterface r5900Debug; diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index 40f6e5c0ba..b1d5d6bb3a 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -1272,10 +1272,7 @@ void dynarecCheckBreakpoint() { u32 pc = cpuRegs.pc; if (CBreakPoints::CheckSkipFirst(pc)) - { - CBreakPoints::SetSkipFirst(0xFFFFFFFF); return; - } auto cond = CBreakPoints::GetBreakPointCondition(pc); if (cond && !cond->Evaluate())