From d36fca730bc0bab0b5601ec98aed39e8883ecc86 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Sat, 20 Feb 2010 20:32:30 +0000 Subject: [PATCH] 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 --- pcsx2/IPU/IPU.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pcsx2/IPU/IPU.cpp b/pcsx2/IPU/IPU.cpp index 5cee401836..b57c8a6c29 100644 --- a/pcsx2/IPU/IPU.cpp +++ b/pcsx2/IPU/IPU.cpp @@ -434,6 +434,7 @@ static __forceinline BOOL ipuIDEC(u32 val) } static int s_bdec = 0; +static int g_ipu_dma_error = 0; static __forceinline BOOL ipuBDEC(u32 val) { @@ -830,7 +831,8 @@ void IPUWorker() break; 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); return; @@ -1413,7 +1415,12 @@ int IPU1dma() // Normal Mode & qwc is finished 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; }