X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fr3000a.c;h=82eb88578534c9a3411eb5806b655aacb7cae03b;hp=1e8d0b0e4eb6aea81dd698fbce212d75d4008fbd;hb=bdd050c3ed792381df2e744fee5b7ee80b93fd68;hpb=665e364a0aba523bb555f369efe4c7be966a6666 diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 1e8d0b0e..82eb8857 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -79,17 +79,17 @@ void psxShutdown() { } void psxException(u32 code, u32 bd) { - if (!Config.HLE && (((PSXMu32(psxRegs.pc) >> 24) & 0xfe) == 0x4a)) { + if (!Config.HLE && ((((psxRegs.code = PSXMu32(psxRegs.pc)) >> 24) & 0xfe) == 0x4a)) { // "hokuto no ken" / "Crash Bandicot 2" ... // BIOS does not allow to return to GTE instructions // (just skips it, supposedly because it's scheduled already) - // so we step over it with the interpreter - extern void execI(); - execI(); + // so we execute it here + extern void (*psxCP2[64])(void *cp2regs); + psxCP2[psxRegs.code & 0x3f](&psxRegs.CP2D); } // Set the Cause - psxRegs.CP0.n.Cause = code; + psxRegs.CP0.n.Cause = (psxRegs.CP0.n.Cause & 0x300) | code; // Set the EPC & PC if (bd) { @@ -185,6 +185,12 @@ void psxBranchTest() { cdrLidSeekInterrupt(); } } + if (psxRegs.interrupt & (1 << PSXINT_SPU_UPDATE)) { // scheduled spu update + if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_SPU_UPDATE].sCycle) >= psxRegs.intCycle[PSXINT_SPU_UPDATE].cycle) { + psxRegs.interrupt &= ~(1 << PSXINT_SPU_UPDATE); + spuUpdate(); + } + } } if (psxHu32(0x1070) & psxHu32(0x1074)) {