fixed some vif stuff.

not sure if any game was using the code in hwwrite.cpp, so i couldn't test the fix.
the old code was wrong though (unless it was trying to implement some undocumented feature which i doubt).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2516 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-01-24 22:50:18 +00:00
parent 2698b3da1b
commit 34fa47eba1
3 changed files with 15 additions and 13 deletions

View File

@ -121,17 +121,15 @@ tDMAC_QUEUE QueuedDMA(0);
void hwWrite8(u32 mem, u8 value) void hwWrite8(u32 mem, u8 value)
{ {
if ((mem >= VIF0_STAT) && (mem < VIF0_FIFO)) if ((mem >= VIF0_STAT) && (mem < VIF0_FIFO))
{ {
DevCon.WriteLn("vif write8!"); // Is this ever called?
u32 bytemod = mem & 0x3; u32 bytemod = mem & 0x3;
u32 bitpos = 8 * bytemod; u32 bitpos = 8 * bytemod;
u32 newval = psHu8(mem) & (255UL << bitpos); u32 oldval = ~(0xff << bitpos) & psHu32(mem);
u32 newval = (value << bitpos) | oldval;
if (mem < VIF1_STAT) if (mem < VIF1_STAT) vif0Write32(mem & ~0x3, newval);
vif0Write32( mem & ~0x3, newval | (value<<bitpos)); else vif1Write32(mem & ~0x3, newval);
else
vif1Write32( mem & ~0x3, newval | (value<<bitpos));
return; return;
} }

View File

@ -426,7 +426,8 @@ void vif0Write32(u32 mem, u32 value)
case VIF0_R2: case VIF0_R2:
case VIF0_R3: case VIF0_R3:
pxAssume((mem&0xf) == 0); pxAssume((mem&0xf) == 0);
g_vifmask.Row0[(mem>>4) & 3] = value; g_vifmask.Row0 [ (mem>>4)&3 ] = value;
((u32*)&vif0Regs->r0)[((mem>>4)&3)*4] = value;
break; break;
case VIF0_C0: case VIF0_C0:
@ -434,7 +435,8 @@ void vif0Write32(u32 mem, u32 value)
case VIF0_C2: case VIF0_C2:
case VIF0_C3: case VIF0_C3:
pxAssume((mem&0xf) == 0); pxAssume((mem&0xf) == 0);
g_vifmask.Col0[(mem>>4) & 3] = value; g_vifmask.Col0 [ (mem>>4)&3 ] = value;
((u32*)&vif0Regs->c0)[((mem>>4)&3)*4] = value;
break; break;
default: default:

View File

@ -669,7 +669,8 @@ void vif1Write32(u32 mem, u32 value)
case VIF1_R2: case VIF1_R2:
case VIF1_R3: case VIF1_R3:
pxAssume((mem&0xf) == 0); pxAssume((mem&0xf) == 0);
g_vifmask.Row1[(mem>>4) & 3] = value; g_vifmask.Row1 [ (mem>>4)&3 ] = value;
((u32*)&vif1Regs->r0)[((mem>>4)&3)*4] = value;
break; break;
case VIF1_C0: case VIF1_C0:
@ -677,7 +678,8 @@ void vif1Write32(u32 mem, u32 value)
case VIF1_C2: case VIF1_C2:
case VIF1_C3: case VIF1_C3:
pxAssume((mem&0xf) == 0); pxAssume((mem&0xf) == 0);
g_vifmask.Col1[(mem>>4) & 3] = value; g_vifmask.Col1 [ (mem>>4)&3 ] = value;
((u32*)&vif1Regs->c0)[((mem>>4)&3)*4] = value;
break; break;
default: default: