X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxinterpreter.c;h=5756bee55ca9fb1b5ec6081e366cf5652880bcf3;hb=dc4fa8bcd7d8fb9ccd6c742a350f69e0683350e0;hp=be15f782f831f749e5b069d20538503a7c29dff3;hpb=3d1c03e76934037a5abab13f250bf5f27629d356;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxinterpreter.c b/libpcsxcore/psxinterpreter.c index be15f782..5756bee5 100644 --- a/libpcsxcore/psxinterpreter.c +++ b/libpcsxcore/psxinterpreter.c @@ -112,7 +112,8 @@ static void intException(psxRegisters *regs, u32 pc, u32 cause) if (cause != 0x20) { //FILE *f = fopen("/tmp/psx_ram.bin", "wb"); //fwrite(psxM, 1, 0x200000, f); fclose(f); - log_unhandled("exception %08x @%08x\n", cause, pc); + log_unhandled("exception %08x @%08x ra=%08x\n", + cause, pc, regs->GPR.n.ra); } dloadFlush(regs); regs->pc = pc; @@ -454,14 +455,6 @@ static void doBranchRegE(psxRegisters *regs, u32 tar) { doBranch(regs, tar, R3000A_BRANCH_TAKEN); } -#if __has_builtin(__builtin_add_overflow) || (defined(__GNUC__) && __GNUC__ >= 5) -#define add_overflow(a, b, r) __builtin_add_overflow(a, b, &(r)) -#define sub_overflow(a, b, r) __builtin_sub_overflow(a, b, &(r)) -#else -#define add_overflow(a, b, r) ({r = (u32)a + (u32)b; (a ^ ~b) & (a ^ r) & (1u<<31);}) -#define sub_overflow(a, b, r) ({r = (u32)a - (u32)b; (a ^ b) & (a ^ r) & (1u<<31);}) -#endif - static void addExc(psxRegisters *regs, u32 rt, s32 a1, s32 a2) { s32 val; if (add_overflow(a1, a2, val)) { @@ -1126,6 +1119,7 @@ OP(psxHLE) { return; } psxHLEt[hleCode](); + branchSeen = 1; } static void (INT_ATTR *psxBSC[64])(psxRegisters *regs_, u32 code) = { @@ -1344,12 +1338,15 @@ void intApplyConfig() { } static void intShutdown() { + dloadClear(&psxRegs); } -// single step (may do several ops in case of a branch) +// single step (may do several ops in case of a branch or load delay) +// called by asm/dynarec void execI(psxRegisters *regs) { - execI_(psxMemRLUT, regs); - dloadFlush(regs); + do { + execIbp(psxMemRLUT, regs); + } while (regs->dloadReg[0] || regs->dloadReg[1]); } R3000Acpu psxInt = {