diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 9b88538935..ee67327846 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -624,6 +624,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc // WARNING - cmp->branch merging will screw this up. js.isLastInstruction = true; js.next_inst = 0; + js.next_inst_bp = false; if (Profiler::g_ProfileBlocks) { // CAUTION!!! push on stack regs you use, do your stuff, then pop @@ -641,6 +642,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc js.next_inst = ops[i + 1].inst; js.next_compilerPC = ops[i + 1].address; js.next_op = &ops[i + 1]; + js.next_inst_bp = SConfig::GetInstance().m_LocalCoreStartupParameter.bEnableDebugging && breakpoints.IsAddressBreakPoint(ops[i + 1].address); } if (jo.optimizeGatherPipe && js.fifoBytesThisBlock >= 32) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 4136a89621..24a43e85a1 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -52,7 +52,8 @@ void Jit64::FinalizeCarry(CCFlags cond) js.carryFlagInverted = false; if (js.op->wantsCA) { - if (js.next_op->wantsCAInFlags) + // Be careful: a breakpoint kills flags in between instructions + if (js.next_op->wantsCAInFlags && !js.next_inst_bp) { if (cond == CC_C || cond == CC_NC) { diff --git a/Source/Core/Core/PowerPC/JitCommon/JitBase.h b/Source/Core/Core/PowerPC/JitCommon/JitBase.h index 52463ec619..4c3cd2562b 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitBase.h +++ b/Source/Core/Core/PowerPC/JitCommon/JitBase.h @@ -84,6 +84,7 @@ protected: bool skipnext; bool carryFlagSet; bool carryFlagInverted; + bool next_inst_bp; int fifoBytesThisBlock;