Skip to content

Commit

Permalink
YM2612: fix ExtCh muting
Browse files Browse the repository at this point in the history
issue #1366
  • Loading branch information
tildearrow committed Aug 17, 2023
1 parent edad084 commit 0aabfe5
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/engine/platform/genesisext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 0aabfe5

Please sign in to comment.