CPU: Fix exceptions clobbering cop0.cause.Ip

Fixes Gran Turismo 2 (PAL).
This commit is contained in:
Connor McLaughlin 2020-08-14 23:52:34 +10:00
parent 80517377d1
commit 025e01ca47

View file

@ -190,7 +190,7 @@ void RaiseException(Exception excode)
void RaiseException(u32 CAUSE_bits, u32 EPC) void RaiseException(u32 CAUSE_bits, u32 EPC)
{ {
g_state.cop0_regs.EPC = EPC; g_state.cop0_regs.EPC = EPC;
g_state.cop0_regs.cause.bits = (g_state.cop0_regs.cause.bits & !Cop0Registers::CAUSE::EXCEPTION_WRITE_MASK) | g_state.cop0_regs.cause.bits = (g_state.cop0_regs.cause.bits & ~Cop0Registers::CAUSE::EXCEPTION_WRITE_MASK) |
(CAUSE_bits & Cop0Registers::CAUSE::EXCEPTION_WRITE_MASK); (CAUSE_bits & Cop0Registers::CAUSE::EXCEPTION_WRITE_MASK);
#ifdef _DEBUG #ifdef _DEBUG