Merge pull request #3397 from skidau/dsp-acc-loop-end

Catered for the case where ADPCM audio would loop before the end of the stream
This commit is contained in:
skidau 2015-12-29 10:21:12 +11:00
commit d3d0aa69ce
2 changed files with 20 additions and 4 deletions

View File

@ -121,10 +121,18 @@ u16 dsp_read_accelerator()
switch (g_dsp.ifx_regs[DSP_FORMAT])
{
case 0x00: // ADPCM audio
if ((EndAddress & 15) == 0)
switch (EndAddress & 15)
{
case 0: // Tom and Jerry
step_size_bytes = 1;
else
break;
case 1: // Blazing Angels
step_size_bytes = 0;
break;
default:
step_size_bytes = 2;
break;
}
val = ADPCM_Step(Address);
break;
case 0x0A: // 16-bit PCM audio

View File

@ -152,10 +152,18 @@ u16 AcceleratorGetSample()
*acc_cur_addr += 2;
}
if ((acc_end_addr & 15) == 0)
switch (acc_end_addr & 15)
{
case 0: // Tom and Jerry
step_size_bytes = 1;
else
break;
case 1: // Blazing Angels
step_size_bytes = 0;
break;
default:
step_size_bytes = 2;
break;
}
int scale = 1 << (acc_pb->adpcm.pred_scale & 0xF);
int coef_idx = (acc_pb->adpcm.pred_scale >> 4) & 0x7;