diff --git a/pcsx2/FiFo.cpp b/pcsx2/FiFo.cpp index 28122713c4..282eb68aaa 100644 --- a/pcsx2/FiFo.cpp +++ b/pcsx2/FiFo.cpp @@ -164,7 +164,6 @@ void __fastcall WriteFIFO_page_5(u32 mem, const mem128_t *value) if(GSTransferStatus.PTH2 == STOPPED_MODE && gifRegs->stat.APATH == GIF_APATH2) { - if(gifRegs->stat.DIR == 0)gifRegs->stat.OPH = false; gifRegs->stat.APATH = GIF_APATH_IDLE; if(gifRegs->stat.P1Q) gsPath1Interrupt(); } @@ -201,7 +200,6 @@ void __fastcall WriteFIFO_page_6(u32 mem, const mem128_t *value) GetMTGS().SendDataPacket(); if(GSTransferStatus.PTH3 == STOPPED_MODE && 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/GS.cpp b/pcsx2/GS.cpp index b9028de2ee..4dc0251393 100644 --- a/pcsx2/GS.cpp +++ b/pcsx2/GS.cpp @@ -282,14 +282,19 @@ void __fastcall gsWrite64_page_01( u32 mem, const mem64_t* value ) { case 0x12001040: //busdir - //This is probably a complete hack, however writing to BUSDIR "should" start a transfer (Bleach Blade Battlers) - //Only problem is it kills killzone :( leaving it commented out for now. + //This is probably a complete hack, however writing to BUSDIR "should" start a transfer + //(Bleach Blade Battlers, Growlanser 2 and 3, Wizardry) + //Only problem is it kills killzone :(. // (yes it *is* a complete hack; both lines here in fact --air) //========================================================================= - //gifRegs->stat.OPH = true; + //Console.Warning("BUSDIR write! Setting OPH and DIR to = %x",(u32)value[0]); + if ((u32)value[0] == 1) + gifRegs->stat.OPH = true; + else + gifRegs->stat.OPH = false; + + gifRegs->stat.DIR = (u32)value[0]; //========================================================================= - gifRegs->stat.DIR = (u32)value; - // BUSDIR INSANITY !! MTGS FLUSH NEEDED // // Yup folks. BUSDIR is evil. The only safe way to handle it is to flush the whole MTGS diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index 78aaaec3bb..137df0564f 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -69,8 +69,7 @@ void gsPath1Interrupt() size -= count; if(GSTransferStatus.PTH1 == STOPPED_MODE) - { - gifRegs->stat.OPH = false; + { gifRegs->stat.APATH = GIF_APATH_IDLE; } } @@ -106,7 +105,6 @@ __forceinline void gsInterrupt() if(GSTransferStatus.PTH3 >= PENDINGSTOP_MODE && gifRegs->stat.APATH == GIF_APATH3 ) { - gifRegs->stat.OPH = false; GSTransferStatus.PTH3 = STOPPED_MODE; gifRegs->stat.APATH = GIF_APATH_IDLE; if(gifRegs->stat.P1Q) gsPath1Interrupt(); @@ -319,7 +317,7 @@ void GIFdma() - //gifRegs->stat.OPH = true; + //gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama) gifRegs->stat.FQC = min((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // APATH=3] //Check with Path3 masking games if (gif->qwc > 0) { @@ -338,7 +336,7 @@ void GIFdma() } - //gifRegs->stat.OPH = true; + //gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama) // Transfer Dn_QWC from Dn_MADR to GIF if ((gif->chcr.MOD == NORMAL_MODE) || (gif->qwc > 0)) // Normal Mode { @@ -632,7 +630,6 @@ void gifMFIFOInterrupt() if(GSTransferStatus.PTH3 == STOPPED_MODE && gifRegs->stat.APATH == GIF_APATH3 ) { - gifRegs->stat.OPH = false; gifRegs->stat.APATH = GIF_APATH_IDLE; if(gifRegs->stat.P1Q) gsPath1Interrupt(); } diff --git a/pcsx2/Vif1_Dma.cpp b/pcsx2/Vif1_Dma.cpp index c7e42ad814..8f738a590e 100644 --- a/pcsx2/Vif1_Dma.cpp +++ b/pcsx2/Vif1_Dma.cpp @@ -345,7 +345,6 @@ __forceinline void vif1Interrupt() if(GSTransferStatus.PTH2 == STOPPED_MODE && gifRegs->stat.APATH == GIF_APATH2) { - gifRegs->stat.OPH = false; gifRegs->stat.APATH = GIF_APATH_IDLE; if(gifRegs->stat.P1Q) gsPath1Interrupt(); } @@ -440,11 +439,6 @@ __forceinline void vif1Interrupt() if (vif1.cmd != 0) Console.WriteLn("vif1.cmd still set %x tag size %x", vif1.cmd, vif1.tag.size); #endif - - if((vif1ch->chcr.DIR == VIF_NORMAL_TO_MEM_MODE) && vif1.GSLastDownloadSize <= 16) - { //Reverse fifo has finished and nothing is left, so lets clear the outputting flag - gifRegs->stat.OPH = false; - } vif1ch->chcr.STR = false; vif1.vifstalled = false; g_vifCycles = 0; diff --git a/pcsx2/Vif1_MFIFO.cpp b/pcsx2/Vif1_MFIFO.cpp index 64ff291b90..86f8008e6f 100644 --- a/pcsx2/Vif1_MFIFO.cpp +++ b/pcsx2/Vif1_MFIFO.cpp @@ -239,7 +239,6 @@ void vifMFIFOInterrupt() if(GSTransferStatus.PTH2 == STOPPED_MODE && gifRegs->stat.APATH == GIF_APATH2) { GSTransferStatus.PTH2 = STOPPED_MODE; - if(gifRegs->stat.DIR == 0)gifRegs->stat.OPH = false; gifRegs->stat.APATH = GIF_APATH_IDLE; if(gifRegs->stat.P1Q) gsPath1Interrupt(); /*gifRegs->stat.APATH = GIF_APATH_IDLE; diff --git a/pcsx2/ps2/GIFpath.cpp b/pcsx2/ps2/GIFpath.cpp index 4dfd10438a..1c9366ec21 100644 --- a/pcsx2/ps2/GIFpath.cpp +++ b/pcsx2/ps2/GIFpath.cpp @@ -357,7 +357,8 @@ static __forceinline void gsHandler(const u8* pMem) // qwords, rounded down; any extra bits are lost // games must take care to ensure transfer rectangles are exact multiples of a qword vif1.GSLastDownloadSize = vif1.TRXREG.RRW * vif1.TRXREG.RRH * bpp >> 7; - gifRegs->stat.OPH = true; + //DevCon.Warning("GS download in progress. OPH = %x", gifRegs->stat.OPH); + //gifRegs->stat.OPH = true; // Too early to set it here. It should be done on a BUSDIR call (rama) } } if (reg >= 0x60) @@ -617,7 +618,7 @@ __forceinline int GIFPath::CopyTag(const u128* pMem128, u32 size) } if(GSTransferStatus.PTH3 < PENDINGSTOP_MODE || pathidx != 2) { - gifRegs->stat.OPH = true; + //gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama) gifRegs->stat.APATH = pathidx + 1; } @@ -645,7 +646,7 @@ __forceinline int GIFPath::CopyTag(const u128* pMem128, u32 size) break; } gifRegs->stat.APATH = pathidx + 1; - gifRegs->stat.OPH = true; + //gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama) switch(tag.FLG) { case GIF_FLG_PACKED: diff --git a/pcsx2/x86/microVU_Lower.inl b/pcsx2/x86/microVU_Lower.inl index 0079cc083d..380a75863d 100644 --- a/pcsx2/x86/microVU_Lower.inl +++ b/pcsx2/x86/microVU_Lower.inl @@ -1111,7 +1111,6 @@ void __fastcall mVU_XGKICK_(u32 addr) { if(GSTransferStatus.PTH1 == STOPPED_MODE) { - gifRegs->stat.OPH = false; gifRegs->stat.APATH = GIF_APATH_IDLE; } } diff --git a/pcsx2/x86/sVU_Lower.cpp b/pcsx2/x86/sVU_Lower.cpp index 30ec18fd91..5191748f78 100644 --- a/pcsx2/x86/sVU_Lower.cpp +++ b/pcsx2/x86/sVU_Lower.cpp @@ -1994,7 +1994,6 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr) if(GSTransferStatus.PTH1 == STOPPED_MODE ) { - gifRegs->stat.OPH = false; gifRegs->stat.APATH = GIF_APATH_IDLE; } }