newVif: Added support for vif0. Also enabled newVif by default since it seems compatible enough.

Comment if this revision breaks anything.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2449 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2010-01-18 05:04:00 +00:00
parent 33bc8652e2
commit 6dcc91b9c5
4 changed files with 22 additions and 11 deletions

View File

@ -49,6 +49,10 @@ void vif0Init()
}
SetNewMask(g_vif0Masks, g_vif0HasMask3, 0, 0xffffffff);
#if newVif0
initNewVif(0);
#endif
}
static __forceinline void vif0UNPACK(u32 *data)
@ -222,6 +226,10 @@ static int __fastcall Vif0TransMPG(u32 *data) // MPG
static int __fastcall Vif0TransUnpack(u32 *data) // UNPACK
{
#if newVif0
return nVifUnpack(0, (u8*)data);
#endif
int ret;
XMMRegisters::Freeze();
@ -786,6 +794,10 @@ void vif0Reset()
vif0Regs->stat.FQC = 0;
vif0.done = true;
#if newVif0
resetNewVif(0);
#endif
}
void SaveStateBase::vif0Freeze()

View File

@ -58,12 +58,10 @@ __forceinline void vif1FLUSH()
void vif1Init()
{
SetNewMask(g_vif1Masks, g_vif1HasMask3, 0, 0xffffffff);
#if newVif1
extern void initNewVif(int idx);
initNewVif(1);
#endif
SetNewMask(g_vif1Masks, g_vif1HasMask3, 0, 0xffffffff);
}
static __forceinline void vif1UNPACK(u32 *data)
@ -320,9 +318,9 @@ static int __fastcall Vif1TransDirectHL(u32 *data)
}
static int __fastcall Vif1TransUnpack(u32 *data)
{
#if newVif1
#if newVif1
return nVifUnpack(1, (u8*)data);
#endif
#endif
XMMRegisters::Freeze();
@ -1189,7 +1187,6 @@ void vif1Reset()
cpuRegs.interrupt &= ~((1 << 1) | (1 << 10)); //Stop all vif1 DMA's
#if newVif1
extern void resetNewVif(int idx);
resetNewVif(1);
#endif
}

View File

@ -85,12 +85,14 @@ static __forceinline u32 vif_size(u8 num)
// All defines are enabled with '1' or disabled with '0'
#define newVif 0 // Enable 'newVif' Code (if the below macros are not defined, it will use old non-sse code)
#define newVif1 0 // Use New Code for Vif1 Unpacks (needs newVif defined)
#define newVif0 0 // Use New Code for Vif0 Unpacks (not implemented)
#define newVif 1 // Enable 'newVif' Code (if the below macros are not defined, it will use old non-sse code)
#define newVif1 1 // Use New Code for Vif1 Unpacks (needs newVif defined)
#define newVif0 1 // Use New Code for Vif0 Unpacks (not implemented)
#if newVif
extern int nVifUnpack(int idx, u8 *data);
extern int nVifUnpack (int idx, u8 *data);
extern void initNewVif (int idx);
extern void resetNewVif(int idx);
#else
//# define NON_SSE_UNPACKS // Turns off SSE Unpacks (slower)
#endif

View File

@ -273,7 +273,7 @@ _f void dVifUnpack(int idx, u8 *data, u32 size, bool isFill) {
}
return;
}
DevCon.WriteLn("nVif: Recompiled Block! [%d]", nVif[idx].numBlocks++);
DevCon.WriteLn("nVif%d: Recompiled Block! [%d]", idx, nVif[idx].numBlocks++);
//DevCon.WriteLn(L"[num=% 3d][upkType=0x%02x][scl=%d][cl=%d][wl=%d][mode=%d][m=%d][mask=%s]",
// _vBlock.num, _vBlock.upkType, _vBlock.scl, _vBlock.cl, _vBlock.wl, _vBlock.mode,
// doMask >> 4, doMask ? wxsFormat( L"0x%08x", _vBlock.mask ).c_str() : L"ignored"