X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxbios.c;h=19e0fe415a078f7dbc464f93b414fe7ff87bed65;hb=11d23573173ec4b5074eb35665c6012a46034d5c;hp=dc726e481a44f753e57319c8825697470b8384c5;hpb=f7cfdeaf523c698f962812f171822d801d042f23;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index dc726e48..19e0fe41 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -47,6 +47,8 @@ #define PSXBIOS_LOG(...) #endif +#define PTR_1 (void *)(size_t)1 + char *biosA0n[256] = { // 0x00 "open", "lseek", "read", "write", @@ -384,9 +386,13 @@ static inline void softCall(u32 pc) { ra = 0x80001000; psxRegs.CP0.n.SR &= ~0x404; // disable interrupts + psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, PTR_1); + while (pc0 != 0x80001000 && ++lim < 1000000) psxCpu->ExecuteBlock(EXEC_CALLER_HLE); + psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, PTR_1); + if (lim == 1000000) PSXBIOS_LOG("softCall @%x hit lim\n", pc); ra = sra; @@ -403,9 +409,13 @@ static inline void softCallInException(u32 pc) { return; ra = 0x80001000; + psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, PTR_1); + while (!returned_from_exception() && pc0 != 0x80001000 && ++lim < 1000000) psxCpu->ExecuteBlock(EXEC_CALLER_HLE); + psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, PTR_1); + if (lim == 1000000) PSXBIOS_LOG("softCallInException @%x hit lim\n", pc); if (pc0 == 0x80001000) @@ -1859,9 +1869,13 @@ void psxBios_GetRCnt() { // 03 PSXBIOS_LOG("psxBios_%s\n", biosB0n[0x03]); #endif - a0&= 0x3; - if (a0 != 3) v0 = psxRcntRcount(a0); - else v0 = 0; + switch (a0 & 0x3) + { + case 0: v0 = psxRcntRcount0(); break; + case 1: v0 = psxRcntRcount1(); break; + case 2: v0 = psxRcntRcount2(); break; + case 3: v0 = 0; break; + } pc0 = ra; }