From fd5f7ba6b4c7d55bd5c57a7d64fdf777bf5948d7 Mon Sep 17 00:00:00 2001 From: Ignacio Farias Date: Mon, 16 Aug 2010 15:22:53 +0000 Subject: [PATCH] Hy, this is my first commit, and i hope it is not bad xD. - First change is for Mixer.cpp, I've just re-added the functionality lost in r4724, so, if you disable audio throttle, games like donkey kong jungle beat, will work properly. - Second change points to a doubt comment on UCode_Zelda_Voice.cpp, where it did not know here PB.NeedsReset came from. Well, the answer is it came from line 03b2 of the dumped Ucode, so when PB.IsBlanck equals to zero, PB.NeedsReset is zero too. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6100 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/AudioCommon/Src/Mixer.cpp | 11 +++++++++-- .../Plugin_DSP_HLE/Src/UCodes/UCode_Zelda_Voice.cpp | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Source/Core/AudioCommon/Src/Mixer.cpp b/Source/Core/AudioCommon/Src/Mixer.cpp index 13ccb4b48a..d7a8092ff5 100644 --- a/Source/Core/AudioCommon/Src/Mixer.cpp +++ b/Source/Core/AudioCommon/Src/Mixer.cpp @@ -136,9 +136,16 @@ unsigned int CMixer::Mix(short* samples, unsigned int numSamples) void CMixer::PushSamples(short *samples, unsigned int num_samples) { - // The auto throttle function. This loop will put a ceiling on the CPU MHz. - if (m_throttle) + // Audio Throttle is off. On Ayuanx commit 4717, it is used to write Other Audio. + // I've just bring that back, and games like Donkey Kong Jungle Beat (WII) now will + // work properly without using Audio Throttle. + if (!m_throttle) { + return; + { + else + { + // The auto throttle function. This loop will put a ceiling on the CPU MHz. while (Common::AtomicLoad(m_numSamples) >= MAX_SAMPLES - RESERVED_SAMPLES) { if (g_dspInitialize.pEmulatorState) 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 9ec5c852ac..2b31507ee4 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 @@ -579,9 +579,6 @@ void CUCode_Zelda::RenderAddVoice(ZeldaVoicePB &PB, s32* _LeftBuffer, s32* _Righ break; } } - - // Necessary for SMG, not for Zelda. Weird. Where's it from? - PB.NeedsReset = 0; ContinueWithBlock: @@ -733,6 +730,10 @@ ContinueWithBlock: addr++; } } + // 03b2, this is the reason of using PB.NeedsReset. Seems to be necessary for SMG, and maybe other games. + if (PB.IsBlank == 0){ + PB.NeedsReset = 0; + } } // size is in stereo samples.