diff options
author | Mike Pavone <pavone@retrodev.com> | 2013-06-05 19:26:02 -0700 |
---|---|---|
committer | Mike Pavone <pavone@retrodev.com> | 2013-06-05 19:26:02 -0700 |
commit | dc31c21e66171750d6467ca62ecf3c1dfe09e58c (patch) | |
tree | f4b4289e14d87ec73c3baafba1b59e2345b84840 | |
parent | 5e2f5b815359f449ceaca6d7a68e449cb709d82d (diff) |
Fix channel mapping in key on/off register
-rw-r--r-- | ym2612.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -527,7 +527,10 @@ void ym_data_write(ym2612_context * context, uint8_t value) } case REG_KEY_ONOFF: { uint8_t channel = value & 0x7; - if (channel < NUM_CHANNELS) { + if (channel != 3 && channel != 7) { + if (channel > 2) { + channel--; + } for (uint8_t op = channel * 4, bit = 0x10; op < (channel + 1) * 4; op++, bit <<= 1) { if (value & bit) { first_key_on = 1; |