From 05a2e4099d0291dfd5fd36922aebb7129068ba25 Mon Sep 17 00:00:00 2001 From: "SND\\shalma_cp" Date: Sun, 5 Sep 2010 01:21:10 +0000 Subject: GameShark Sampler + GameShark 2: Give longer VSync delay before exception sees it (fixes black screens) git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@56826 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/r3000a.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/libpcsxcore/r3000a.c b/libpcsxcore/r3000a.c index 550a17bb..b1ffdc9a 100644 --- a/libpcsxcore/r3000a.c +++ b/libpcsxcore/r3000a.c @@ -110,11 +110,23 @@ void psxException(u32 code, u32 bd) { if (Config.HLE) psxBiosException(); } -void psxBranchTest() { +void psxBranchTest() { + if (psxHu32(0x1070) & psxHu32(0x1074)) { + if ((psxRegs.CP0.n.Status & 0x401) == 0x401) { +#ifdef PSXCPU_LOG + PSXCPU_LOG("Interrupt: %x %x\n", psxHu32(0x1070), psxHu32(0x1074)); +#endif +// SysPrintf("Interrupt (%x): %x %x\n", psxRegs.cycle, psxHu32(0x1070), psxHu32(0x1074)); + psxException(0x400, 0); + } + } + + // Give Vsync ~2-15+ cycles before exception eats it if ((psxRegs.cycle - psxNextsCounter) >= psxNextCounter) psxRcntUpdate(); if (psxRegs.interrupt) { + //if (1) { if ((psxRegs.interrupt & (1 << PSXINT_SIO)) && !Config.Sio) { // sio if ((psxRegs.cycle - psxRegs.intCycle[PSXINT_SIO].sCycle) >= psxRegs.intCycle[PSXINT_SIO].cycle) { psxRegs.interrupt &= ~(1 << PSXINT_SIO); @@ -172,16 +184,6 @@ void psxBranchTest() { } } } - - if (psxHu32(0x1070) & psxHu32(0x1074)) { - if ((psxRegs.CP0.n.Status & 0x401) == 0x401) { -#ifdef PSXCPU_LOG - PSXCPU_LOG("Interrupt: %x %x\n", psxHu32(0x1070), psxHu32(0x1074)); -#endif -// SysPrintf("Interrupt (%x): %x %x\n", psxRegs.cycle, psxHu32(0x1070), psxHu32(0x1074)); - psxException(0x400, 0); - } - } } void psxJumpTest() { -- cgit v1.2.3