summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/fm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/fm.cpp')
-rw-r--r--src/devices/sound/fm.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/devices/sound/fm.cpp b/src/devices/sound/fm.cpp
index 8f679e99357..23ea6633674 100644
--- a/src/devices/sound/fm.cpp
+++ b/src/devices/sound/fm.cpp
@@ -2499,11 +2499,12 @@ struct ym2610_state
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 */
- if (ch->adpcm_acc & ~0x7ff)
+ if (ch->adpcm_acc & 0x800)
ch->adpcm_acc |= ~0xfff;
- else
- ch->adpcm_acc &= 0xfff;
ch->adpcm_step += step_inc[data & 7];
Limit( ch->adpcm_step, 48*16, 0*16 );