Slightly pedantic change to OPH clearing and added a condition to an FQC assignment statement (there are far too many of these) which I think would interfere with reversed VIF1 operation.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2974 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1 2010-05-09 19:30:30 +00:00
parent 96b1935c5f
commit a8b7c03845
3 changed files with 25 additions and 25 deletions

View File

@ -73,15 +73,11 @@ void __fastcall ReadFIFO_page_5(u32 mem, u64 *out)
{ {
GetMTGS().WaitGS(); GetMTGS().WaitGS();
GSreadFIFO(&psHu64(VIF1_FIFO)); GSreadFIFO(&psHu64(VIF1_FIFO));
} vif1.GSLastDownloadSize--;
if(vif1Regs->stat.FQC > 0) if (vif1.GSLastDownloadSize <= 16)
{ gifRegs->stat.OPH = false;
--vif1.GSLastDownloadSize;
vif1Regs->stat.FQC = min((u32)16, vif1.GSLastDownloadSize); vif1Regs->stat.FQC = min((u32)16, vif1.GSLastDownloadSize);
} }
if(vif1Regs->stat.FQC == 0) //We're out of data now so clear this..
gifRegs->stat.OPH = false;
} }
out[0] = psHu64(VIF1_FIFO); out[0] = psHu64(VIF1_FIFO);

View File

@ -197,7 +197,7 @@ void GIFdma()
} }
clearFIFOstuff(true); clearFIFOstuff(true);
gifRegs->stat.FQC = min((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 = min((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // APATH=3]
//Path2 gets priority in intermittent mode //Path2 gets priority in intermittent mode
if (GSTransferStatus.PTH1 != STOPPED_MODE || GSTransferStatus.PTH2 != STOPPED_MODE) if (GSTransferStatus.PTH1 != STOPPED_MODE || GSTransferStatus.PTH2 != STOPPED_MODE)
@ -218,7 +218,7 @@ void GIFdma()
if ((gif->chcr.MOD == CHAIN_MODE) && gif->chcr.STR) if ((gif->chcr.MOD == CHAIN_MODE) && gif->chcr.STR)
{ {
ptag = ReadTag(); ptag = ReadTag();
gifRegs->stat.FQC = min((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 = min((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // APATH=3]
if (ptag == NULL) return; if (ptag == NULL) return;
GIF_LOG("PTH3 MASK gifdmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx tadr=%lx", ptag[1]._u32, ptag[0]._u32, gif->qwc, ptag->ID, gif->madr, gif->tadr); GIF_LOG("PTH3 MASK gifdmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx tadr=%lx", ptag[1]._u32, ptag[0]._u32, gif->qwc, ptag->ID, gif->madr, gif->tadr);
@ -234,7 +234,7 @@ void GIFdma()
if (gif->qwc == 0) CPU_INT(DMAC_GIF, 16); if (gif->qwc == 0) CPU_INT(DMAC_GIF, 16);
return; return;
} }
gifRegs->stat.FQC = min((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 = min((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // 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"); GIF_LOG("PTH3 MASK Transferring");
@ -253,7 +253,7 @@ void GIFdma()
{ {
Console.WriteLn("DMA Stall Control on GIF normal"); Console.WriteLn("DMA Stall Control on GIF normal");
} }
gifRegs->stat.FQC = min((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 = min((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // APATH=3]
//Check with Path3 masking games //Check with Path3 masking games
if (gif->qwc > 0) { if (gif->qwc > 0) {
GIFchain(); //Transfers the data set by the switch GIFchain(); //Transfers the data set by the switch
@ -271,7 +271,7 @@ void GIFdma()
ptag = ReadTag(); ptag = ReadTag();
if (ptag == NULL) return; if (ptag == NULL) return;
GIF_LOG("gifdmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx tadr=%lx", ptag[1]._u32, ptag[0]._u32, gif->qwc, ptag->ID, gif->madr, gif->tadr); GIF_LOG("gifdmaChain %8.8x_%8.8x size=%d, id=%d, addr=%lx tadr=%lx", ptag[1]._u32, ptag[0]._u32, gif->qwc, ptag->ID, gif->madr, gif->tadr);
gifRegs->stat.FQC = min((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 = min((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // APATH=3]
if (dmacRegs->ctrl.STD == STD_GIF) if (dmacRegs->ctrl.STD == STD_GIF)
{ {
// there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall // there are still bugs, need to also check if gif->madr +16*qwc >= stadr, if not, stall
@ -312,7 +312,7 @@ void GIFdma()
CPU_INT(DMAC_GIF, gscycles * BIAS); CPU_INT(DMAC_GIF, gscycles * BIAS);
gscycles = 0; gscycles = 0;
} }
gifRegs->stat.FQC = min((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 = min((u16)0x10, gif->qwc);// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // APATH=3]
} }
void dmaGIF() void dmaGIF()
@ -589,7 +589,7 @@ void gifMFIFOInterrupt()
gspath3done = false; gspath3done = false;
gscycles = 0; gscycles = 0;
gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_P3Q | GIF_STAT_FQC); // OPH, APATH, P3Q, FQC = 0 gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_P3Q | GIF_STAT_FQC); // APATH, P3Q, FQC = 0
vif1Regs->stat.VGW = false; vif1Regs->stat.VGW = false;
gif->chcr.STR = false; gif->chcr.STR = false;

View File

@ -107,14 +107,18 @@ void vif1TransferToMemory()
g_vifCycles += vif1ch->qwc * 2; g_vifCycles += vif1ch->qwc * 2;
vif1ch->madr += vif1ch->qwc * 16; // mgs3 scene changes vif1ch->madr += vif1ch->qwc * 16; // mgs3 scene changes
if(vif1.GSLastDownloadSize > vif1ch->qwc) if(vif1.GSLastDownloadSize >= vif1ch->qwc)
{ {
vif1.GSLastDownloadSize -= vif1ch->qwc; vif1.GSLastDownloadSize -= vif1ch->qwc;
vif1Regs->stat.FQC = min((u32)16, vif1.GSLastDownloadSize); vif1Regs->stat.FQC = min((u32)16, vif1.GSLastDownloadSize);
if (vif1.GSLastDownloadSize <= 16)
gifRegs->stat.OPH = false;
} }
else else
{ {
vif1Regs->stat.FQC = 0; vif1Regs->stat.FQC = 0;
vif1.GSLastDownloadSize = 0;
gifRegs->stat.OPH = false;
} }
vif1ch->qwc = 0; vif1ch->qwc = 0;
@ -377,7 +381,7 @@ void dmaVIF1()
vif1.dmamode = VIF_CHAIN_MODE; vif1.dmamode = VIF_CHAIN_MODE;
} }
vif1Regs->stat.FQC = min((u16)0x10, vif1ch->qwc); if (vif1ch->chcr.DIR) vif1Regs->stat.FQC = min((u16)0x10, vif1ch->qwc);
// Chain Mode // Chain Mode
vif1Interrupt(); vif1Interrupt();