Fix for Killzone from r2954, also cleaned up some other OPH's that had been missed

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2969 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
refraction 2010-05-09 16:13:27 +00:00
parent e5b02297e9
commit fbf2a59b32
5 changed files with 14 additions and 7 deletions

View File

@ -17,6 +17,7 @@
#include "PrecompiledHeader.h"
#include "Common.h"
#include "Gif.h"
#include "GS.h"
#include "Vif.h"
#include "IPU/IPU.h"
@ -69,6 +70,7 @@ void __fastcall ReadFIFO_page_5(u32 mem, u64 *out)
GSreadFIFO(&psHu64(VIF1_FIFO));
}
if(vif1Regs->stat.FQC > 0)--vif1Regs->stat.FQC;
else gifRegs->stat.OPH = false;
}
out[0] = psHu64(VIF1_FIFO);

View File

@ -58,7 +58,7 @@ __forceinline void gsInterrupt()
if (GSTransferStatus.PTH3 == STOPPED_MODE)
{
gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_OPH);
gifRegs->stat.clear_flags(GIF_STAT_APATH3);
}
if ((gif->qwc > 0) || (!gspath3done))
@ -80,7 +80,7 @@ __forceinline void gsInterrupt()
gif->chcr.STR = 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_FQC);
clearFIFOstuff(false);
hwDmacIrq(DMAC_GIF);
@ -538,7 +538,6 @@ void gifMFIFOInterrupt()
if (GSTransferStatus.PTH3 == STOPPED_MODE)
{
gifRegs->stat.APATH = GIF_APATH_IDLE;
gifRegs->stat.OPH = false;
}
if ((spr0->chcr.STR) && (spr0->qwc == 0))
@ -590,7 +589,7 @@ void gifMFIFOInterrupt()
gspath3done = false;
gscycles = 0;
gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_OPH | GIF_STAT_P3Q | GIF_STAT_FQC); // OPH, APATH, P3Q, FQC = 0
gifRegs->stat.clear_flags(GIF_STAT_APATH3 | GIF_STAT_P3Q | GIF_STAT_FQC); // OPH, APATH, P3Q, FQC = 0
vif1Regs->stat.VGW = false;
gif->chcr.STR = false;

View File

@ -298,6 +298,7 @@ __forceinline void vif1Interrupt()
#endif
vif1Regs->stat.VPS = VPS_IDLE; //Vif goes idle as the stall happened between commands;
if(gifRegs->stat.OPH == true && vif1Regs->stat.FQC == 0) gifRegs->stat.OPH = false;
vif1ch->chcr.STR = false;
g_vifCycles = 0;
VIF_LOG("VIF1 End");

View File

@ -224,6 +224,11 @@ void vifMFIFOInterrupt()
if (schedulepath3msk & 0x10) Vif1MskPath3();
if(gifRegs->stat.APATH == GIF_APATH2 && (vif1.cmd & 0x70) != 0x50)
{
gifRegs->stat.APATH = GIF_APATH_IDLE;
}
if ((vif1Regs->stat.VGW))
{
if (GSTransferStatus.PTH3 < STOPPED_MODE || GSTransferStatus.PTH1 != STOPPED_MODE)

View File

@ -130,6 +130,8 @@ template<int idx> _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) {
const int ret = aMin(vif1.vifpacketsize, vif1.tag.size);
u32 size = ret << 2;
gifRegs->stat.APATH = GIF_APATH2; //Flag is cleared in vif1interrupt to simulate it being in progress.
if (ret == v.vif->tag.size) { // Full Transfer
if (v.bSize) { // Last transfer was partial
memcpy_fast(&v.buffer[v.bSize], data, size);
@ -144,11 +146,9 @@ template<int idx> _f int _vifCode_Direct(int pass, u8* data, bool isDirectHL) {
vif1.tag.size = 0;
vif1.cmd = 0;
v.bSize = 0;
gifRegs->stat.APATH = GIF_APATH_IDLE;
}
else { // Partial Transfer
//DevCon.WriteLn("DirectHL: Partial Transfer [%d]", size);
gifRegs->stat.APATH = GIF_APATH2;
//DevCon.WriteLn("DirectHL: Partial Transfer [%d]", size);
memcpy_fast(&v.buffer[v.bSize], data, size);
v.bSize += size;
vif1.tag.size -= ret;