Fixed a couple of issues with GIF stalls, also quite a nasty bug which could have completely screwed Normal GIF transfers

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2769 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2010-03-26 01:35:17 +00:00
parent d4bc1a6275
commit b4b61faa70
2 changed files with 13 additions and 7 deletions

View File

@ -206,7 +206,7 @@ void GIFdma()
if ((gif->madr + (gif->qwc * 16)) > dmacRegs->stadr.ADDR)
{
CPU_INT(DMAC_GIF, gscycles);
CPU_INT(DMAC_GIF, 4);
gscycles = 0;
return;
}
@ -272,7 +272,10 @@ void GIFdma()
GIFchain(); //Transfers the data set by the switch
CPU_INT(DMAC_GIF, gscycles * BIAS);
return;
} else { //Else it really is a normal transfer and we want to quit, else it gets confused with chains
gspath3done = 1;
}
//else DevCon.WriteLn("GIFdma() case 2, but qwc = 0!"); //Don't do 0 GIFchain and then return, fixes Dual Hearts
}
@ -289,9 +292,9 @@ void GIFdma()
{
// stalled.
// We really need to test this. Pay attention to prevcycles, as it used to trigger GIFchains in the code above. (rama)
Console.WriteLn("GS Stall Control Source = %x, Drain = %x\n MADR = %x, STADR = %x", (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3,gif->madr, psHu32(DMAC_STADR));
Console.WriteLn("GS Stall Control start Source = %x, Drain = %x\n MADR = %x, STADR = %x", (psHu32(0xe000) >> 4) & 0x3, (psHu32(0xe000) >> 6) & 0x3,gif->madr, psHu32(DMAC_STADR));
prevcycles = gscycles;
gif->tadr -= 16;
//gif->tadr -= 16;
hwDmacIrq(DMAC_STALL_SIS);
CPU_INT(DMAC_GIF, gscycles);
gscycles = 0;

View File

@ -1309,11 +1309,14 @@ static __forceinline bool ipuDmacSrcChain(DMACh *tag, tDMA_TAG *ptag)
static __forceinline void flushGIF()
{
if (dmacRegs->ctrl.STD != STD_GIF || (gif->madr + (gif->qwc * 16)) < dmacRegs->stadr.ADDR)
{
while(gif->chcr.STR && (vif1Regs->mskpath3 == 0) && Path3progress != STOPPED_MODE)
{
GIF_LOG("Flushing gif chcr %x tadr %x madr %x qwc %x", gif->chcr._u32, gif->tadr, gif->madr, gif->qwc);
gsInterrupt();
}
}
}
int IPU1dma()
@ -1566,7 +1569,7 @@ void ipu0Interrupt()
{
// gif
g_nDMATransfer.GIFSTALL = false;
if (gif->chcr.STR) GIFdma();
//if (gif->chcr.STR) GIFdma();
}
if (g_nDMATransfer.VIFSTALL)