Fix the VU interpreter (and occasionally sVU) addressing change from r3697.

Fix an sVU regression from way back in r3549 (God of War, Tales of the Abyss).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3850 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1 2010-09-28 19:07:17 +00:00
parent 24df80f5e0
commit 0bb42e1331
2 changed files with 7 additions and 4 deletions

View File

@ -1578,9 +1578,12 @@ static __fi void _vuMR32(VURegs * VU) {
__fi u32* GET_VU_MEM(VURegs* VU, u32 addr) // non-static, also used by sVU for now.
{
if( VU == &vuRegs[1] ) return (u32*)(vuRegs[1].Mem+(addr&0x3fff));
if( addr & 0x4000 ) return (u32*)(vuRegs[1].VF+(addr&0x3f0)); // get VF and VI regs (they're mapped to 0x4xx0 in VU0 mem!)
return (u32*)(vuRegs[0].Mem+(addr&0x0fff)); // for addr 0x0000 to 0x4000 just wrap around
if (VU == &vuRegs[1])
return (u32*)(vuRegs[1].Mem + (addr & 0x3fff));
else if (addr & 0x4000)
return (u32*)((u8*)vuRegs[1].VF + (addr & 0x3ff)); // get VF and VI regs (they're mapped to 0x4xx0 in VU0 mem!)
else
return (u32*)(vuRegs[0].Mem + (addr & 0xfff)); // for addr 0x0000 to 0x4000 just wrap around
}
static __ri void _vuLQ(VURegs * VU) {

View File

@ -489,7 +489,7 @@ static void __fastcall SuperVUClear(u32 startpc, u32 size, int vuindex)
{
vector<VuFunctionHeader::RANGE>::iterator itrange;
list<VuFunctionHeader*>::iterator it = s_listVUHeaders[vuindex].begin();
u32 endpc = startpc + (size + (8 - (size & 7))); // Adding this code to ensure size is always a multiple of 8, it can be simplified to startpc+size if size is always a multiple of 8 (cottonvibes)
u32 endpc = startpc + ((size * 4 + 7) & ~7); // Adding this code to ensure size is always a multiple of 8, it can be simplified to startpc+size if size is always a multiple of 8 (cottonvibes)
while (it != s_listVUHeaders[vuindex].end())
{