Modified some recent changes a little, should bring back some more of the performance that was lost recently.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3347 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2010-06-29 19:32:30 +00:00
parent 9e3824c9ef
commit 0c6e6d8274
7 changed files with 46 additions and 41 deletions

View File

@ -166,6 +166,7 @@ void __fastcall WriteFIFO_page_5(u32 mem, const mem128_t *value)
{
if(gifRegs->stat.DIR == 0)gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
if(gifRegs->stat.P1Q) gsPath1Interrupt();
}
if (vif1.cmd)
{
@ -204,6 +205,7 @@ void __fastcall WriteFIFO_page_6(u32 mem, const mem128_t *value)
{
if(gifRegs->stat.DIR == 0)gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
if(gifRegs->stat.P1Q) gsPath1Interrupt();
}
Registers::Thaw();
}

View File

@ -54,44 +54,39 @@ void gsPath1Interrupt()
if((gifRegs->stat.APATH == GIF_APATH_IDLE || gifRegs->stat.APATH == GIF_APATH1 || gifRegs->stat.IP3) && Path1WritePos > 0 && !gifRegs->stat.PSE)
if((gifRegs->stat.APATH <= GIF_APATH1 || (gifRegs->stat.IP3 && gifRegs->stat.APATH == GIF_APATH3)) && Path1WritePos > 0 && !gifRegs->stat.PSE)
{
Registers::Freeze();
u32 size = GetMTGS().PrepDataPacket(GIF_PATH_1, Path1Buffer + (Path1ReadPos*16), (Path1WritePos - Path1ReadPos));
u8* pDest = GetMTGS().GetDataPacketPtr();
//DevCon.Warning("Flush Size = %x", size);
while(Path1WritePos > 0)
{
u32 size = GetMTGS().PrepDataPacket(GIF_PATH_1, Path1Buffer + (Path1ReadPos * 16), (Path1WritePos - Path1ReadPos));
u8* pDest = GetMTGS().GetDataPacketPtr();
//DevCon.Warning("Flush Size = %x", size);
gifRegs->stat.APATH = GIF_APATH1;
memcpy_aligned(pDest, Path1Buffer + (Path1ReadPos * 16), size*16);
GetMTGS().SendDataPacket();
memcpy_aligned(pDest, Path1Buffer + (Path1ReadPos * 16), size * 16);
GetMTGS().SendDataPacket();
Path1ReadPos += size;
if(GSTransferStatus.PTH1 == STOPPED_MODE)
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
}
if(Path1ReadPos == Path1WritePos)
{
Path1WritePos = Path1ReadPos = 0;
gifRegs->stat.P1Q = false;
}
}
Registers::Thaw();
Path1ReadPos += size;
if(GSTransferStatus.PTH1 == STOPPED_MODE && gifRegs->stat.APATH == GIF_APATH1 )
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
}
if(Path1ReadPos == Path1WritePos)
{
Path1WritePos = Path1ReadPos = 0;
}
if(!(cpuRegs.interrupt & (1<<28))) CPU_INT(28, 16); //Should be size * BIAS (probably) but Tony Hawk doesnt like this, probably to do with vif flush stalling
}
else
{
if(Path1WritePos == 0)
{
gifRegs->stat.P1Q = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
cpuRegs.interrupt &= ~(1<<28);
}
else
{
if(gifRegs->stat.PSE) DevCon.Warning("Path1 paused by GIF_CTRL");
if(!(cpuRegs.interrupt & (1<<28)))CPU_INT(28, 128);
}
if(gifRegs->stat.PSE) DevCon.Warning("Path1 paused by GIF_CTRL");
//if(!(cpuRegs.interrupt & (1<<28)) && Path1WritePos > 0)CPU_INT(28, 128);
}
}
@ -103,6 +98,7 @@ __forceinline void gsInterrupt()
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
if(gifRegs->stat.P1Q) gsPath1Interrupt();
}
if (!(gif->chcr.STR))
@ -177,10 +173,10 @@ int _GIFchain()
//in Intermittent Mode it enabled, IMAGE_MODE transfers are sliced.
if(gifRegs->stat.IMT && GSTransferStatus.PTH3 <= IMAGE_MODE) qwc = min((int)gif->qwc, 8);
else qwc = gif->qwc;
///(gifRegs->stat.IMT && GSTransferStatus.PTH3 <= IMAGE_MODE) qwc = min((int)gif->qwc, 8);
/*else qwc = gif->qwc;*/
return WRITERING_DMA(pMem, qwc);
return WRITERING_DMA(pMem, gif->qwc);
}
static __forceinline void GIFchain()
@ -238,6 +234,7 @@ bool CheckPaths(int Channel)
if((vif1.cmd & 0x7f) != 0x51 || gifRegs->stat.P1Q == true)
{
gifRegs->stat.IP3 = true;
if(gifRegs->stat.P1Q) gsPath1Interrupt();
CPU_INT(DMAC_GIF, 16);
return false;
}
@ -629,6 +626,7 @@ void gifMFIFOInterrupt()
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
if(gifRegs->stat.P1Q) gsPath1Interrupt();
}
if(CheckPaths(11) == false) return;

View File

@ -340,6 +340,7 @@ __forceinline void vif1Interrupt()
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
if(gifRegs->stat.P1Q) gsPath1Interrupt();
}
if (schedulepath3msk & 0x10)

View File

@ -241,6 +241,7 @@ void vifMFIFOInterrupt()
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;
if(gifRegs->stat.DIR == 0)gifRegs->stat.OPH = false;*/
}

View File

@ -469,7 +469,10 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size)
}
gifRegs->stat.OPH = true;
gifRegs->stat.APATH = pathidx + 1;
if(pathidx == GIF_PATH_3) break;
}
if(pathidx == GIF_PATH_3)
{
if(vif1Regs->mskpath3 == 1) break;
}
}
else

View File

@ -1132,7 +1132,7 @@ void __fastcall mVU_XGKICK_(u32 addr) {
memcpy_aligned(pDest, microVU1.regs->Mem + (addr*16), size*16);
}
GetMTGS().SendDataPacket();
if(GSTransferStatus.PTH1 == STOPPED_MODE && gifRegs->stat.APATH == GIF_APATH1 )
if(GSTransferStatus.PTH1 == STOPPED_MODE)
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
@ -1161,7 +1161,7 @@ void __fastcall mVU_XGKICK_(u32 addr) {
memcpy_aligned(pDest, microVU1.regs->Mem + (addr*16), size*16);
Path1WritePos += size;
}
if(!gifRegs->stat.P1Q) CPU_INT(28, 128);
//if(!gifRegs->stat.P1Q) CPU_INT(28, 128);
gifRegs->stat.P1Q = true;
}
}

View File

@ -2001,7 +2001,7 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr)
memcpy_aligned(pDest, VU1.Mem + addr, size*16);
}
GetMTGS().SendDataPacket();
if(GSTransferStatus.PTH1 == STOPPED_MODE && gifRegs->stat.APATH == GIF_APATH1 )
if(GSTransferStatus.PTH1 == STOPPED_MODE )
{
gifRegs->stat.OPH = false;
gifRegs->stat.APATH = GIF_APATH_IDLE;
@ -2032,7 +2032,7 @@ void __fastcall VU1XGKICK_MTGSTransfer(u32 *pMem, u32 addr)
memcpy_aligned(pDest, VU1.Mem + addr, size*16);
Path1WritePos += size;
}
if(!gifRegs->stat.P1Q) CPU_INT(28, 16);
//if(!gifRegs->stat.P1Q) CPU_INT(28, 128);
gifRegs->stat.P1Q = true;
}