ReorderingMTGS: Clean up and unify all OPH flag handling to be in the BUSDIR handler.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/ReorderingMTGS@3522 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2010-07-17 22:37:36 +00:00
parent ffdf8223fd
commit f7d0ed2dc5
8 changed files with 17 additions and 25 deletions

View File

@ -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();
}

View File

@ -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

View File

@ -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();
}

View File

@ -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;

View File

@ -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;

View File

@ -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:

View File

@ -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;
}
}

View File

@ -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;
}
}