X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fpsxevents.c;fp=libpcsxcore%2Fnew_dynarec%2Fevents.c;h=06089f2ea8f0ba8d7b19e26df7cef660f6d9a8c6;hp=2bc93326f8453848af224bf5b97f754de618c0fc;hb=9a0a61d27586bfb93aa443cc59d9588d2b9cf992;hpb=bf58ac4cd633bbd3c40bd7f79f9e00b98e156572 diff --git a/libpcsxcore/new_dynarec/events.c b/libpcsxcore/psxevents.c similarity index 79% rename from libpcsxcore/new_dynarec/events.c rename to libpcsxcore/psxevents.c index 2bc93326..06089f2e 100644 --- a/libpcsxcore/new_dynarec/events.c +++ b/libpcsxcore/psxevents.c @@ -1,9 +1,9 @@ #include -#include "../r3000a.h" -#include "../cdrom.h" -#include "../psxdma.h" -#include "../mdec.h" -#include "events.h" +#include "r3000a.h" +#include "cdrom.h" +#include "psxdma.h" +#include "mdec.h" +#include "psxevents.h" extern int pending_exception; @@ -31,6 +31,9 @@ u32 schedule_timeslice(void) return next_interupt; } +static void irqNoOp() { +} + typedef void (irq_func)(); static irq_func * const irq_funcs[] = { @@ -43,6 +46,7 @@ static irq_func * const irq_funcs[] = { [PSXINT_MDECINDMA] = mdec0Interrupt, [PSXINT_GPUOTCDMA] = gpuotcInterrupt, [PSXINT_CDRDMA] = cdrDmaInterrupt, + [PSXINT_NEWDRC_CHECK] = irqNoOp, [PSXINT_CDRLID] = cdrLidSeekInterrupt, [PSXINT_IRQ10] = irq10Interrupt, [PSXINT_SPU_UPDATE] = spuUpdate, @@ -50,7 +54,7 @@ static irq_func * const irq_funcs[] = { }; /* local dupe of psxBranchTest, using event_cycles */ -static void irq_test(psxCP0Regs *cp0) +void irq_test(psxCP0Regs *cp0) { u32 cycle = psxRegs.cycle; u32 irq, irq_bits; @@ -88,4 +92,13 @@ void gen_interupt(psxCP0Regs *cp0) next_interupt, next_interupt - psxRegs.cycle); } +void events_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; +}