Fix for some freaky corruption caused by more than 1 GS transfer happening at once (mostly PATH 2/3 due to data types) - Example fixed Tekken 5 Devil Mode HUD

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2738 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2010-03-19 00:21:46 +00:00
parent 1f2f855f36
commit 46c39081c7
3 changed files with 27 additions and 13 deletions

View File

@ -55,10 +55,20 @@ __forceinline void gsInterrupt()
return;
}
if ((vif1.cmd & 0x7f) == 0x51) // DIRECTHL
if ((vif1.cmd & 0x7e) == 0x50) // DIRECT/HL
{
// Not waiting for the end of the Gif transfer.
if (Path3progress != IMAGE_MODE) vif1Regs->stat.VGW = false;
//original behaviour here - if (Path3progress != IMAGE_MODE) vif1Regs->stat.VGW = false;
// Transfer in progress on VIF and GIF has finished so let VIF do its bit
if (Path3progress == STOPPED_MODE)
{
vif1Regs->stat.VGW = false;
CPU_INT( DMAC_GIF, 4 );
return;
}
}
if (Path3progress == STOPPED_MODE)
@ -209,7 +219,7 @@ void GIFdma()
gifRegs->stat.FQC |= 0x10;// FQC=31, hack ;) (for values of 31 that equal 16) [ used to be 0xE00; // OPH=1 | APATH=3]
//Path2 gets priority in intermittent mode
if ((gifRegs->stat.P1Q || (vif1.cmd & 0x7f) == 0x50) && gifRegs->mode.IMT && (Path3progress == IMAGE_MODE))
if ((gifRegs->stat.P1Q || (vif1.cmd & 0x7e) == 0x50) && gifRegs->mode.IMT && (Path3progress == STOPPED_MODE))
{
// We are in image mode doing DIRECTHL, Path 1 is in queue, and in intermittant mode.
GIF_LOG("Waiting VU %x, PATH2 %x, GIFMODE %x Progress %x", gifRegs->stat.P1Q, (vif1.cmd & 0x7f), gifRegs->mode._u32, Path3progress);

View File

@ -200,9 +200,9 @@ __forceinline void vif1Interrupt()
if ((vif1Regs->stat.VGW))
{
if (gif->chcr.STR)
if (gif->chcr.STR && (Path3progress != STOPPED_MODE))
{
CPU_INT(DMAC_VIF1, gif->qwc * BIAS);
CPU_INT(DMAC_VIF1, 4);
return;
}
else

View File

@ -109,14 +109,18 @@ template<int idx> _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) {
vif1Only();
//return vifTrans_DirectHL<idx>((u32*)data);
if (isDirectHL) {
if (gif->chcr.STR && (!vif1Regs->mskpath3 && (Path3progress == IMAGE_MODE))) {
DevCon.WriteLn("DirectHL: Waiting for Path3 to finish!");
//Should probably do this for both types of transfer seen as the GS hates taking 2 seperate chunks
//if (isDirectHL) {
if (gif->chcr.STR && (!vif1Regs->mskpath3 && (Path3progress != STOPPED_MODE)))
{
/*if(!isDirectHL) DevCon.WriteLn("Direct: Waiting for Path3 to finish!");
else DevCon.WriteLn("DirectHL: Waiting for Path3 to finish!");*/
vif1Regs->stat.VGW = true; // PATH3 is in image mode, so wait for end of transfer
vif1.vifstalled = true;
return 0;
}
}
//}
Registers::Freeze();
nVifStruct& v = nVif[1];