From f78c39cc98e0a4b2ce81e488c3375ef536678ee1 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 23 Mar 2014 15:29:41 +0100 Subject: [PATCH] pcsx2: call GSReadFIFO from GS thread (was EE) --- pcsx2/FiFo.cpp | 2 +- pcsx2/GS.h | 2 ++ pcsx2/MTGS.cpp | 8 ++++++++ pcsx2/Vif1_Dma.cpp | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/pcsx2/FiFo.cpp b/pcsx2/FiFo.cpp index 5f0317ff2..dc417af31 100644 --- a/pcsx2/FiFo.cpp +++ b/pcsx2/FiFo.cpp @@ -50,8 +50,8 @@ 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(); - GSreadFIFO((u64*)out); vif1.GSLastDownloadSize--; GUNIT_LOG("ReadFIFO_VIF1"); if (vif1.GSLastDownloadSize <= 16) diff --git a/pcsx2/GS.h b/pcsx2/GS.h index 05943c921..f9193b4c9 100644 --- a/pcsx2/GS.h +++ b/pcsx2/GS.h @@ -247,6 +247,8 @@ enum MTGS_RingCommand , GS_RINGTYPE_CRC , GS_RINGTYPE_GSPACKET , GS_RINGTYPE_MTVU_GSPACKET +, GS_RINGTYPE_READ_FIFO1 +, GS_RINGTYPE_READ_FIFO2 }; diff --git a/pcsx2/MTGS.cpp b/pcsx2/MTGS.cpp index 35cff8d9f..ba1c8e9d9 100644 --- a/pcsx2/MTGS.cpp +++ b/pcsx2/MTGS.cpp @@ -495,6 +495,14 @@ void SysMtgsThread::ExecuteTaskInThread() GSsetGameCRC( tag.data[0], 0 ); break; + case GS_RINGTYPE_READ_FIFO1: + GSreadFIFO( (u64*)tag.data[1]); + break; + + case GS_RINGTYPE_READ_FIFO2: + GSreadFIFO2( (u64*)tag.data[1], tag.data[0]); + break; + #ifdef PCSX2_DEVBUILD default: Console.Error("GSThreadProc, bad packet (%x) at m_ReadPos: %x, m_WritePos: %x", tag.command, m_ReadPos, m_WritePos); diff --git a/pcsx2/Vif1_Dma.cpp b/pcsx2/Vif1_Dma.cpp index db4ee616e..8f3157bc2 100644 --- a/pcsx2/Vif1_Dma.cpp +++ b/pcsx2/Vif1_Dma.cpp @@ -67,8 +67,8 @@ void vif1TransferToMemory() pxAssert(p3.isDone() || !p3.gifTag.isValid); } + GetMTGS().SendPointerPacket(GS_RINGTYPE_READ_FIFO2, size, pMem); GetMTGS().WaitGS(); - GSreadFIFO2((u64*)pMem, size); pMem += size; if(pMem < pMemEnd) {