From 98987643b329151cd0b82c92e8985ea26e0933ce Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 24 Oct 2020 19:42:22 +1000 Subject: [PATCH] SPU: Always reset address on loop end regardless of repeat Fixes menu music in Madden NFL 99. --- src/core/spu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/spu.cpp b/src/core/spu.cpp index 3748e92b2..8411d3fa8 100644 --- a/src/core/spu.cpp +++ b/src/core/spu.cpp @@ -1370,6 +1370,8 @@ ALWAYS_INLINE_RELEASE std::tuple SPU::SampleVoice(u32 voice_index) if (voice.current_block_flags.loop_end) { m_endx_register |= (u32(1) << voice_index); + voice.current_address = voice.regs.adpcm_repeat_address & ~u16(1); + if (!voice.current_block_flags.loop_repeat) { Log_TracePrintf("Voice %u loop end+mute @ 0x%08X", voice_index, ZeroExtend32(voice.current_address)); @@ -1378,7 +1380,6 @@ ALWAYS_INLINE_RELEASE std::tuple SPU::SampleVoice(u32 voice_index) else { Log_TracePrintf("Voice %u loop end+repeat @ 0x%08X", voice_index, ZeroExtend32(voice.current_address)); - voice.current_address = voice.regs.adpcm_repeat_address & ~u16(1); } } }