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
This commit is contained in:
cottonvibes 2008-10-01 18:10:56 +00:00 committed by Gregory Hainaut
parent 9e850224c2
commit a85045b60f
3 changed files with 6 additions and 13 deletions

View File

@ -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;
}

View File

@ -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;

View File

@ -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;