From 9e649ce79850f6c39fa16ea5a207659bb2e5b052 Mon Sep 17 00:00:00 2001 From: skidau Date: Sat, 3 Mar 2012 14:26:39 +1100 Subject: [PATCH] Added additional checks to ensure that only a FIFO breakpoint exception is handled. This fixes the hangs in games like de Blob, Xenoblade and Super Mario Galaxy introduced by r9e398fd41802. --- Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp index a98df95fc3..07eb36d263 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit.cpp @@ -571,7 +571,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc } // Add an external exception check if the instruction writes to the FIFO. - if (jit->js.fifoWriteAddresses.find(js.compilerPC) != jit->js.fifoWriteAddresses.end()) + if (jit->js.fifoWriteAddresses.find(ops[i].address) != jit->js.fifoWriteAddresses.end()) { gpr.Flush(FLUSH_ALL); fpr.Flush(FLUSH_ALL); @@ -580,10 +580,16 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc FixupBranch noExtException = J_CC(CC_Z); TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), Imm32(ProcessorInterface::INT_CAUSE_CP)); FixupBranch noCPInt = J_CC(CC_Z); + TEST(32, M((void *)&ProcessorInterface::m_InterruptCause), + Imm32(ProcessorInterface::INT_CAUSE_PE_TOKEN | + ProcessorInterface::INT_CAUSE_PE_FINISH | + ProcessorInterface::INT_CAUSE_DSP)); + FixupBranch ClearInt = J_CC(CC_NZ); - MOV(32, M(&PC), Imm32(js.compilerPC)); + MOV(32, M(&PC), Imm32(ops[i].address)); WriteExceptionExit(); + SetJumpTarget(ClearInt); SetJumpTarget(noCPInt); SetJumpTarget(noExtException); }