From dc31c21e66171750d6467ca62ecf3c1dfe09e58c Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Wed, 5 Jun 2013 19:26:02 -0700 Subject: Fix channel mapping in key on/off register --- ym2612.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ym2612.c') diff --git a/ym2612.c b/ym2612.c index f86d01a..cebd659 100644 --- a/ym2612.c +++ b/ym2612.c @@ -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; -- cgit v1.2.3