From 25150268cd8957aef2804c0a9a1e70a433e421eb Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Mon, 10 Jul 2023 14:06:20 +0200 Subject: [PATCH] ppcexceptions: fix ISI exception target address. --- cpu/ppc/ppcexceptions.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cpu/ppc/ppcexceptions.cpp b/cpu/ppc/ppcexceptions.cpp index 0356c49..892e8b3 100644 --- a/cpu/ppc/ppcexceptions.cpp +++ b/cpu/ppc/ppcexceptions.cpp @@ -1,6 +1,6 @@ /* DingusPPC - The Experimental PowerPC Macintosh emulator -Copyright (C) 2018-21 divingkatae and maximum +Copyright (C) 2018-23 divingkatae and maximum (theweirdo) spatium (Contact divingkatae#1017 or powermax#2286 on Discord for more info) @@ -56,7 +56,11 @@ void ppc_exception_handler(Except_Type exception_type, uint32_t srr1_bits) { break; case Except_Type::EXC_ISI: - ppc_state.spr[SPR::SRR0] = ppc_next_instruction_address; + if (exec_flags & ~EXEF_TIMER) { + ppc_state.spr[SPR::SRR0] = ppc_next_instruction_address; + } else { + ppc_state.spr[SPR::SRR0] = ppc_state.pc & 0xFFFFFFFCUL; + } ppc_next_instruction_address = 0x0400; break;