VU Interpreter: Implement branch in branch delay slot handling, fixing hot wheels when using VU Interpreter. Might be buggy, but better than without it ;p

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5248 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2012-05-30 21:18:31 +00:00
parent 8862d0c963
commit ca6b638303
4 changed files with 29 additions and 2 deletions

View File

@ -139,6 +139,8 @@ struct __aligned16 VURegs {
// classes requires considerable code refactoring. Maybe later. >_<
u32 branch;
u32 branchpc;
u32 delaybranchpc;
bool takedelaybranch;
// MAC/Status flags -- these are used by interpreters and superVU, but are kind of hacky
// and shouldn't be relied on for any useful/valid info. Would like to move them out of

View File

@ -148,6 +148,14 @@ static void _vu0Exec(VURegs* VU)
VU->branch--;
if (VU->branch == 0) {
VU->VI[REG_TPC].UL = VU->branchpc;
if(VU->takedelaybranch == true)
{
//DevCon.Warning("Setting VU0 Delay branch to next branch, treating first as delay slot");
VU->branchpc = VU->delaybranchpc;
VU->delaybranchpc = 0;
VU->branch = 2;
VU->takedelaybranch = false;
}
}
}

View File

@ -144,6 +144,14 @@ static void _vu1Exec(VURegs* VU)
if (VU->branch > 0) {
if (VU->branch-- == 1) {
VU->VI[REG_TPC].UL = VU->branchpc;
if(VU->takedelaybranch == true)
{
//DevCon.Warning("Setting VU1 Delay branch to next branch, treating first as delay slot");
VU->branchpc = VU->delaybranchpc;
VU->delaybranchpc = 0;
VU->branch = 2;
VU->takedelaybranch = false;
}
}
}

View File

@ -1873,8 +1873,17 @@ s32 _branchAddr(VURegs * VU) {
}
static __fi void _setBranch(VURegs * VU, u32 bpc) {
VU->branch = 2;
VU->branchpc = bpc;
if(VU->branch == 1)
{
//DevCon.Warning("Branch in Branch Delay slot!");
VU->delaybranchpc = bpc;
VU->takedelaybranch = true;
}
else
{
VU->branch = 2;
VU->branchpc = bpc;
}
}
static __ri void _vuIBEQ(VURegs * VU) {