From 3f481a70beedf67c2045b297670e63e9a6b6bcb9 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Mon, 18 Sep 2017 02:54:58 +0200 Subject: [PATCH] Fix sample wrapping with new DSP ADPCM decoding Fixes possible regression from #6069. --- Source/Core/Core/DSP/DSPAccelerator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/DSP/DSPAccelerator.cpp b/Source/Core/Core/DSP/DSPAccelerator.cpp index 850f210b3f..1a8cbf2671 100644 --- a/Source/Core/Core/DSP/DSPAccelerator.cpp +++ b/Source/Core/Core/DSP/DSPAccelerator.cpp @@ -120,8 +120,8 @@ u16 ReadAccelerator(u32 start_address, u32 end_address, u32* current_address, u1 if (temp >= 8) temp -= 16; - val = (scale * temp) + ((0x400 + coef1 * *yn1 + coef2 * *yn2) >> 11); - val = MathUtil::Clamp(val, -0x7FFF, 0x7FFF); + s32 val32 = (scale * temp) + ((0x400 + coef1 * *yn1 + coef2 * *yn2) >> 11); + val = static_cast(MathUtil::Clamp(val32, -0x7FFF, 0x7FFF)); *yn2 = *yn1; *yn1 = val;