From 303b0f6b6d3788b3ed8fd8e40e7daa4642d73ad1 Mon Sep 17 00:00:00 2001 From: skidau Date: Mon, 29 Oct 2012 14:03:28 +1100 Subject: [PATCH] Test the audio loop with aligned addresses. Fixes the high pitched squeal in Muramasa. --- Source/Core/Core/Src/DSP/DSPAccelerator.cpp | 2 +- Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp index 525750fc7d..dcb79b7ac5 100644 --- a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp +++ b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp @@ -168,7 +168,7 @@ u16 dsp_read_accelerator() if (Address >= EndAddress) { // Set address back to start address. - if (Address == EndAddress) + if ((Address & ~0x1f) == (EndAddress & ~0x1f)) Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL]; DSPCore_SetException(EXP_ACCOV); } diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h index 9a058afb83..bf5e4d9b6b 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h @@ -236,7 +236,7 @@ inline void MixAddVoice(ParamBlockType &pb, { if (pb.audio_addr.looping == 1) { - if (samplePos == sampleEnd || (pb.audio_addr.sample_format != AUDIOFORMAT_ADPCM)) + if ((samplePos & ~0x1f) == (sampleEnd & ~0x1f) || (pb.audio_addr.sample_format != AUDIOFORMAT_ADPCM)) samplePos = loopPos; if ((!pb.is_stream) && (pb.audio_addr.sample_format == AUDIOFORMAT_ADPCM)) {