From c8f6d68d6848701b2fe3d77cef7cc30c4a40dcc9 Mon Sep 17 00:00:00 2001 From: FlatOutPS2 Date: Tue, 9 Aug 2016 14:06:59 +0200 Subject: [PATCH] PCSX2: IPU end of video freeze fix Fixes end of video freeze in Enthusia - Professional Racing. --- pcsx2/IPU/IPU.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pcsx2/IPU/IPU.cpp b/pcsx2/IPU/IPU.cpp index 1d69a3870e..b8c90f2b16 100644 --- a/pcsx2/IPU/IPU.cpp +++ b/pcsx2/IPU/IPU.cpp @@ -64,6 +64,13 @@ __fi void IPUProcessInterrupt() { if (ipuRegs.ctrl.BUSY) // && (g_BP.FP || g_BP.IFC || (ipu1ch.chcr.STR && ipu1ch.qwc > 0))) IPUWorker(); + if (ipuRegs.ctrl.BUSY && ipuRegs.cmd.BUSY && ipuRegs.cmd.DATA == 0x000001B7) { + // 0x000001B7 is the MPEG2 sequence end code, signalling the end of a video. + // At the end of a video BUSY values should be automatically set to 0. + // This does not happen for Enthusia - Professional Racing, causing it to get stuck in an endless loop. + ipuRegs.cmd.BUSY = 0; + ipuRegs.ctrl.BUSY = 0; + } } ///////////////////////////////////////////////////////// @@ -274,6 +281,7 @@ void ipuSoftReset() ipuRegs.top = 0; ipu_cmd.clear(); ipuRegs.cmd.BUSY = 0; + ipuRegs.cmd.DATA = NULL; // required for Enthusia - Professional Racing after fix, or will freeze at start of next video. memzero(g_BP); }