From f23c22410abc88088a33ddf391c9fae8a1705dac Mon Sep 17 00:00:00 2001 From: gameblabla Date: Sun, 21 Jul 2019 02:13:34 +0200 Subject: [PATCH] psxbios: Merge interrupt_r26 fix from PCSX4ALL. Thanks DmitrySmagin for the fix. --- libpcsxcore/psxbios.c | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.39.5