Genesis/Neo Geo ext.: fix possible TL bug

This commit is contained in:
tildearrow 2022-02-03 16:17:30 -05:00
parent c682c921a1
commit 4dd935bbcc
2 changed files with 4 additions and 10 deletions

View File

@ -30,15 +30,12 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
unsigned short baseAddr=chanOffs[2]|opOffs[ordch];
DivInstrumentFM::Operator& op=chan[2].state.op[ordch];
// TODO: how does this work?!
if (isOpMuted[ch]) {
rWrite(baseAddr+0x40,127);
} else if (isOutput[chan[2].state.alg][ordch]) {
if (!opChan[ch].active || opChan[ch].insChanged) {
rWrite(baseAddr+0x40,127-(((127-op.tl)*(opChan[ch].vol&0x7f))/127));
}
} else {
if (opChan[ch].insChanged) {
rWrite(baseAddr+0x40,op.tl);
rWrite(baseAddr+0x40,127-(((127-op.tl)*(opChan[ch].vol&0x7f))/127));
}
}
if (opChan[ch].insChanged) {

View File

@ -20,15 +20,12 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) {
unsigned short baseAddr=chanOffs[1]|opOffs[ordch];
DivInstrumentFM::Operator op=ins->fm.op[ordch];
// TODO: how does this work?!
if (isOpMuted[ch]) {
rWrite(baseAddr+0x40,127);
} else if (isOutput[ins->fm.alg][ordch]) {
if (!opChan[ch].active || opChan[ch].insChanged) {
rWrite(baseAddr+0x40,127-(((127-op.tl)*(opChan[ch].vol&0x7f))/127));
}
} else {
if (opChan[ch].insChanged) {
rWrite(baseAddr+0x40,op.tl);
rWrite(baseAddr+0x40,127-(((127-op.tl)*(opChan[ch].vol&0x7f))/127));
}
}
if (opChan[ch].insChanged) {