Fixed the random static audio that would sometimes occur in DSP HLE and DSP LLE.
This commit is contained in:
parent
3ebe0718b8
commit
7bf72a6c84
|
@ -165,10 +165,9 @@ u16 dsp_read_accelerator()
|
||||||
// Somehow, YN1 and YN2 must be initialized with their "loop" values,
|
// Somehow, YN1 and YN2 must be initialized with their "loop" values,
|
||||||
// so yeah, it seems likely that we should raise an exception to let
|
// so yeah, it seems likely that we should raise an exception to let
|
||||||
// the DSP program do that, at least if DSP_FORMAT == 0x0A.
|
// 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.
|
// 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);
|
DSPCore_SetException(EXP_ACCOV);
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,11 +203,9 @@ u16 AcceleratorGetSample()
|
||||||
//
|
//
|
||||||
// On real hardware, this would raise an interrupt that is handled by the
|
// On real hardware, this would raise an interrupt that is handled by the
|
||||||
// UCode. We simulate what this interrupt does here.
|
// UCode. We simulate what this interrupt does here.
|
||||||
if (*acc_cur_addr >= acc_end_addr)
|
|
||||||
{
|
|
||||||
// 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))
|
if ((*acc_cur_addr & ~0x1F) == (acc_end_addr & ~0x1F))
|
||||||
|
{
|
||||||
|
// If we are really at the end, loop back to loop_addr.
|
||||||
*acc_cur_addr = acc_loop_addr;
|
*acc_cur_addr = acc_loop_addr;
|
||||||
|
|
||||||
if (acc_pb->audio_addr.looping)
|
if (acc_pb->audio_addr.looping)
|
||||||
|
|
Loading…
Reference in New Issue