diff options
| author | skidau <skidau@gmail.com> | 2013-01-11 01:03:18 +1100 |
|---|---|---|
| committer | skidau <skidau@gmail.com> | 2013-01-11 01:03:18 +1100 |
| commit | 7bf72a6c8476798ecbb9cdb13ec3a8f0b9858da6 (patch) | |
| tree | ba7c957e71b44261ef14733685193f89b88641d2 /Source/Core | |
| parent | 3ebe0718b8fde3d1acedb1840c5c8fe44625e8fd (diff) | |
Fixed the random static audio that would sometimes occur in DSP HLE and DSP LLE.
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/Src/DSP/DSPAccelerator.cpp | 5 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h | 8 |
2 files changed, 5 insertions, 8 deletions
diff --git a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp index dcb79b7ac5..2058a92f9d 100644 --- a/Source/Core/Core/Src/DSP/DSPAccelerator.cpp +++ b/Source/Core/Core/Src/DSP/DSPAccelerator.cpp @@ -165,11 +165,10 @@ 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 & ~0x1f) == (EndAddress & ~0x1f)) { // Set address back to start address. - if ((Address & ~0x1f) == (EndAddress & ~0x1f)) - Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL]; + 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 349dc7e03b..e39b38b100 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 @@ -203,12 +203,10 @@ u16 AcceleratorGetSample() // // On real hardware, this would raise an interrupt that is handled by the // UCode. We simulate what this interrupt does here. - if (*acc_cur_addr >= acc_end_addr) + if ((*acc_cur_addr & ~0x1F) == (acc_end_addr & ~0x1F)) { - // If we are really at the end (and we don't simply have cur_addr > - // end_addr all the time), loop back to loop_addr. - if ((*acc_cur_addr & ~0x1F) == (acc_end_addr & ~0x1F)) - *acc_cur_addr = acc_loop_addr; + // If we are really at the end, loop back to loop_addr. + *acc_cur_addr = acc_loop_addr; if (acc_pb->audio_addr.looping) { |
