pcsx2: try to ensure better sync with FIFO read call

First wait will ensure correctness of GS register.
2nd wait will ensure that the GS fifo read call is finished

(If I understand MTGS correctly)
This commit is contained in:
Gregory Hainaut 2014-05-01 16:35:24 +02:00
parent 14efa6fbda
commit c6d8b52d26
3 changed files with 6 additions and 2 deletions

View File

@ -50,8 +50,9 @@ void __fastcall ReadFIFO_VIF1(mem128_t* out)
DevCon.Warning("Warning! GS Download size < FIFO count!");
}
if (vif1Regs.stat.FQC > 0) {
GetMTGS().SendPointerPacket(GS_RINGTYPE_READ_FIFO1, 0, out);
GetMTGS().WaitGS();
GetMTGS().SendPointerPacket(GS_RINGTYPE_READ_FIFO1, 0, out);
GetMTGS().WaitGS(false); // wait without reg sync
vif1.GSLastDownloadSize--;
GUNIT_LOG("ReadFIFO_VIF1");
if (vif1.GSLastDownloadSize <= 16)

View File

@ -496,10 +496,12 @@ void SysMtgsThread::ExecuteTaskInThread()
break;
case GS_RINGTYPE_READ_FIFO1:
MTGS_LOG( "(MTGS Packet Read) ringtype=Fifo1" );
GSreadFIFO( (u64*)tag.data[1]);
break;
case GS_RINGTYPE_READ_FIFO2:
MTGS_LOG( "(MTGS Packet Read) ringtype=Fifo2, size=%d", tag.data[0] );
GSreadFIFO2( (u64*)tag.data[1], tag.data[0]);
break;

View File

@ -67,8 +67,9 @@ void vif1TransferToMemory()
pxAssert(p3.isDone() || !p3.gifTag.isValid);
}
GetMTGS().SendPointerPacket(GS_RINGTYPE_READ_FIFO2, size, pMem);
GetMTGS().WaitGS();
GetMTGS().SendPointerPacket(GS_RINGTYPE_READ_FIFO2, size, pMem);
GetMTGS().WaitGS(false); // wait without reg sync
pMem += size;
if(pMem < pMemEnd) {