Path3 Masking: Fixed up some issues causing Gunfighter 2 not to work. Closes Issue 1445

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5759 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2013-11-05 14:40:25 +00:00
parent 54fa8719a3
commit 45d790b854
3 changed files with 21 additions and 13 deletions

View File

@ -60,18 +60,21 @@ __fi void gifInterrupt()
}
}
//Required for Path3 Masking timing!
if(gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_WAIT)
{
gifUnit.gifPath[GIF_PATH_3].state = GIF_PATH_IDLE;
//Required for Path3 Masking timing!
if(gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_WAIT)
gifUnit.gifPath[GIF_PATH_3].state = GIF_PATH_IDLE;
if(gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_IDLE)
{
if(vif1Regs.stat.VGW)
{
//Check if VIF is in a cycle or is currently "idle" waiting for GIF to come back.
if(!(cpuRegs.interrupt & (1<<DMAC_VIF1)))
CPU_INT(DMAC_VIF1, 1);
CPU_INT(DMAC_GIF, 16);
if(!gifUnit.Path3Masked())
CPU_INT(DMAC_GIF, 16);
return;
}
@ -506,18 +509,22 @@ void gifMFIFOInterrupt()
}
if(gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_WAIT)
{
gifUnit.gifPath[GIF_PATH_3].state = GIF_PATH_IDLE;
gifUnit.gifPath[GIF_PATH_3].state = GIF_PATH_IDLE;
if(gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_IDLE)
{
if(vif1Regs.stat.VGW)
{
CPU_INT(DMAC_VIF1, 1);
//Check if VIF is in a cycle or is currently "idle" waiting for GIF to come back.
if(!(cpuRegs.interrupt & (1<<DMAC_VIF1)))
CPU_INT(DMAC_VIF1, 1);
if(!gifUnit.Path3Masked())
CPU_INT(DMAC_MFIFO_GIF, 16);
CPU_INT(DMAC_GIF, 16);
if(!gspath3done || gifch.qwc > 0) return;
}
}
if (dmacRegs.ctrl.MFD != MFD_GIF) {

View File

@ -590,9 +590,9 @@ struct Gif_Unit {
}
if (!gsSIGNAL.queued && !gifPath[0].isDone()) { stat.APATH = 1; stat.P1Q = 0; curPath = 0; }
elif (!gsSIGNAL.queued && !gifPath[1].isDone()) { stat.APATH = 2; stat.P2Q = 0; curPath = 1; }
elif (!gsSIGNAL.queued && !gifPath[2].isDone() && !Path3Masked() /*&& !stat.P2Q*/)
elif (!gsSIGNAL.queued && !gifPath[2].isDone() && !Path3Masked())
{ stat.APATH = 3; stat.P3Q = 0; stat.IP3 = 0; curPath = 2; }
else { if(isResume) { stat.APATH = 0; stat.OPH = 0; } break; }
else { if(isResume || curPath == 0) { stat.APATH = 0; stat.OPH = 0; } break; }
}
//Some loaders/Refresh Rate selectors and things dont issue "End of Packet" commands

View File

@ -294,9 +294,10 @@ __fi void vif1Interrupt()
|| (isDirectHL && !gifUnit.CanDoPath2HL())) {
GUNIT_WARN("vif1Interrupt() - Waiting for Path 2 to be ready");
CPU_INT(DMAC_VIF1, 128);
if(gifRegs.stat.APATH == 3) vif1Regs.stat.VGW = 1; //We're waiting for path 3. Gunslinger II
return;
}
vif1Regs.stat.VGW = 0; //Path 3 isn't busy so we don't need to wait for it.
vif1Regs.stat.FQC = min(vif1ch.qwc, (u16)16);
//Simulated GS transfer time done, clear the flags
}