summaryrefslogtreecommitdiff
path: root/ym2612.c
diff options
context:
space:
mode:
authorMike Pavone <pavone@retrodev.com>2013-06-05 19:26:02 -0700
committerMike Pavone <pavone@retrodev.com>2013-06-05 19:26:02 -0700
commitdc31c21e66171750d6467ca62ecf3c1dfe09e58c (patch)
treef4b4289e14d87ec73c3baafba1b59e2345b84840 /ym2612.c
parent5e2f5b815359f449ceaca6d7a68e449cb709d82d (diff)
Fix channel mapping in key on/off register
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;