X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxbios.c;h=432b0e2c163aef7f52ca627dcfe52f7a3d0dab92;hb=4bb8d7e16bad9322d862d6d0dcaa048d75064c1f;hp=bad34578eee860430c5b576eca51e38155f288da;hpb=de74f59932e94887debf30e5ec437d7f63591f74;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index bad34578..432b0e2c 100644 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -398,14 +398,17 @@ static inline void softCall(u32 pc) { ra = 0x80001000; psxRegs.CP0.n.SR &= ~0x404; // disable interrupts + assert(psxRegs.cpuInRecursion <= 1); + psxRegs.cpuInRecursion++; psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, PTR_1); - while (pc0 != 0x80001000 && ++lim < 1000000) + while (pc0 != 0x80001000 && ++lim < 0x100000) psxCpu->ExecuteBlock(EXEC_CALLER_HLE); psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, PTR_1); + psxRegs.cpuInRecursion--; - if (lim == 1000000) + if (lim == 0x100000) PSXBIOS_LOG("softCall @%x hit lim\n", pc); ra = sra; psxRegs.CP0.n.SR |= ssr & 0x404; @@ -421,14 +424,16 @@ static inline void softCallInException(u32 pc) { return; ra = 0x80001000; + psxRegs.cpuInRecursion++; psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, PTR_1); - while (!returned_from_exception() && pc0 != 0x80001000 && ++lim < 1000000) + while (!returned_from_exception() && pc0 != 0x80001000 && ++lim < 0x100000) psxCpu->ExecuteBlock(EXEC_CALLER_HLE); psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, PTR_1); + psxRegs.cpuInRecursion--; - if (lim == 1000000) + if (lim == 0x100000) PSXBIOS_LOG("softCallInException @%x hit lim\n", pc); if (pc0 == 0x80001000) ra = sra; @@ -4035,6 +4040,7 @@ void psxBiosException() { sp = fp = loadRam32(A_EXC_SP); gp = A_EXC_GP; use_cycles(46); + assert(!psxRegs.cpuInRecursion); // do the chains (always 4) for (c = lim = 0; c < 4; c++) { @@ -4175,7 +4181,7 @@ void (* const psxHLEt[24])() = { hleExcPadCard1, hleExcPadCard2, }; -void psxBiosCheckExe(u32 t_addr, u32 t_size) +void psxBiosCheckExe(u32 t_addr, u32 t_size, int loading_state) { // lw $v0, 0x10($sp) // nop @@ -4213,7 +4219,8 @@ void psxBiosCheckExe(u32 t_addr, u32 t_size) if ((SWAP32(r32[i + j]) >> 16) != 0x3c04) // lui continue; - SysPrintf("HLE vsync @%08x\n", start + i * 4); + if (!loading_state) + SysPrintf("HLE vsync @%08x\n", start + i * 4); psxRegs.biosBranchCheck = (t_addr & 0xa01ffffc) + i * 4; } }