Committing an IPU fix by ksi3zyc.

This takes care of an IPU hang in Suikoden5! Oh, and God of War. :p

Thanks for this one, ksi3zyc!

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2615 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2010-02-20 20:32:30 +00:00
parent b98e4b9b12
commit d36fca730b
1 changed files with 9 additions and 2 deletions

View File

@ -434,6 +434,7 @@ static __forceinline BOOL ipuIDEC(u32 val)
} }
static int s_bdec = 0; static int s_bdec = 0;
static int g_ipu_dma_error = 0;
static __forceinline BOOL ipuBDEC(u32 val) static __forceinline BOOL ipuBDEC(u32 val)
{ {
@ -830,7 +831,8 @@ void IPUWorker()
break; break;
case SCE_IPU_FDEC: case SCE_IPU_FDEC:
if (!ipuFDEC(ipuRegs->cmd.DATA)) g_ipu_dma_error = 0; // if g_ipu_dma_error is set, then continue processing. Fixes GoWs white screens of death.
if (!ipuFDEC(ipuRegs->cmd.DATA) && !g_ipu_dma_error)
{ {
hwIntcIrq(INTC_IPU); hwIntcIrq(INTC_IPU);
return; return;
@ -1413,7 +1415,12 @@ int IPU1dma()
// Normal Mode & qwc is finished // Normal Mode & qwc is finished
if ((ipu1dma->chcr.MOD == NORMAL_MODE) && (ipu1dma->qwc == 0)) if ((ipu1dma->chcr.MOD == NORMAL_MODE) && (ipu1dma->qwc == 0))
{ {
//Console.WriteLn("ipu1 normal empty qwc?"); Console.Warning("ipu1 normal empty qwc?");
// returning totalqwc here is not enough. It seems to be an error,
// which may cause hangs, especially in God of War.
// Always zero is returned here, what is covered up by other return paths in this function.
// Thus, additional variable is set to indicate from where totalqwc comes.
g_ipu_dma_error = -1; // saves an error of the ipu1 DMA.
return totalqwc; return totalqwc;
} }