From: gameblabla Date: Sun, 21 Jul 2019 00:13:34 +0000 (+0200) Subject: psxbios: Merge interrupt_r26 fix from PCSX4ALL. X-Git-Tag: r23~156^2~9 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f23c22410abc88088a33ddf391c9fae8a1705dac;p=pcsx_rearmed.git psxbios: Merge interrupt_r26 fix from PCSX4ALL. Thanks DmitrySmagin for the fix. --- diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index b27d1957..6a52d7ef 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -307,6 +307,8 @@ static inline void DeliverEvent(u32 ev, u32 spec) { } else Event[ev][spec].status = EvStALREADY; } +static unsigned interrupt_r26=0x8004E8B0; + static inline void SaveRegs() { memcpy(regs, psxRegs.GPR.r, 32*4); regs[32] = psxRegs.GPR.n.lo; @@ -1968,6 +1970,7 @@ void psxBios_ReturnFromException() { // 17 LoadRegs(); pc0 = psxRegs.CP0.n.EPC; + k0 = interrupt_r26; if (psxRegs.CP0.n.Cause & 0x80000000) pc0 += 4; psxRegs.CP0.n.Status = (psxRegs.CP0.n.Status & 0xfffffff0) | @@ -3190,6 +3193,7 @@ void psxBiosException() { switch (psxRegs.CP0.n.Cause & 0x3c) { case 0x00: // Interrupt + interrupt_r26=psxRegs.CP0.n.EPC; #ifdef PSXCPU_LOG // PSXCPU_LOG("interrupt\n"); #endif