ppcexceptions: fix next address for decrementer exceptions.

This commit is contained in:
Maxim Poliakovski 2023-08-09 12:53:48 +02:00
parent ee9c692115
commit d2e7c9a5df
1 changed files with 5 additions and 1 deletions

View File

@ -89,7 +89,11 @@ void ppc_exception_handler(Except_Type exception_type, uint32_t srr1_bits) {
break;
case Except_Type::EXC_DECR:
ppc_state.spr[SPR::SRR0] = (ppc_state.pc & 0xFFFFFFFC) + 4;
if (exec_flags & ~EXEF_TIMER) {
ppc_state.spr[SPR::SRR0] = ppc_next_instruction_address;
} else {
ppc_state.spr[SPR::SRR0] = (ppc_state.pc & 0xFFFFFFFCUL) + 4;
}
ppc_next_instruction_address = 0x0900;
break;