From a85045b60ff1dd8b5f6cde62f473a9e1cc57932e Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Wed, 1 Oct 2008 18:10:56 +0000 Subject: [PATCH] according to psxAuthor, branches wrap around when the result is less than zero; so i'm trying this. should fix some possible graphic problems/errors caused by incorrect VU branch addresses... git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@166 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/VUops.c | 13 +++---------- pcsx2/x86/iVUmicro.c | 2 +- pcsx2/x86/iVUzerorec.cpp | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/pcsx2/VUops.c b/pcsx2/VUops.c index 92a05c6bf4..f23b928c1f 100644 --- a/pcsx2/VUops.c +++ b/pcsx2/VUops.c @@ -1876,16 +1876,9 @@ void _vuFCGET(VURegs * VU) { } s32 _branchAddr(VURegs * VU) { - s32 bpc = VU->VI[REG_TPC].SL + _Imm11_ * 8; - if (bpc < 0) { - bpc = VU->VI[REG_TPC].SL + _UImm11_ * 8; - } - if (VU == &VU1) { - bpc&= 0x3fff; - } else { - bpc&= 0x0fff; - } - + s32 bpc = VU->VI[REG_TPC].SL + ( _Imm11_ * 8 ); + //if (bpc < 0) bpc = VU->VI[REG_TPC].SL + _UImm11_ * 8; + bpc&= (VU == &VU1) ? 0x3fff : 0x0fff; return bpc; } diff --git a/pcsx2/x86/iVUmicro.c b/pcsx2/x86/iVUmicro.c index 4c806b04be..5a6c213e8e 100644 --- a/pcsx2/x86/iVUmicro.c +++ b/pcsx2/x86/iVUmicro.c @@ -5021,7 +5021,7 @@ static s32 _recbranchAddr(VURegs * VU) { bpc = pc + (_Imm11_ << 3); - if (bpc < 0) bpc = pc + (_UImm11_ << 3); + //if (bpc < 0) bpc = pc + (_UImm11_ << 3); bpc&= (VU == &VU1) ? 0x3fff: 0x0fff; return bpc; diff --git a/pcsx2/x86/iVUzerorec.cpp b/pcsx2/x86/iVUzerorec.cpp index 45a0e4c57e..7b18276743 100644 --- a/pcsx2/x86/iVUzerorec.cpp +++ b/pcsx2/x86/iVUzerorec.cpp @@ -904,11 +904,11 @@ static VuFunctionHeader* SuperVURecompileProgram(u32 startpc, int vuindex) static int _recbranchAddr(u32 vucode) { s32 bpc = pc + (_Imm11_ << 3); - +/* if ( bpc < 0 ) { SysPrintf("zerorec branch warning: bpc < 0 ( %x ); Using unsigned imm11\n", bpc); bpc = pc + (_UImm11_ << 3); - } + }*/ bpc &= (s_MemSize[s_vu]-1); return bpc;