Revert the OPH work of r3522 as it was based on wrong assumptions (except the direction flag in BUSDIR, that one was right).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3554 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2010-07-22 19:17:10 +00:00
parent be9e225468
commit 3971787b9a
8 changed files with 23 additions and 13 deletions

View File

@ -164,6 +164,7 @@ 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();
}
@ -200,6 +201,7 @@ 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

@ -283,15 +283,10 @@ 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, Growlanser 2 and 3, Wizardry)
//Only problem is it kills killzone :(.
// (yes it *is* a complete hack; both lines here in fact --air)
//=========================================================================
//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.OPH = true;
gifRegs->stat.DIR = (u32)value[0];
//=========================================================================

View File

@ -69,7 +69,8 @@ void gsPath1Interrupt()
size -= count;
if(GSTransferStatus.PTH1 == STOPPED_MODE)
{
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
}
}
@ -105,6 +106,7 @@ __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();
@ -317,7 +319,7 @@ void GIFdma()
//gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama)
gifRegs->stat.OPH = true;
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) {
@ -336,7 +338,7 @@ void GIFdma()
}
//gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama)
gifRegs->stat.OPH = true;
// Transfer Dn_QWC from Dn_MADR to GIF
if ((gif->chcr.MOD == NORMAL_MODE) || (gif->qwc > 0)) // Normal Mode
{
@ -630,6 +632,7 @@ 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

@ -348,6 +348,7 @@ __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();
}
@ -442,6 +443,12 @@ __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,6 +239,7 @@ 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,8 +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;
//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)
//DevCon.Warning("GS download in progress");
gifRegs->stat.OPH = true;
}
}
if (reg >= 0x60)
@ -618,7 +618,7 @@ __forceinline int GIFPath::CopyTag(const u128* pMem128, u32 size)
}
if(GSTransferStatus.PTH3 < PENDINGSTOP_MODE || pathidx != 2)
{
//gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama)
gifRegs->stat.OPH = true;
gifRegs->stat.APATH = pathidx + 1;
}
@ -646,7 +646,7 @@ __forceinline int GIFPath::CopyTag(const u128* pMem128, u32 size)
break;
}
gifRegs->stat.APATH = pathidx + 1;
//gifRegs->stat.OPH = true; // why set the GS output path flag here? (rama)
gifRegs->stat.OPH = true;
switch(tag.FLG) {
case GIF_FLG_PACKED:

View File

@ -1111,6 +1111,7 @@ void __fastcall mVU_XGKICK_(u32 addr) {
if(GSTransferStatus.PTH1 == STOPPED_MODE)
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
}
}

View File

@ -1993,6 +1993,7 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr)
if(GSTransferStatus.PTH1 == STOPPED_MODE )
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
}
}