From 29bc1337b5175d19055c3882de4d2ec523e96e3f Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Fri, 31 Oct 2008 16:59:21 +0000 Subject: [PATCH] Last fix was ok, but this fix is better. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@255 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/R3000A.c | 2 +- pcsx2/R5900.c | 3 --- pcsx2/x86/iR3000A.cpp | 6 +++++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pcsx2/R3000A.c b/pcsx2/R3000A.c index 4353877981..8dc893070c 100644 --- a/pcsx2/R3000A.c +++ b/pcsx2/R3000A.c @@ -167,7 +167,7 @@ static void _psxTestInterrupts() { // even higher and just let the IRQ/Counter targets adjust it as needed, // but I'll stick to a conservative value for the time being. -#define IOP_WAIT_CYCLE 512 // was 64 +#define IOP_WAIT_CYCLE 2048 // was 64 void psxBranchTest() { diff --git a/pcsx2/R5900.c b/pcsx2/R5900.c index 3fbd52f85b..1db5fdf4da 100644 --- a/pcsx2/R5900.c +++ b/pcsx2/R5900.c @@ -438,9 +438,6 @@ void cpuBranchTest() EEsCycle += cpuRegs.cycle - EEoCycle; EEoCycle = cpuRegs.cycle; - // Force the IOP to run at least one branch test: - // If the IOP doesn't run it's branch test, bad things can happen. - g_psxNextBranchCycle = min( g_psxNextBranchCycle, EEsCycle >> 3 ); psxCpu->ExecuteBlock(); if (VU0.VI[REG_VPU_STAT].UL & 0x1) { diff --git a/pcsx2/x86/iR3000A.cpp b/pcsx2/x86/iR3000A.cpp index 67b87e861a..e98756d0bb 100644 --- a/pcsx2/x86/iR3000A.cpp +++ b/pcsx2/x86/iR3000A.cpp @@ -997,7 +997,11 @@ static void iPsxBranchTest(u32 newpc, u32 cpuBranch) j8Ptr[2] = JG8(0); // Break the Block-execute Loop here. - if( REC_INC_STACK ) + // (but not without running another branch test! And do it regardless + // because the EE needs at least one IOP branch test or else bad things happen) + CALLFunc((uptr)psxBranchTest); + + if( REC_INC_STACK ) ADD64ItoR(ESP, REC_INC_STACK); RET2();