diff --git a/pcsx2/FiFo.cpp b/pcsx2/FiFo.cpp index 2347437b57..2a30dfda3e 100644 --- a/pcsx2/FiFo.cpp +++ b/pcsx2/FiFo.cpp @@ -128,10 +128,15 @@ void __fastcall WriteFIFO_GIF(const mem128_t *value) GetMTGS().PrepDataPacket(GIF_PATH_3, 1); GIFPath_CopyTag( GIF_PATH_3, value, 1 ); GetMTGS().SendDataPacket(); - if(GSTransferStatus.PTH3 == STOPPED_MODE && gifRegs.stat.APATH == GIF_APATH3 ) + + if(GSTransferStatus.PTH3 >= PENDINGSTOP_MODE ) { - if(gifRegs.stat.DIR == 0)gifRegs.stat.OPH = false; - gifRegs.stat.APATH = GIF_APATH_IDLE; - if(gifRegs.stat.P1Q) gsPath1Interrupt(); + GSTransferStatus.PTH3 = STOPPED_MODE; + if(gifRegs.stat.APATH == GIF_APATH3) + { + if(gifRegs.stat.DIR == 0)gifRegs.stat.OPH = false; + gifRegs.stat.APATH = GIF_APATH_IDLE; + if(gifRegs.stat.P1Q) gsPath1Interrupt(); + } } } diff --git a/pcsx2/Vif_Codes.cpp b/pcsx2/Vif_Codes.cpp index 2b7149b1e0..95d20c2207 100644 --- a/pcsx2/Vif_Codes.cpp +++ b/pcsx2/Vif_Codes.cpp @@ -144,9 +144,11 @@ template __fi int _vifCode_Direct(int pass, const u8* data, bool isDire pass2 { vif1Only(); + //Only check if Path 1 or 3 are busy, else we dont care :D if (GSTransferStatus.PTH3 < STOPPED_MODE || gifRegs.stat.P1Q == true) { - if(gifRegs.stat.APATH == GIF_APATH2 || ((GSTransferStatus.PTH3 <= IMAGE_MODE && gifRegs.stat.IMT && (vif1.cmd & 0x7f) == 0x50)) && gifRegs.stat.P1Q == false) + //If currently transferring PATH2, or GIF is in image mode (or waiting) and we are using DIRECT command and path1 isnt waiting + if(gifRegs.stat.APATH == GIF_APATH2 || ((GSTransferStatus.PTH3 <= IMAGE_MODE && (vif1.cmd & 0x7f) == 0x50) && gifRegs.stat.P1Q == false)) { //Do nothing, allow it vif1Regs.stat.VGW = false; @@ -154,6 +156,7 @@ template __fi int _vifCode_Direct(int pass, const u8* data, bool isDire } else { + //Using Direct/HL while Path3 is busy or Path 1 is busy //DevCon.Warning("Stall DIRECT/HL %x P3 %x APATH %x P1Q %x", vif1.cmd, GSTransferStatus.PTH3, gifRegs.stat.APATH, gifRegs.stat.P1Q); vif1Regs.stat.VGW = true; // PATH3 is in image mode (DIRECTHL), or busy (BOTH no IMT) vif1.GifWaitState = 0; diff --git a/pcsx2/ps2/GIFpath.cpp b/pcsx2/ps2/GIFpath.cpp index ea498aee43..27859677cd 100644 --- a/pcsx2/ps2/GIFpath.cpp +++ b/pcsx2/ps2/GIFpath.cpp @@ -660,11 +660,10 @@ __fi int GIFPath::CopyTag(const u128* pMem128, u32 size) else GSTransferStatus.PTH3 = TRANSFER_MODE; break; } - - } + gifRegs.stat.OPH = true; + gifRegs.stat.APATH = pathidx + 1; + } - gifRegs.stat.OPH = true; - gifRegs.stat.APATH = pathidx + 1; if(nloop == 0 && tag.EOP) @@ -919,7 +918,8 @@ __fi int GIFPath::CopyTag(const u128* pMem128, u32 size) GSTransferStatus.PTH2 = WAITING_MODE; break; case GIF_PATH_3: - if(GSTransferStatus.PTH3 < STOPPED_MODE) GSTransferStatus.PTH3 = WAITING_MODE; + //Required, if GIF_FIFO writes NOP to GIF Tag it can leave it set waiting which causes VIF FlushA to fail + if(GSTransferStatus.PTH3 < PENDINGSTOP_MODE) GSTransferStatus.PTH3 = WAITING_MODE; break; } }