diff --git a/src/core/cpu_recompiler_arm32.cpp b/src/core/cpu_recompiler_arm32.cpp index 1ece153ba..af6c1b2ad 100644 --- a/src/core/cpu_recompiler_arm32.cpp +++ b/src/core/cpu_recompiler_arm32.cpp @@ -695,12 +695,20 @@ void CPU::ARM32Recompiler::EndBlockWithException(Exception excode) Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL); // TODO: flush load delay - // TODO: break for pcdrv EmitMov(RARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false, inst->cop.cop_n)); EmitMov(RARG2, m_current_instruction_pc); - EmitCall(reinterpret_cast(static_cast(&CPU::RaiseException))); + if (excode != Exception::BP) + { + EmitCall(reinterpret_cast(static_cast(&CPU::RaiseException))); + } + else + { + EmitMov(RARG3, inst->bits); + EmitCall(reinterpret_cast(&CPU::RaiseBreakException)); + } + m_dirty_pc = false; EndAndLinkBlock(std::nullopt, true, false); diff --git a/src/core/cpu_recompiler_arm64.cpp b/src/core/cpu_recompiler_arm64.cpp index c4aec70cc..42d4e5448 100644 --- a/src/core/cpu_recompiler_arm64.cpp +++ b/src/core/cpu_recompiler_arm64.cpp @@ -859,12 +859,19 @@ void CPU::ARM64Recompiler::EndBlockWithException(Exception excode) Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL); // TODO: flush load delay - // TODO: break for pcdrv EmitMov(RWARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false, inst->cop.cop_n)); EmitMov(RWARG2, m_current_instruction_pc); - EmitCall(reinterpret_cast(static_cast(&CPU::RaiseException))); + if (excode != Exception::BP) + { + EmitCall(reinterpret_cast(static_cast(&CPU::RaiseException))); + } + else + { + EmitMov(RWARG3, inst->bits); + EmitCall(reinterpret_cast(&CPU::RaiseBreakException)); + } m_dirty_pc = false; EndAndLinkBlock(std::nullopt, true, false); diff --git a/src/core/cpu_recompiler_riscv64.cpp b/src/core/cpu_recompiler_riscv64.cpp index b5e38819f..aa02b8617 100644 --- a/src/core/cpu_recompiler_riscv64.cpp +++ b/src/core/cpu_recompiler_riscv64.cpp @@ -659,12 +659,19 @@ void CPU::RISCV64Recompiler::EndBlockWithException(Exception excode) Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL); // TODO: flush load delay - // TODO: break for pcdrv EmitMov(RARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false, inst->cop.cop_n)); EmitMov(RARG2, m_current_instruction_pc); - EmitCall(reinterpret_cast(static_cast(&CPU::RaiseException))); + if (excode != Exception::BP) + { + EmitCall(reinterpret_cast(static_cast(&CPU::RaiseException))); + } + else + { + EmitMov(RARG3, inst->bits); + EmitCall(reinterpret_cast(&CPU::RaiseBreakException)); + } m_dirty_pc = false; EndAndLinkBlock(std::nullopt, true, false); diff --git a/src/core/cpu_recompiler_x64.cpp b/src/core/cpu_recompiler_x64.cpp index be18802cd..edcd08081 100644 --- a/src/core/cpu_recompiler_x64.cpp +++ b/src/core/cpu_recompiler_x64.cpp @@ -598,12 +598,21 @@ void CPU::X64Recompiler::EndBlockWithException(Exception excode) Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL); // TODO: flush load delay - // TODO: break for pcdrv cg->mov(RWARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false, inst->cop.cop_n)); cg->mov(RWARG2, m_current_instruction_pc); - cg->call(static_cast(&CPU::RaiseException)); + + if (excode != Exception::BP) + { + cg->call(static_cast(&CPU::RaiseException)); + } + else + { + cg->mov(RWARG3, inst->bits); + cg->call(&CPU::RaiseBreakException); + } + m_dirty_pc = false; EndAndLinkBlock(std::nullopt, true, false);