From c8683cb350b9f54bbb288abc34d6037de2f942c5 Mon Sep 17 00:00:00 2001 From: refraction Date: Fri, 13 Mar 2009 21:14:33 +0000 Subject: [PATCH] Adjusted the backwards timing on GIF for intermediate transfers, this resolves issue101 git-svn-id: http://pcsx2.googlecode.com/svn/trunk@771 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/Gif.cpp | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/pcsx2/Gif.cpp b/pcsx2/Gif.cpp index bdcbace6d7..6fb8a79429 100644 --- a/pcsx2/Gif.cpp +++ b/pcsx2/Gif.cpp @@ -308,13 +308,21 @@ void GIFdma() prevcycles = 0; if (!(vif1Regs->mskpath3 || (psHu32(GIF_MODE) & 0x1))) { - if(gspath3done == 0){ - ptag = (u32*)dmaGetAddr(gif->tadr); //Set memory pointer to TADR - gif->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag - gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 - CPU_INT(2, gif->qwc * BIAS); - gif->qwc = 0; - return; + if(gspath3done == 0) + { + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc )* BIAS); + } + else + { + ptag = (u32*)dmaGetAddr(gif->tadr); //Set memory pointer to TADR + gif->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag + gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 + CPU_INT(2, gif->qwc * BIAS); + gif->qwc = 0; + return; + } } //CPU_INT(2, gif->qwc * BIAS); gscycles = 0; @@ -348,7 +356,14 @@ void dmaGIF() { ptag = (u32*)dmaGetAddr(gif->tadr); gif->qwc = (u16)ptag[0]; //QWC set to lower 16bits of the tag gif->chcr = ( gif->chcr & 0xFFFF ) | ( (*ptag) & 0xFFFF0000 ); //Transfer upper part of tag to CHCR bits 31-15 - CPU_INT(2, gif->qwc * BIAS); + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + } + else + { + CPU_INT(2, gif->qwc * BIAS); + } gif->qwc = 0; return; } @@ -356,7 +371,14 @@ void dmaGIF() { if(gif->qwc > 0 && (gif->chcr & 0x4) == 0x4) { //SysPrintf("HL Hack\n"); gspath3done = 1; //Halflife sets a QWC amount in chain mode, no tadr set. - CPU_INT(2, gif->qwc * BIAS); + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + } + else + { + CPU_INT(2, gif->qwc * BIAS); + } GIFdma(); return; } @@ -364,7 +386,14 @@ void dmaGIF() { //GIFdma(); - CPU_INT(2, gif->qwc * BIAS); + if((psHu32(GIF_MODE) & 0x4) && gif->qwc != 0) + { + CPU_INT(2, min( 8, (int)gif->qwc ) * BIAS); + } + else + { + CPU_INT(2, gif->qwc * BIAS); + } }