From cfca4ccdd0ee84fc2b244db72b0bca1a70a93ded Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Thu, 23 Sep 2010 15:24:45 +0000 Subject: [PATCH] IPU Fix for Haunting Grounds (in-game cinemas skipped after 1 second). Bug was caused by the internal buffer of the IPU (2 QWC) not being refilled properly in rare circumstances. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3824 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/IPU/IPU.cpp | 6 +++--- pcsx2/IPU/IPU.h | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pcsx2/IPU/IPU.cpp b/pcsx2/IPU/IPU.cpp index d39c1d242b..e0c2829752 100644 --- a/pcsx2/IPU/IPU.cpp +++ b/pcsx2/IPU/IPU.cpp @@ -206,8 +206,8 @@ __fi u32 ipuRead32(u32 mem) if (!ipuRegs.ctrl.BUSY) IPU_LOG("read32: IPU_CTRL=0x%08X", ipuRegs.ctrl._u32); - return ipuRegs.ctrl._u32; - } + return ipuRegs.ctrl._u32; + } ipucase(IPU_BP): // IPU_BP { @@ -218,7 +218,7 @@ __fi u32 ipuRead32(u32 mem) ipuRegs.ipubp |= g_BP.FP << 16; IPU_LOG("read32: IPU_BP=0x%08X", ipuRegs.ipubp); - return ipuRegs.ipubp; + return ipuRegs.ipubp; } default: diff --git a/pcsx2/IPU/IPU.h b/pcsx2/IPU/IPU.h index 6759e547db..bba968e31c 100644 --- a/pcsx2/IPU/IPU.h +++ b/pcsx2/IPU/IPU.h @@ -85,7 +85,7 @@ struct __aligned16 tIPU_BP { BP += bits; pxAssume( BP <= 256 ); - if (BP > 127) + if (BP >= 128) { BP -= 128; @@ -100,8 +100,11 @@ struct __aligned16 tIPU_BP { else { // if FP == 1 then the buffer has been completely drained. - // if FP == 0 then an already-drained buffer is being advanced. - // In either case we just assign FP to 0. + // if FP == 0 then an already-drained buffer is being advanced, and we need to drop a + // quadword from the IPU FIFO. + + if (!FP) + ipu_fifo.in.read(&internal_qwc[0]); FP = 0; }