From 4da0457524137fecfe5365035576422862d9721a Mon Sep 17 00:00:00 2001 From: "XTra.KrazzY" Date: Mon, 13 Jul 2009 13:22:17 +0000 Subject: [PATCH] Zelda UCode: Solves 0x21 hang. In the worst case there's a bit of stuttering in the end of the sound, since it's probably supposed to fade out. Remaining problem: 0x21 isn't resampled correctly, so when the framerate is ~200 FPS, the music runs as it would on ~60 FPS git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3779 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp index aa933414c2..7ecc2799db 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp @@ -310,7 +310,9 @@ void CUCode_Zelda::RenderVoice_Raw(ZeldaVoicePB &PB, s16 *_Buffer, int _Size) // Decoder0x21Core starts here. u32 AX0 = _RealSize; - if (PB.RemLength < _RealSize) + // The PB.StopOnSilence check is a hack, we should check the buffers and enter this + // only when the buffer is completely 0 (i.e. when the music has finished fading out) + if (PB.StopOnSilence || PB.RemLength < _RealSize) { WARN_LOG(DSPHLE, "Raw: END"); // Let's ignore this entire case since it doesn't seem to happen