comparison ym2612.c @ 738:8972378e314f

Fix register to operator mapping for channel 3 special mode
author Michael Pavone <pavone@retrodev.com>
date Tue, 26 May 2015 22:22:30 -0700
parents 55b550fe8891
children 2317bdca03b4
comparison
equal deleted inserted replaced
737:043393b79e28 738:8972378e314f
583 //printf("ym_update_phase_inc | channel: %d, op: %d\n", chan_num, op); 583 //printf("ym_update_phase_inc | channel: %d, op: %d\n", chan_num, op);
584 //base frequency 584 //base frequency
585 ym_channel * channel = context->channels + chan_num; 585 ym_channel * channel = context->channels + chan_num;
586 uint32_t inc, detune; 586 uint32_t inc, detune;
587 if (chan_num == 2 && context->ch3_mode && (op < (2*4 + 3))) { 587 if (chan_num == 2 && context->ch3_mode && (op < (2*4 + 3))) {
588 inc = context->ch3_supp[op-2*4].fnum; 588 //supplemental fnum registers are in a different order than normal slot paramters
589 if (!context->ch3_supp[op-2*4].block) { 589 int index = (op-2*4) ^ 2;
590 inc = context->ch3_supp[index].fnum;
591 if (!context->ch3_supp[index].block) {
590 inc >>= 1; 592 inc >>= 1;
591 } else { 593 } else {
592 inc <<= (context->ch3_supp[op-2*4].block-1); 594 inc <<= (context->ch3_supp[index].block-1);
593 } 595 }
594 //detune 596 //detune
595 detune = detune_table[context->ch3_supp[op-2*4].keycode][operator->detune & 0x3]; 597 detune = detune_table[context->ch3_supp[index].keycode][operator->detune & 0x3];
596 } else { 598 } else {
597 inc = channel->fnum; 599 inc = channel->fnum;
598 if (!channel->block) { 600 if (!channel->block) {
599 inc >>= 1; 601 inc >>= 1;
600 } else { 602 } else {