emulate pending irq bit somewhat
[pcsx_rearmed.git] / libpcsxcore / new_dynarec / events.c
index 71aed6b..2a06c1f 100644 (file)
@@ -68,8 +68,11 @@ static void irq_test(psxCP0Regs *cp0)
                }
        }
 
-       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;
        }
 }