YM2612: fix ExtCh muting

issue #1366
This commit is contained in:
tildearrow 2023-08-17 16:37:27 -05:00
parent edad084e5d
commit 0aabfe52d8

View file

@ -443,13 +443,15 @@ void DivPlatformGenesisExt::muteChannel(int ch, bool mute) {
DivPlatformGenesis::muteChannel(extChanOffs,IS_EXTCH_MUTED);
if (extMode) {
int ordch=orderedOps[ch-2];
unsigned short baseAddr=chanOffs[2]|opOffs[ordch];
DivInstrumentFM::Operator op=chan[2].state.op[ordch];
if (isOpMuted[ch-2] || !op.enable) {
rWrite(baseAddr+0x40,127);
} else {
rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch-2].outVol&0x7f,127));
for (int i=0; i<4; i++) {
int ordch=orderedOps[i];
unsigned short baseAddr=chanOffs[2]|opOffs[ordch];
DivInstrumentFM::Operator op=chan[2].state.op[ordch];
if (isOpMuted[i] || !op.enable) {
rWrite(baseAddr+0x40,127);
} else {
rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[i].outVol&0x7f,127));
}
}
rWrite(chanOffs[2]+0xb4,(IS_EXTCH_MUTED?0:(opChan[ch-2].pan<<6))|(chan[2].state.fms&7)|((chan[2].state.ams&3)<<4));