diff options
| author | skidau <skidau@gmail.com> | 2012-10-22 22:59:35 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2012-10-22 22:59:35 +1100 |
| commit | b2a01dc348138f2faf1335002e102aadabc436cf (patch) | |
| tree | 62c66a73f65111f2c8c63ee7f3e14e3cb11b67c0 /Source | |
| parent | f7edfc0118afe02f06ddb5fe6a2462414c7edd79 (diff) | |
Changed the loop end address detection to an exact match with the current address for ADPCM audio. Fixes the non-looping music in PN03.
Fixes issue 3998.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/Src/DSP/DSPAccelerator.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp index b1452c249c..92651205a9 100644 --- a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp +++ b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp @@ -165,7 +165,11 @@ u16 dsp_read_accelerator() // Somehow, YN1 and YN2 must be initialized with their "loop" values, // so yeah, it seems likely that we should raise an exception to let // the DSP program do that, at least if DSP_FORMAT == 0x0A. - if (Address >= EndAddress) + + if (Address > EndAddress && g_dsp.ifx_regs[DSP_FORMAT] != 0x00) // PCM audio + Address = EndAddress; + + if (Address == EndAddress) { // Set address back to start address. Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL]; 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 e6ee063ae3..7649a53091 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 @@ -232,7 +232,8 @@ inline void MixAddVoice(ParamBlockType &pb, temprbuffer[s] += right; // Control the behavior when we reach the end of the sample - if (samplePos >= sampleEnd) + if ((pb.audio_addr.sample_format != AUDIOFORMAT_ADPCM && samplePos >= sampleEnd) || + (pb.audio_addr.sample_format == AUDIOFORMAT_ADPCM && samplePos == sampleEnd)) { if (pb.audio_addr.looping == 1) { |
