Remove some obsolete code relating to VIF/GIF FIFOs (hwRead/Write handlers always intercept them now, so saving values back to the eeHw register mirror is ineffective).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3741 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-09-08 11:34:39 +00:00
parent e246d617ef
commit 372478c0ec
4 changed files with 28 additions and 57 deletions

View File

@ -53,7 +53,7 @@ void __fastcall ReadFIFO_VIF1(mem128_t* out)
if (vif1Regs.stat.FQC > 0)
{
GetMTGS().WaitGS();
GSreadFIFO(&psHu64(VIF1_FIFO));
GSreadFIFO(out);
vif1.GSLastDownloadSize--;
if (vif1.GSLastDownloadSize <= 16)
gifRegs.stat.OPH = false;
@ -61,7 +61,6 @@ void __fastcall ReadFIFO_VIF1(mem128_t* out)
}
}
CopyQWC( out, &psHu128(VIF1_FIFO) );
VIF_LOG("ReadFIFO/VIF1 -> %ls", out->ToString().c_str());
}
@ -72,8 +71,6 @@ void __fastcall WriteFIFO_VIF0(const mem128_t *value)
{
VIF_LOG("WriteFIFO/VIF0 <- %ls", value->ToString().c_str());
CopyQWC(&psHu128(VIF0_FIFO), value);
vif0ch.qwc += 1;
if(vif0.irqoffset != 0 && vif0.vifstalled == true) DevCon.Warning("Offset on VIF0 FIFO start!");
bool ret = VIF0transfer((u32*)value, 4);
@ -94,8 +91,6 @@ void __fastcall WriteFIFO_VIF1(const mem128_t *value)
{
VIF_LOG("WriteFIFO/VIF1 <- %ls", value->ToString().c_str());
CopyQWC(&psHu128(VIF1_FIFO), value);
if (vif1Regs.stat.FDR)
DevCon.Warning("writing to fifo when fdr is set!");
if (vif1Regs.stat.test(VIF1_STAT_INT | VIF1_STAT_VSS | VIF1_STAT_VIS | VIF1_STAT_VFS) )
@ -123,18 +118,15 @@ void __fastcall WriteFIFO_VIF1(const mem128_t *value)
pxAssertDev( ret, "vif stall code not implemented" );
}
// Dummy GIF-TAG Packet to Guarantee Count = 1
__aligned16 u128 nloop0_packet;
void __fastcall WriteFIFO_GIF(const mem128_t *value)
{
GIF_LOG("WriteFIFO/GIF <- %ls", value->ToString().c_str());
CopyQWC(&psHu128(GIF_FIFO), value);
CopyQWC(&nloop0_packet, value);
//CopyQWC(&psHu128(GIF_FIFO), value);
//CopyQWC(&nloop0_packet, value);
GetMTGS().PrepDataPacket(GIF_PATH_3, 1);
GIFPath_CopyTag( GIF_PATH_3, &nloop0_packet, 1 );
GIFPath_CopyTag( GIF_PATH_3, value, 1 );
GetMTGS().SendDataPacket();
if(GSTransferStatus.PTH3 == STOPPED_MODE && gifRegs.stat.APATH == GIF_APATH3 )
{

View File

@ -31,9 +31,6 @@ void vif0Reset()
memzero(vif0);
memzero(vif0Regs);
psHu64(VIF0_FIFO) = 0;
psHu64(VIF0_FIFO + 8) = 0;
vif0Regs.stat.VPS = VPS_IDLE;
vif0Regs.stat.FQC = 0;
@ -48,9 +45,6 @@ void vif1Reset()
memzero(vif1);
memzero(vif1Regs);
psHu64(VIF1_FIFO) = 0;
psHu64(VIF1_FIFO + 8) = 0;
vif1Regs.stat.VPS = VPS_IDLE;
vif1Regs.stat.FQC = 0; // FQC=0

View File

@ -58,7 +58,7 @@ __fi void vif1FLUSH()
void vif1TransferToMemory()
{
u32 size;
u64* pMem = (u64*)dmaGetAddr(vif1ch.madr, false);
u128* pMem = (u128*)dmaGetAddr(vif1ch.madr, false);
// VIF from gsMemory
if (pMem == NULL) //Is vif0ptag empty?
@ -78,54 +78,34 @@ void vif1TransferToMemory()
// completely and execute the transfer there-after.
//Console.Warning("Real QWC %x", vif1ch.qwc);
size = min((u32)vif1ch.qwc, vif1.GSLastDownloadSize);
const u128* pMemEnd = pMem + vif1.GSLastDownloadSize;
if (GSreadFIFO2 == NULL)
{
for (;size > 0; --size)
{
GetMTGS().WaitGS();
GSreadFIFO(&psHu64(VIF1_FIFO));
pMem[0] = psHu64(VIF1_FIFO);
pMem[1] = psHu64(VIF1_FIFO + 8);
pMem += 2;
}
if(vif1ch.qwc > vif1.GSLastDownloadSize)
{
DevCon.Warning("GS Transfer < VIF QWC, Clearing end of space");
for (size = vif1ch.qwc - vif1.GSLastDownloadSize; size > 0; --size)
{
psHu64(VIF1_FIFO) = 0;
psHu64(VIF1_FIFO + 8) = 0;
pMem[0] = psHu64(VIF1_FIFO);
pMem[1] = psHu64(VIF1_FIFO + 8);
pMem += 2;
}
GSreadFIFO((u64*)pMem);
++pMem;
}
}
else
{
GetMTGS().WaitGS();
GSreadFIFO2(pMem, size);
GSreadFIFO2((u64*)pMem, size);
pMem += size;
}
// set incase read
psHu64(VIF1_FIFO) = pMem[2*size-2];
psHu64(VIF1_FIFO + 8) = pMem[2*size-1];
pMem += size * 2;
if(vif1ch.qwc > vif1.GSLastDownloadSize)
if(pMem < pMemEnd)
{
DevCon.Warning("GS Transfer < VIF QWC, Clearing end of space");
for (size = vif1ch.qwc - vif1.GSLastDownloadSize; size > 0; --size)
{
psHu64(VIF1_FIFO) = 0;
psHu64(VIF1_FIFO + 8) = 0;
pMem[0] = psHu64(VIF1_FIFO);
pMem[1] = psHu64(VIF1_FIFO + 8);
pMem += 2;
}
}
}
__m128 zeroreg = _mm_setzero_ps();
do {
_mm_store_ps((float*)pMem, zeroreg);
++pMem;
} while (pMem < pMemEnd);
}
g_vifCycles += vif1ch.qwc * 2;
vif1ch.madr += vif1ch.qwc * 16; // mgs3 scene changes

View File

@ -58,10 +58,15 @@ enum GIF_REG
// are modified during the GIFtag unpacking process.
struct GIFTAG
{
u32 NLOOP : 15;
u32 EOP : 1;
u32 _dummy0 : 16;
u16 NLOOP : 15;
u16 EOP : 1;
// Note that contents of the Dummy bits on real hardware is likely used to maintain state
// information regarding tag processing (namely nllop and curreg info, so to resume partial
// transfers later).
u16 _dummy0 : 16;
u32 _dummy1 : 14;
u32 PRE : 1;
u32 PRIM : 11;
u32 FLG : 2;