diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index 8ef5a3c6b1..4e9377c851 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -47,14 +47,14 @@ static __fi void clearFIFOstuff(bool full) else CSRreg.FIFO = CSR_FIFO_EMPTY; } - +extern bool SIGNAL_IMR_Pending; void gsPath1Interrupt() { //DevCon.Warning("Path1 flush W %x, R %x", Path1WritePos, Path1ReadPos); - if((gifRegs.stat.APATH <= GIF_APATH1 || (gifRegs.stat.IP3 == true && gifRegs.stat.APATH == GIF_APATH3)) && Path1WritePos > 0 && !gifRegs.stat.PSE) + if((gifRegs.stat.APATH <= GIF_APATH1 || (gifRegs.stat.IP3 == true && gifRegs.stat.APATH == GIF_APATH3)) && Path1WritePos > 0 && !gifRegs.stat.PSE && SIGNAL_IMR_Pending == false) { gifRegs.stat.P1Q = false; @@ -62,7 +62,7 @@ void gsPath1Interrupt() { GetMTGS().PrepDataPacket(GIF_PATH_1, size); //DevCon.Warning("Flush Size = %x", size); - while(size > 0) + while(size > 0 && SIGNAL_IMR_Pending == false) { uint count = GIFPath_CopyTag(GIF_PATH_1, ((u128*)Path1Buffer) + Path1ReadPos, size); Path1ReadPos += count; @@ -79,13 +79,18 @@ void gsPath1Interrupt() if(Path1ReadPos == Path1WritePos) { Path1WritePos = Path1ReadPos = 0; + } + else + { + //DevCon.Warning("Queue quitting early due to signal or EOP %x", size); + gifRegs.stat.P1Q = true; } } } else { if(gifRegs.stat.PSE) DevCon.Warning("Path1 paused by GIF_CTRL"); - DevCon.Warning("Looping??? IP3 %x APATH %x OPH %x", gifRegs.stat.IP3, gifRegs.stat.APATH, gifRegs.stat.OPH); + //DevCon.Warning("Looping??? IP3 %x APATH %x OPH %x", gifRegs.stat.IP3, gifRegs.stat.APATH, gifRegs.stat.OPH); //if(!(cpuRegs.interrupt & (1<<28)) && Path1WritePos > 0)CPU_INT(28, 128); } diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index f2a74b7d91..6832e5a134 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -1097,8 +1097,17 @@ void __fastcall mVU_XGKICK_(u32 addr) { u8* data = vuRegs[1].Mem + (addr*16); u32 diff = 0x400 - addr; u32 size; + + /////////////////////////////////////////////// + ///////////////SIGNAL WARNING!!//////////////// + /////////////////////////////////////////////// + /* Due to the face SIGNAL can cause the loop + to leave early, we can end up missing data. + The only way we can avoid this is to queue + it :(, im relying on someone else to come + up with a better solution! */ - if(gifRegs.stat.APATH <= GIF_APATH1 || (gifRegs.stat.APATH == GIF_APATH3 && gifRegs.stat.IP3 == true) && SIGNAL_IMR_Pending == false) + /*if(gifRegs.stat.APATH <= GIF_APATH1 || (gifRegs.stat.APATH == GIF_APATH3 && gifRegs.stat.IP3 == true) && SIGNAL_IMR_Pending == false) { if(Path1WritePos != 0) { @@ -1116,7 +1125,7 @@ void __fastcall mVU_XGKICK_(u32 addr) { } } else - { + {*/ //DevCon.Warning("GIF APATH busy %x Holding for later W %x, R %x", gifRegs.stat.APATH, Path1WritePos, Path1ReadPos); size = GIFPath_ParseTagQuick(GIF_PATH_1, data, diff); u8* pDest = &Path1Buffer[Path1WritePos*16]; @@ -1136,7 +1145,8 @@ void __fastcall mVU_XGKICK_(u32 addr) { } //if(!gifRegs.stat.P1Q) CPU_INT(28, 128); gifRegs.stat.P1Q = true; - } + //} + gsPath1Interrupt(); } static __fi void mVU_XGKICK_DELAY(mV, bool memVI) { diff --git a/pcsx2/x86/sVU_Lower.cpp b/pcsx2/x86/sVU_Lower.cpp index 9e1294964f..95096cd74e 100644 --- a/pcsx2/x86/sVU_Lower.cpp +++ b/pcsx2/x86/sVU_Lower.cpp @@ -1982,7 +1982,17 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr) u32 size; u8* pDest; - if(gifRegs.stat.APATH <= GIF_APATH1 || (gifRegs.stat.APATH == GIF_APATH3 && gifRegs.stat.IP3 == true) && SIGNAL_IMR_Pending == false) + /////////////////////////////////////////////// + ///////////////SIGNAL WARNING!!//////////////// + /////////////////////////////////////////////// + /* Due to the face SIGNAL can cause the loop + to leave early, we can end up missing data. + The only way we can avoid this is to queue + it :(, im relying on someone else to come + up with a better solution! */ + + + /*if(gifRegs.stat.APATH <= GIF_APATH1 || (gifRegs.stat.APATH == GIF_APATH3 && gifRegs.stat.IP3 == true) && SIGNAL_IMR_Pending == false) { if(Path1WritePos != 0) { @@ -2000,7 +2010,7 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr) } } else - { + {*/ //DevCon.Warning("GIF APATH busy %x Holding for later W %x, R %x", gifRegs.stat.APATH, Path1WritePos, Path1ReadPos); size = GIFPath_ParseTagQuick(GIF_PATH_1, data, diff); pDest = &Path1Buffer[Path1WritePos*16]; @@ -2019,8 +2029,7 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr) } //if(!gifRegs.stat.P1Q) CPU_INT(28, 128); gifRegs.stat.P1Q = true; - } - - + //} + gsPath1Interrupt(); } //------------------------------------------------------------------