summaryrefslogtreecommitdiff
path: root/ym2612.c
diff options
context:
space:
mode:
Diffstat (limited to 'ym2612.c')
-rw-r--r--ym2612.c5
1 files changed, 4 insertions, 1 deletions
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;