comparison ym2612.c @ 386:6e5c4f3ab0e2

Fix channel mapping in key on/off register
author Mike Pavone <pavone@retrodev.com>
date Wed, 05 Jun 2013 19:26:02 -0700
parents 72933100c55c
children 09328dbe6700
comparison
equal deleted inserted replaced
385:e45327305bb7 386:6e5c4f3ab0e2
525 } 525 }
526 break; 526 break;
527 } 527 }
528 case REG_KEY_ONOFF: { 528 case REG_KEY_ONOFF: {
529 uint8_t channel = value & 0x7; 529 uint8_t channel = value & 0x7;
530 if (channel < NUM_CHANNELS) { 530 if (channel != 3 && channel != 7) {
531 if (channel > 2) {
532 channel--;
533 }
531 for (uint8_t op = channel * 4, bit = 0x10; op < (channel + 1) * 4; op++, bit <<= 1) { 534 for (uint8_t op = channel * 4, bit = 0x10; op < (channel + 1) * 4; op++, bit <<= 1) {
532 if (value & bit) { 535 if (value & bit) {
533 first_key_on = 1; 536 first_key_on = 1;
534 //printf("Key On for operator %d in channel %d\n", op, channel); 537 //printf("Key On for operator %d in channel %d\n", op, channel);
535 context->operators[op].phase_counter = 0; 538 context->operators[op].phase_counter = 0;