mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
Fix 12-bit wrapping behavior in YM2608/2610 ADPCM_A decoding, fixes some glitches in certain samples in the metal slug series, and likely other games. [Lord Nightmare, madbr]
This commit is contained in:
parent
b7a49aff4a
commit
f746588771
@ -2499,11 +2499,12 @@ struct ym2610_state
|
|||||||
|
|
||||||
ch->adpcm_acc += jedi_table[ch->adpcm_step + data];
|
ch->adpcm_acc += jedi_table[ch->adpcm_step + data];
|
||||||
|
|
||||||
|
/* the 12-bit accumulator wraps on the ym2610 and ym2608 (like the msm5205), it does not saturate (like the msm5218) */
|
||||||
|
ch->adpcm_acc &= 0xfff;
|
||||||
|
|
||||||
/* extend 12-bit signed int */
|
/* extend 12-bit signed int */
|
||||||
if (ch->adpcm_acc & ~0x7ff)
|
if (ch->adpcm_acc & 0x800)
|
||||||
ch->adpcm_acc |= ~0xfff;
|
ch->adpcm_acc |= ~0xfff;
|
||||||
else
|
|
||||||
ch->adpcm_acc &= 0xfff;
|
|
||||||
|
|
||||||
ch->adpcm_step += step_inc[data & 7];
|
ch->adpcm_step += step_inc[data & 7];
|
||||||
Limit( ch->adpcm_step, 48*16, 0*16 );
|
Limit( ch->adpcm_step, 48*16, 0*16 );
|
||||||
|
Loading…
Reference in New Issue
Block a user