OPN/2/A/B: implement new op enable

This commit is contained in:
tildearrow 2023-02-09 17:36:33 -05:00
parent 932963af34
commit 00b329b896
12 changed files with 243 additions and 116 deletions

View file

@ -40,7 +40,7 @@ void DivPlatformYM2608Ext::commitStateExt(int ch, DivInstrument* ins) {
unsigned short baseAddr=chanOffs[2]|opOffs[ordch];
DivInstrumentFM::Operator& op=chan[2].state.op[ordch];
// TODO: how does this work?!
if (isOpMuted[ch]) {
if (isOpMuted[ch] || !op.enable) {
rWrite(baseAddr+0x40,127);
} else {
if (opChan[ch].insChanged) {
@ -125,7 +125,7 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) {
}
unsigned short baseAddr=chanOffs[2]|opOffs[ordch];
DivInstrumentFM::Operator& op=chan[2].state.op[ordch];
if (isOpMuted[ch]) {
if (isOpMuted[ch] || !op.enable) {
rWrite(baseAddr+0x40,127);
} else {
rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127));
@ -225,7 +225,7 @@ int DivPlatformYM2608Ext::dispatch(DivCommand c) {
unsigned short baseAddr=chanOffs[2]|opOffs[orderedOps[c.value]];
DivInstrumentFM::Operator& op=chan[2].state.op[orderedOps[c.value]];
op.tl=c.value2;
if (isOpMuted[ch]) {
if (isOpMuted[ch] || !op.enable) {
rWrite(baseAddr+0x40,127);
} else if (KVS(2,c.value)) {
rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[ch].outVol&0x7f,127));
@ -562,7 +562,7 @@ void DivPlatformYM2608Ext::muteChannel(int ch, bool mute) {
int ordch=orderedOps[ch-2];
unsigned short baseAddr=chanOffs[2]|opOffs[ordch];
DivInstrumentFM::Operator op=chan[2].state.op[ordch];
if (isOpMuted[ch-2]) {
if (isOpMuted[ch-2] || !op.enable) {
rWrite(baseAddr+0x40,127);
immWrite(baseAddr+0x40,127);
} else if (KVS(2,ordch)) {
@ -582,7 +582,7 @@ void DivPlatformYM2608Ext::forceIns() {
unsigned short baseAddr=chanOffs[i]|opOffs[j];
DivInstrumentFM::Operator& op=chan[i].state.op[j];
if (i==2 && extMode) { // extended channel
if (isOpMuted[orderedOps[j]]) {
if (isOpMuted[orderedOps[j]] || !op.enable) {
rWrite(baseAddr+0x40,127);
} else if (KVS(i,j)) {
rWrite(baseAddr+0x40,127-VOL_SCALE_LOG_BROKEN(127-op.tl,opChan[orderedOps[j]].outVol&0x7f,127));
@ -590,7 +590,7 @@ void DivPlatformYM2608Ext::forceIns() {
rWrite(baseAddr+0x40,op.tl);
}
} else {
if (isMuted[i]) {
if (isMuted[i] || !op.enable) {
rWrite(baseAddr+ADDR_TL,127);
} else {
if (KVS(i,j)) {