Test the audio loop with aligned addresses. Fixes the high pitched squeal in Muramasa.

This commit is contained in:
skidau 2012-10-29 14:03:28 +11:00
parent 882d5161f8
commit 303b0f6b6d
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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))
{