From 34a808c25855277fb4617ec49f327b2262b08ac0 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Thu, 29 Oct 2020 01:30:38 +1000 Subject: [PATCH] SPU: Zero previous block ADPCM samples on key on Fixes clicking in background in Breath of Fire III. --- src/core/spu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/spu.cpp b/src/core/spu.cpp index 658422031..94310a3dc 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -947,6 +947,11 @@ void SPU::Voice::KeyOn() counter.bits = 0; regs.adsr_volume = 0; adpcm_last_samples.fill(0); + + // Samples from the previous block for interpolation should be zero. Fixes clicks in audio in Breath of Fire III. + std::fill_n(¤t_block_samples[NUM_SAMPLES_PER_ADPCM_BLOCK], NUM_SAMPLES_FROM_LAST_ADPCM_BLOCK, + static_cast(0)); + has_samples = false; ignore_loop_address = false; adsr_phase = ADSRPhase::Attack;