Removed the fake DMA wait time as it is no longer needed after the aram-dma-fixes branch is merged. This fixes the Resident Evil 2/3 cutscene audio in DSP LLE mode. Fixes issue 2723.

Removed the ADPCM format detection from the previous commit as it broke the audio looping in Knockout Kings 2003.
This commit is contained in:
skidau 2012-10-23 00:30:01 +11:00
parent b2a01dc348
commit 421a75493c
3 changed files with 8 additions and 13 deletions

View File

@ -165,14 +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 && g_dsp.ifx_regs[DSP_FORMAT] != 0x00) // PCM audio
Address = EndAddress;
if (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];
if (Address == EndAddress)
Address = (g_dsp.ifx_regs[DSP_ACSAH] << 16) | g_dsp.ifx_regs[DSP_ACSAL];
DSPCore_SetException(EXP_ACCOV);
}

View File

@ -697,14 +697,12 @@ void UpdateAudioDMA()
void Do_ARAM_DMA()
{
// Fake the DMA taking time to complete. The delay is not accurate, but
// seems like a good estimate
CoreTiming::ScheduleEvent_Threadsafe(g_arDMA.Cnt.count >> 1, et_GenerateDSPInterrupt, INT_ARAM | (1<<16));
// Emulating the DMA wait time fixes Knockout Kings 2003 in DSP HLE mode
if (!GetDSPEmulator()->IsLLE())
g_dspState.DSPControl.DMAState = 1;
GenerateDSPInterrupt(INT_ARAM, true);
// Real hardware DMAs in 32byte chunks, but we can get by with 8byte chunks
if (g_arDMA.Cnt.dir)
{

View File

@ -232,12 +232,12 @@ inline void MixAddVoice(ParamBlockType &pb,
temprbuffer[s] += right;
// Control the behavior when we reach the end of the sample
if ((pb.audio_addr.sample_format != AUDIOFORMAT_ADPCM && samplePos >= sampleEnd) ||
(pb.audio_addr.sample_format == AUDIOFORMAT_ADPCM && samplePos == sampleEnd))
if (samplePos >= sampleEnd)
{
if (pb.audio_addr.looping == 1)
{
samplePos = loopPos;
if (samplePos == sampleEnd || (pb.audio_addr.sample_format != AUDIOFORMAT_ADPCM))
samplePos = loopPos;
if ((!pb.is_stream) && (pb.audio_addr.sample_format == AUDIOFORMAT_ADPCM))
{
pb.adpcm.yn1 = pb.adpcm_loop_info.yn1;