#include "emu_if.h"
#include "pcsxmem.h"
-#include "events.h"
#include "../psxhle.h"
#include "../psxinterpreter.h"
+#include "../psxcounters.h"
+#include "../psxevents.h"
#include "../r3000a.h"
#include "../gte_arm.h"
#include "../gte_neon.h"
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;
}
MTC0(&psxRegs, reg, val);
}
-static void new_dyna_restore(void)
-{
- int i;
- for (i = 0; i < PSXINT_COUNT; i++)
- event_cycles[i] = psxRegs.intCycle[i].sCycle + psxRegs.intCycle[i].cycle;
-
- event_cycles[PSXINT_RCNT] = psxNextsCounter + psxNextCounter;
- psxRegs.interrupt |= 1 << PSXINT_RCNT;
- psxRegs.interrupt &= (1 << PSXINT_COUNT) - 1;
-
- new_dyna_pcsx_mem_load_state();
-}
-
void new_dyna_freeze(void *f, int mode)
{
const char header_save[8] = "ariblks";
SaveFuncs.write(f, addrs, size);
}
else {
- new_dyna_restore();
+ new_dyna_pcsx_mem_load_state();
bytes = SaveFuncs.read(f, header, sizeof(header));
if (bytes != sizeof(header) || strcmp(header, header_save)) {
{
new_dyna_pcsx_mem_reset();
new_dynarec_invalidate_all_pages();
- new_dyna_restore();
+ new_dyna_pcsx_mem_load_state();
pending_exception = 1;
}
// (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);
static void ari64_execute()
{
while (!stop) {
+ schedule_timeslice();
ari64_execute_until();
evprintf("drc left @%08x\n", psxRegs.pc);
}
if (caller == EXEC_CALLER_BOOT)
stop++;
+ next_interupt = psxRegs.cycle + 1;
ari64_execute_until();
if (caller == EXEC_CALLER_BOOT)
case R3000ACPU_NOTIFY_BEFORE_SAVE:
break;
case R3000ACPU_NOTIFY_AFTER_LOAD:
- ari64_reset();
+ if (data == NULL)
+ ari64_reset();
+ psxInt.Notify(note, data);
break;
}
}