}
}
- if ((psxHu32(0x1070) & psxHu32(0x1074)) && (cp0->n.SR & 0x401) == 0x401) {
- psxException(0x400, 0, cp0);
+ cp0->n.Cause &= ~0x400;
+ if (psxHu32(0x1070) & psxHu32(0x1074))
+ cp0->n.Cause |= 0x400;
+ if (((cp0->n.Cause | 1) & cp0->n.SR & 0x401) == 0x401) {
+ psxException(0, 0, cp0);
pending_exception = 1;
}
}
}
// Set the Cause
- cp0->n.Cause = (bdt << 30) | (cp0->n.Cause & 0x300) | cause;
+ cp0->n.Cause = (bdt << 30) | (cp0->n.Cause & 0x700) | cause;
// Set the EPC & PC
cp0->n.EPC = bdt ? psxRegs.pc - 4 : psxRegs.pc;
}
}
- if (psxHu32(0x1070) & psxHu32(0x1074)) {
- if ((psxRegs.CP0.n.SR & 0x401) == 0x401) {
-#ifdef PSXCPU_LOG
- PSXCPU_LOG("Interrupt: %x %x\n", psxHu32(0x1070), psxHu32(0x1074));
-#endif
-// SysPrintf("Interrupt (%x): %x %x\n", psxRegs.cycle, psxHu32(0x1070), psxHu32(0x1074));
- psxException(0x400, 0, &psxRegs.CP0);
- }
- }
+ psxRegs.CP0.n.Cause &= ~0x400;
+ if (psxHu32(0x1070) & psxHu32(0x1074))
+ psxRegs.CP0.n.Cause |= 0x400;
+ if (((psxRegs.CP0.n.Cause | 1) & psxRegs.CP0.n.SR & 0x401) == 0x401)
+ psxException(0, 0, &psxRegs.CP0);
}
void psxJumpTest() {