mirror of https://github.com/PCSX2/pcsx2.git
pcsx2: A bit of cleanup.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3307 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
a51aef5152
commit
06e4ae00b2
|
@ -424,7 +424,7 @@ void dmaGIF()
|
||||||
if(gif->chcr.MOD == CHAIN_MODE && gif->qwc > 0)
|
if(gif->chcr.MOD == CHAIN_MODE && gif->qwc > 0)
|
||||||
{
|
{
|
||||||
//DevCon.Warning(L"GIF QWC on Chain " + gif->chcr.desc());
|
//DevCon.Warning(L"GIF QWC on Chain " + gif->chcr.desc());
|
||||||
if(((gif->chcr.TAG >> 12) & 0x7) == 0x0 || ((gif->chcr.TAG >> 12) & 0x7) == 0x7)
|
if ((gif->chcr.tag().ID == TAG_REFE) || (gif->chcr.tag().ID == TAG_END))
|
||||||
{
|
{
|
||||||
gspath3done = true;
|
gspath3done = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,6 @@ void _SPR0interleave()
|
||||||
}
|
}
|
||||||
|
|
||||||
spr0->qwc = 0;
|
spr0->qwc = 0;
|
||||||
spr0finished = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static __forceinline void _dmaSPR0()
|
static __forceinline void _dmaSPR0()
|
||||||
|
@ -207,6 +206,7 @@ static __forceinline void _dmaSPR0()
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
_SPR0interleave();
|
_SPR0interleave();
|
||||||
|
spr0finished = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,14 +264,10 @@ void dmaSPR0() // fromSPR
|
||||||
if(spr0->chcr.MOD == CHAIN_MODE && spr0->qwc > 0)
|
if(spr0->chcr.MOD == CHAIN_MODE && spr0->qwc > 0)
|
||||||
{
|
{
|
||||||
//DevCon.Warning(L"SPR0 QWC on Chain " + spr0->chcr.desc());
|
//DevCon.Warning(L"SPR0 QWC on Chain " + spr0->chcr.desc());
|
||||||
if(((spr0->chcr.TAG >> 12) & 0x7) == 0x7)
|
if (spr0->chcr.tag().ID == TAG_END) // but not TAG_REFE?
|
||||||
{
|
{
|
||||||
spr0finished = true;
|
spr0finished = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
spr0finished = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SPRFROMinterrupt();
|
SPRFROMinterrupt();
|
||||||
|
@ -327,7 +323,6 @@ void _SPR1interleave()
|
||||||
}
|
}
|
||||||
|
|
||||||
spr1->qwc = 0;
|
spr1->qwc = 0;
|
||||||
spr1finished = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _dmaSPR1() // toSPR work function
|
void _dmaSPR1() // toSPR work function
|
||||||
|
@ -394,6 +389,7 @@ void _dmaSPR1() // toSPR work function
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
_SPR1interleave();
|
_SPR1interleave();
|
||||||
|
spr1finished = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -411,14 +407,10 @@ void dmaSPR1() // toSPR
|
||||||
if(spr1->chcr.MOD == CHAIN_MODE && spr1->qwc > 0)
|
if(spr1->chcr.MOD == CHAIN_MODE && spr1->qwc > 0)
|
||||||
{
|
{
|
||||||
//DevCon.Warning(L"SPR1 QWC on Chain " + spr1->chcr.desc());
|
//DevCon.Warning(L"SPR1 QWC on Chain " + spr1->chcr.desc());
|
||||||
if(((spr1->chcr.TAG >> 12) & 0x7) == 0x7 || ((spr1->chcr.TAG >> 12) & 0x7) == 0x0)
|
if ((spr1->chcr.tag().ID == TAG_END) || (spr1->chcr.tag().ID == TAG_REFE))
|
||||||
{
|
{
|
||||||
spr1finished = true;
|
spr1finished = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
spr1finished = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SPRTOinterrupt();
|
SPRTOinterrupt();
|
||||||
|
|
|
@ -232,7 +232,8 @@ void dmaVIF0()
|
||||||
vif0.dmamode = VIF_CHAIN_MODE;
|
vif0.dmamode = VIF_CHAIN_MODE;
|
||||||
//DevCon.Warning(L"VIF0 QWC on Chain CHCR " + vif0ch->chcr.desc());
|
//DevCon.Warning(L"VIF0 QWC on Chain CHCR " + vif0ch->chcr.desc());
|
||||||
vif0.inprogress |= 0x1;
|
vif0.inprogress |= 0x1;
|
||||||
if(((vif0ch->chcr.TAG >> 12) & 0x7) == 0x0 || ((vif0ch->chcr.TAG >> 12) & 0x7) == 0x7)
|
|
||||||
|
if ((vif0ch->chcr.tag().ID == TAG_REFE) || (vif0ch->chcr.tag().ID == TAG_END))
|
||||||
{
|
{
|
||||||
vif0.done = true;
|
vif0.done = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -282,7 +282,7 @@ bool CheckPath2GIF(int channel)
|
||||||
}
|
}
|
||||||
else if( vif1.GifWaitState == 1 ) // Else we're flushing path3 :), but of course waiting for the microprogram to finish
|
else if( vif1.GifWaitState == 1 ) // Else we're flushing path3 :), but of course waiting for the microprogram to finish
|
||||||
{
|
{
|
||||||
if(gifRegs->stat.P1Q == true)
|
if (gifRegs->stat.P1Q)
|
||||||
{
|
{
|
||||||
//DevCon.Warning("VIF1-1 stall P1Q %x P2Q %x APATH %x PTH3 %x vif1cmd %x", gifRegs->stat.P1Q, gifRegs->stat.P2Q, gifRegs->stat.APATH, GSTransferStatus.PTH3, vif1.cmd);
|
//DevCon.Warning("VIF1-1 stall P1Q %x P2Q %x APATH %x PTH3 %x vif1cmd %x", gifRegs->stat.P1Q, gifRegs->stat.P2Q, gifRegs->stat.APATH, GSTransferStatus.PTH3, vif1.cmd);
|
||||||
CPU_INT(channel, 128);
|
CPU_INT(channel, 128);
|
||||||
|
@ -316,7 +316,7 @@ bool CheckPath2GIF(int channel)
|
||||||
}
|
}
|
||||||
else //Normal Flush
|
else //Normal Flush
|
||||||
{
|
{
|
||||||
if(gifRegs->stat.P1Q == true)
|
if (gifRegs->stat.P1Q)
|
||||||
{
|
{
|
||||||
//DevCon.Warning("VIF1-2 stall P1Q %x P2Q %x APATH %x PTH3 %x vif1cmd %x", gifRegs->stat.P1Q, gifRegs->stat.P2Q, gifRegs->stat.APATH, GSTransferStatus.PTH3, vif1.cmd);
|
//DevCon.Warning("VIF1-2 stall P1Q %x P2Q %x APATH %x PTH3 %x vif1cmd %x", gifRegs->stat.P1Q, gifRegs->stat.P2Q, gifRegs->stat.APATH, GSTransferStatus.PTH3, vif1.cmd);
|
||||||
CPU_INT(channel, 128);
|
CPU_INT(channel, 128);
|
||||||
|
@ -340,7 +340,6 @@ __forceinline void vif1Interrupt()
|
||||||
{
|
{
|
||||||
gifRegs->stat.OPH = false;
|
gifRegs->stat.OPH = false;
|
||||||
gifRegs->stat.APATH = GIF_APATH_IDLE;
|
gifRegs->stat.APATH = GIF_APATH_IDLE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (schedulepath3msk & 0x10)
|
if (schedulepath3msk & 0x10)
|
||||||
|
@ -350,7 +349,7 @@ __forceinline void vif1Interrupt()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//Some games (Fahrenheit being one) start vif first, let it loop through blankness while it sets MFIFO mode, so we need to check it here.
|
//Some games (Fahrenheit being one) start vif first, let it loop through blankness while it sets MFIFO mode, so we need to check it here.
|
||||||
if (dmacRegs->ctrl.MFD == MFD_VIF1) // VIF MFIFO
|
if (dmacRegs->ctrl.MFD == MFD_VIF1)
|
||||||
{
|
{
|
||||||
//Console.WriteLn("VIFMFIFO\n");
|
//Console.WriteLn("VIFMFIFO\n");
|
||||||
// Test changed because the Final Fantasy 12 opening somehow has the tag in *Undefined* mode, which is not in the documentation that I saw.
|
// Test changed because the Final Fantasy 12 opening somehow has the tag in *Undefined* mode, which is not in the documentation that I saw.
|
||||||
|
@ -360,14 +359,14 @@ __forceinline void vif1Interrupt()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(vif1ch->chcr.DIR && CheckPath2GIF(DMAC_VIF1) == false) return;
|
|
||||||
//We need to check the direction, if it is downloading from the GS, we handle that seperately (KH2 for testing)
|
//We need to check the direction, if it is downloading from the GS, we handle that seperately (KH2 for testing)
|
||||||
if (vif1ch->chcr.DIR)vif1Regs->stat.FQC = min(vif1ch->qwc, (u16)16);
|
if (vif1ch->chcr.DIR)
|
||||||
|
{
|
||||||
|
if (!CheckPath2GIF(DMAC_VIF1)) return;
|
||||||
|
|
||||||
|
vif1Regs->stat.FQC = min(vif1ch->qwc, (u16)16);
|
||||||
//Simulated GS transfer time done, clear the flags
|
//Simulated GS transfer time done, clear the flags
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!(vif1ch->chcr.STR)) Console.WriteLn("Vif1 running when CHCR == %x", vif1ch->chcr._u32);
|
if (!(vif1ch->chcr.STR)) Console.WriteLn("Vif1 running when CHCR == %x", vif1ch->chcr._u32);
|
||||||
|
|
||||||
|
@ -486,7 +485,8 @@ void dmaVIF1()
|
||||||
vif1.dmamode = VIF_CHAIN_MODE;
|
vif1.dmamode = VIF_CHAIN_MODE;
|
||||||
//DevCon.Warning(L"VIF1 QWC on Chain CHCR " + vif1ch->chcr.desc());
|
//DevCon.Warning(L"VIF1 QWC on Chain CHCR " + vif1ch->chcr.desc());
|
||||||
vif1.inprogress |= 0x1;
|
vif1.inprogress |= 0x1;
|
||||||
if(((vif1ch->chcr.TAG >> 12) & 0x7) == 0x0 || ((vif1ch->chcr.TAG >> 12) & 0x7) == 0x7)
|
|
||||||
|
if ((vif1ch->chcr.tag().ID == TAG_REFE) || (vif1ch->chcr.tag().ID == TAG_END))
|
||||||
{
|
{
|
||||||
vif1.done = true;
|
vif1.done = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue