From 58f5c99100f30c02afa7086fdde360d83220c3b2 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Wed, 14 Apr 2021 19:01:43 +1000 Subject: [PATCH] Bus: Fix incorrect EPC for IBE exceptions --- src/core/bus.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/bus.cpp b/src/core/bus.cpp index 01d6ff539..6d4e6728e 100644 --- a/src/core/bus.cpp +++ b/src/core/bus.cpp @@ -1693,7 +1693,10 @@ bool FetchInstruction() case 0x07: // KSEG2 default: { - CPU::RaiseException(address, Cop0Registers::CAUSE::MakeValueForException(Exception::IBE, false, false, 0)); + CPU::RaiseException(Cop0Registers::CAUSE::MakeValueForException(Exception::IBE, + g_state.current_instruction_in_branch_delay_slot, + g_state.current_instruction_was_branch_taken, 0), + address); return false; } }