setup spu r8 handlers
[pcsx_rearmed.git] / libpcsxcore / new_dynarec / emu_if.c
index 2590b3a..9d8df34 100644 (file)
@@ -12,6 +12,7 @@
 #include "events.h"
 #include "../psxhle.h"
 #include "../psxinterpreter.h"
+#include "../psxcounters.h"
 #include "../r3000a.h"
 #include "../gte_arm.h"
 #include "../gte_neon.h"
@@ -28,7 +29,9 @@ void pcsx_mtc0(u32 reg, u32 val)
        evprintf("MTC0 %d #%x @%08x %u\n", reg, val, psxRegs.pc, psxRegs.cycle);
        MTC0(&psxRegs, reg, val);
        gen_interupt(&psxRegs.CP0);
-       if (psxRegs.CP0.n.Cause & psxRegs.CP0.n.SR & 0x0300) // possible sw irq
+
+       //if (psxRegs.CP0.n.Cause & psxRegs.CP0.n.SR & 0x0300) // possible sw irq
+       if ((psxRegs.pc & 0x803ffeff) == 0x80000080)
                pending_exception = 1;
 }
 
@@ -246,8 +249,6 @@ static void ari64_reset()
 // (HLE softcall exit and BIOS fastboot end)
 static void ari64_execute_until()
 {
-       schedule_timeslice();
-
        evprintf("ari64_execute %08x, %u->%u (%d)\n", psxRegs.pc,
                psxRegs.cycle, next_interupt, next_interupt - psxRegs.cycle);
 
@@ -260,6 +261,7 @@ static void ari64_execute_until()
 static void ari64_execute()
 {
        while (!stop) {
+               schedule_timeslice();
                ari64_execute_until();
                evprintf("drc left @%08x\n", psxRegs.pc);
        }
@@ -270,6 +272,7 @@ static void ari64_execute_block(enum blockExecCaller caller)
        if (caller == EXEC_CALLER_BOOT)
                stop++;
 
+       next_interupt = psxRegs.cycle + 1;
        ari64_execute_until();
 
        if (caller == EXEC_CALLER_BOOT)
@@ -295,7 +298,9 @@ static void ari64_notify(enum R3000Anote note, void *data) {
        case R3000ACPU_NOTIFY_BEFORE_SAVE:
                break;
        case R3000ACPU_NOTIFY_AFTER_LOAD:
-               ari64_reset();
+               if (data == NULL)
+                       ari64_reset();
+               psxInt.Notify(note, data);
                break;
        }
 }