From 4f2bfd181a4ca1bd285d77a0ec4b65c8929a2535 Mon Sep 17 00:00:00 2001 From: mylek4 Date: Sat, 1 Jan 2011 19:55:03 +0000 Subject: [PATCH] Fix for r6707. Looks like I tried to do some invalid 16 bit addressing. Also a small change to the mixer. This should fix audio throttling in cases where num_samples > RESERVED_SAMPLES. This seems to happen now with zelda ucode games, possibly others. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6711 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/AudioCommon/Src/Mixer.cpp | 2 +- Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/AudioCommon/Src/Mixer.cpp b/Source/Core/AudioCommon/Src/Mixer.cpp index ddeec84b6f..56c0065b91 100644 --- a/Source/Core/AudioCommon/Src/Mixer.cpp +++ b/Source/Core/AudioCommon/Src/Mixer.cpp @@ -119,7 +119,7 @@ void CMixer::PushSamples(short *samples, unsigned int num_samples) if (m_throttle) { // The auto throttle function. This loop will put a ceiling on the CPU MHz. - while (Common::AtomicLoad(m_numSamples) + RESERVED_SAMPLES >= MAX_SAMPLES) + while (num_samples + Common::AtomicLoad(m_numSamples) > MAX_SAMPLES) { if (g_dspInitialize.pEmulatorState) { diff --git a/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp b/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp index 062eb96ccc..7ea89bda17 100644 --- a/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp +++ b/Source/Core/DSPCore/Src/Jit/DSPJitUtil.cpp @@ -163,7 +163,7 @@ void DSPEmitter::increase_addr_reg(int reg) CMP(32, R(ECX), R(EDX)); FixupBranch done3 = J_CC(CC_A); //nar += wr + 1; - LEA(16, DI, MComplex(DI, DX, 1, 1)); + LEA(32, EDI, MComplex(EDI, EDX, 1, 1)); SetJumpTarget(done); SetJumpTarget(done2); @@ -230,7 +230,7 @@ void DSPEmitter::decrease_addr_reg(int reg) CMP(32, R(ECX), R(EDX)); FixupBranch done3 = J_CC(CC_A); //nar += wr + 1; - LEA(16, DI, MComplex(DI, DX, 1, 1)); + LEA(32, EDI, MComplex(EDI, EDX, 1, 1)); SetJumpTarget(done); SetJumpTarget(done2);