Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'Capcom-Music-Loop'
* Capcom-Music-Loop:
  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.
  Changed the loop end address detection to an exact match with the current address for ADPCM audio.  Fixes the non-looping music in PN03.
  • Loading branch information
skidau committed Oct 28, 2012
2 parents 7006cd1 + 421a754 commit 882d516
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Source/Core/Core/Src/DSP/DSPAccelerator.cpp
Expand Up @@ -168,7 +168,8 @@ u16 dsp_read_accelerator()
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);
}

Expand Down
6 changes: 2 additions & 4 deletions Source/Core/Core/Src/HW/DSP.cpp
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX_Voice.h
Expand Up @@ -236,7 +236,8 @@ inline void MixAddVoice(ParamBlockType &pb,
{
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;
Expand Down

0 comments on commit 882d516

Please sign in to comment.