- Improved Path3 Masking, Should fix Sega Superstars Tennis and hopefully improve Star Wars Episode 3 some.

- Fixed bug in the GIF_Tag decoding which caused huge QWC values on GIF if the FIFO was "read" beforehand.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2862 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2010-04-15 22:26:39 +00:00
parent cd36e5fd24
commit 6382f6811b
5 changed files with 20 additions and 16 deletions

View File

@ -82,7 +82,7 @@ __forceinline void gsInterrupt()
gscycles = 0; gscycles = 0;
gif->chcr.STR = false; gif->chcr.STR = false;
vif1Regs->stat.VGW = false; vif1Regs->stat.VGW = false;
if(GSTransferStatus.PTH3 == 3) GSTransferStatus.PTH3 = STOPPED_MODE;
gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_OPH | GIF_STAT_FQC); gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_OPH | GIF_STAT_FQC);
clearFIFOstuff(false); clearFIFOstuff(false);
@ -238,7 +238,7 @@ void GIFdma()
if (GSTransferStatus.PTH3 == STOPPED_MODE) /*|| (vif1Regs->stat._u32 |= VIF1_STAT_VGW) == 0*/ if (GSTransferStatus.PTH3 == STOPPED_MODE) /*|| (vif1Regs->stat._u32 |= VIF1_STAT_VGW) == 0*/
{ {
GIF_LOG("PTH3 MASK Continuing VIF"); GIF_LOG("PTH3 MASK Paused by VIF");
vif1Regs->stat.VGW = false; vif1Regs->stat.VGW = false;
if (gif->qwc == 0) CPU_INT(DMAC_GIF, 16); if (gif->qwc == 0) CPU_INT(DMAC_GIF, 16);
return; return;
@ -246,7 +246,7 @@ void GIFdma()
gifRegs->stat.FQC = max((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // OPH=1 | APATH=3] gifRegs->stat.FQC = max((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // OPH=1 | APATH=3]
//Check with Path3 masking games //Check with Path3 masking games
if (gif->qwc > 0) { if (gif->qwc > 0) {
GIF_LOG("PTH3 MASK Transferring", ptag[1]._u32, ptag[0]._u32, gif->qwc, ptag->ID, gif->madr); GIF_LOG("PTH3 MASK Transferring");
GIFchain(); GIFchain();
CPU_INT(DMAC_GIF, gscycles * BIAS); CPU_INT(DMAC_GIF, gscycles * BIAS);
return; return;

View File

@ -211,7 +211,7 @@ __forceinline void vif1Interrupt()
if ((vif1Regs->stat.VGW)) if ((vif1Regs->stat.VGW))
{ {
if ((gif->chcr.STR && (GSTransferStatus.PTH3 != STOPPED_MODE)) || (GSTransferStatus.PTH1 != STOPPED_MODE)) if (GSTransferStatus.PTH3 < STOPPED_MODE || GSTransferStatus.PTH1 != STOPPED_MODE)
{ {
CPU_INT(DMAC_VIF1, 4); CPU_INT(DMAC_VIF1, 4);
return; return;

View File

@ -16,6 +16,7 @@
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#include "Common.h" #include "Common.h"
#include "Vif.h" #include "Vif.h"
#include "Gif.h"
#include "Vif_Dma.h" #include "Vif_Dma.h"
VIFregisters *vifRegs; VIFregisters *vifRegs;
@ -224,9 +225,9 @@ void vifMFIFOInterrupt()
if ((vif1Regs->stat.VGW)) if ((vif1Regs->stat.VGW))
{ {
if (gif->chcr.STR) if (GSTransferStatus.PTH3 < STOPPED_MODE || GSTransferStatus.PTH1 != STOPPED_MODE)
{ {
CPU_INT(10, 16); CPU_INT(10, 4);
return; return;
} }
else else

View File

@ -75,12 +75,15 @@ void Vif1MskPath3() {
vif1Regs->mskpath3 = schedulepath3msk & 0x1; vif1Regs->mskpath3 = schedulepath3msk & 0x1;
//Console.WriteLn("VIF MSKPATH3 %x", vif1Regs->mskpath3); //Console.WriteLn("VIF MSKPATH3 %x", vif1Regs->mskpath3);
gifRegs->stat.M3P = vif1Regs->mskpath3;
if (!vif1Regs->mskpath3) { if (!vif1Regs->mskpath3) {
//Let the Gif know it can transfer again (making sure any vif stall isnt unset prematurely) //Let the Gif know it can transfer again (making sure any vif stall isnt unset prematurely)
GSTransferStatus.PTH3 = TRANSFER_MODE; if(gif->chcr.STR == true)
gifRegs->stat.IMT = false; {
if(gif->chcr.STR == true) CPU_INT(DMAC_GIF, 4); GSTransferStatus.PTH3 = 3;
CPU_INT(DMAC_GIF, 4);
}
} }
else gifRegs->stat.M3P = true; else gifRegs->stat.M3P = true;
@ -111,11 +114,11 @@ template<int idx> _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) {
gifRegs->stat.P2Q = true; gifRegs->stat.P2Q = true;
//Should probably do this for both types of transfer seen as the GS hates taking 2 seperate chunks //Should probably do this for both types of transfer seen as the GS hates taking 2 seperate chunks
//if (isDirectHL) { //if (isDirectHL) {
if ((gif->chcr.STR && (!vif1Regs->mskpath3 && (GSTransferStatus.PTH3 != STOPPED_MODE))) || GSTransferStatus.PTH1 != STOPPED_MODE) if (GSTransferStatus.PTH3 < STOPPED_MODE || GSTransferStatus.PTH1 != STOPPED_MODE)
{ {
/*if(!isDirectHL) DevCon.WriteLn("Direct: Waiting for Path3 to finish!"); /*if(!isDirectHL) DevCon.WriteLn("Direct: Waiting for Path3 to finish!");
else DevCon.WriteLn("DirectHL: Waiting for Path3 to finish!");*/ else DevCon.WriteLn("DirectHL: Waiting for Path3 to finish!");*/
VIF_LOG("Mask %x, GIF STR %x, PTH1 %x, PTH2 %x, PTH3 %x", vif1Regs->mskpath3, gif->chcr.STR, GSTransferStatus.PTH1, GSTransferStatus.PTH2, GSTransferStatus.PTH3); //VIF_LOG("Mask %x, GIF STR %x, PTH1 %x, PTH2 %x, PTH3 %x", vif1Regs->mskpath3, gif->chcr.STR, GSTransferStatus.PTH1, GSTransferStatus.PTH2, GSTransferStatus.PTH3);
vif1Regs->stat.VGW = true; // PATH3 is in image mode, so wait for end of transfer vif1Regs->stat.VGW = true; // PATH3 is in image mode, so wait for end of transfer
vif1.vifstalled = true; vif1.vifstalled = true;
return 0; return 0;
@ -183,11 +186,10 @@ vifOp(vifCode_FlushA) {
vif1Only(); vif1Only();
pass1 { pass1 {
// Gif is already transferring so wait for it. // Gif is already transferring so wait for it.
if (((GSTransferStatus.PTH3 != STOPPED_MODE) || !vif1Regs->mskpath3) && gif->chcr.STR) { if (GSTransferStatus.PTH3 < STOPPED_MODE) {
//DevCon.WriteLn("FlushA path3 Wait!"); //DevCon.WriteLn("FlushA path3 Wait! PTH3 MD %x STR %x", GSTransferStatus.PTH3, gif->chcr.STR);
vif1Regs->stat.VGW = true; vif1Regs->stat.VGW = true;
vifX.vifstalled = true; vifX.vifstalled = true;
CPU_INT(DMAC_GIF, 4);
} }
vifFlush(idx); vifFlush(idx);
vifX.cmd = 0; vifX.cmd = 0;

View File

@ -452,7 +452,8 @@ __forceinline int GIFPath::ParseTag(GIF_PATH pathidx, const u8* pMem, u32 size)
break; break;
} }
} }
if (pathidx == GIF_PATH_3) { if (pathidx == GIF_PATH_3 & gif->chcr.STR) { //Make sure we are really doing a DMA and not using FIFO
//GIF_LOG("Path3 end EOP %x NLOOP %x Status %x", tag.EOP, nloop, GSTransferStatus.PTH3);
gif->madr += size * 16; gif->madr += size * 16;
gif->qwc -= size; gif->qwc -= size;
} else if (pathidx == GIF_PATH_2 && !nloop) { //Path2 is odd, but always provides the correct size } else if (pathidx == GIF_PATH_2 && !nloop) { //Path2 is odd, but always provides the correct size