From 685b3eab25d0a147870f078fb73020726ef3d98e Mon Sep 17 00:00:00 2001 From: Jean-Philip Desjardins Date: Fri, 20 Mar 2015 23:28:37 -0400 Subject: [PATCH] Improved IRQ address detection in SPU. --- Source/iop/Iop_SpuBase.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/iop/Iop_SpuBase.cpp b/Source/iop/Iop_SpuBase.cpp index fa6d9906..b81421e3 100644 --- a/Source/iop/Iop_SpuBase.cpp +++ b/Source/iop/Iop_SpuBase.cpp @@ -485,13 +485,17 @@ void CSpuBase::Render(int16* samples, unsigned int sampleCount, unsigned int sam reader.ClearDidChangeRepeat(); } } + + uint32 prevAddress = channel.current; + int16 readSample = 0; reader.SetPitch(m_baseSamplingRate, channel.pitch); reader.GetSamples(&readSample, 1, sampleRate); channel.current = static_cast(reader.GetCurrent() - m_ram); //TODO: Improve address detection (used by DW5, SW2, OW2 in movie playback) - if((m_ctrl & CONTROL_IRQ) && (m_irqAddr != 0) && (channel.current >= m_irqAddr)) + if((m_ctrl & CONTROL_IRQ) && (m_irqAddr != 0) && (prevAddress != 0) && (prevAddress != channel.current) && + (m_irqAddr >= prevAddress) && (m_irqAddr <= channel.current)) { m_irqPending = true; }