mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
9e850224c2
commit
a85045b60f
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue