Y8950: fix mute when using ymfm

This commit is contained in:
tildearrow 2024-06-16 15:46:27 -05:00
parent b842ce0fe2
commit 0fd86f33c0

View file

@ -1039,7 +1039,7 @@ void DivPlatformOPL::tick(bool sysTick) {
if (chan[adpcmChan].std.vol.had) {
chan[adpcmChan].outVol=(chan[adpcmChan].vol*MIN(chan[adpcmChan].macroVolMul,chan[adpcmChan].std.vol.val))/chan[adpcmChan].macroVolMul;
immWrite(18,chan[adpcmChan].outVol);
immWrite(18,(isMuted[adpcmChan]?0:chan[adpcmChan].outVol));
}
if (NEW_ARP_STRAT) {
@ -1217,7 +1217,10 @@ int DivPlatformOPL::toFreq(int freq) {
void DivPlatformOPL::muteChannel(int ch, bool mute) {
isMuted[ch]=mute;
if (ch==adpcmChan) return;
if (ch==adpcmChan) {
immWrite(18,(isMuted[adpcmChan]?0:chan[adpcmChan].outVol));
return;
}
if (oplType<3 && ch<melodicChans) {
fm.channel[outChanMap[ch]].muted=mute;
}
@ -1380,7 +1383,7 @@ int DivPlatformOPL::dispatch(DivCommand c) {
chan[c.chan].fixedFreq=0;
if (!chan[c.chan].std.vol.will) {
chan[c.chan].outVol=chan[c.chan].vol;
immWrite(18,chan[c.chan].outVol);
immWrite(18,(isMuted[adpcmChan]?0:chan[adpcmChan].outVol));
}
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].sample=ins->amiga.getSample(c.value);
@ -1511,7 +1514,7 @@ int DivPlatformOPL::dispatch(DivCommand c) {
chan[c.chan].outVol=c.value;
}
if (c.chan==adpcmChan) { // ADPCM-B
immWrite(18,chan[c.chan].outVol);
immWrite(18,(isMuted[adpcmChan]?0:chan[adpcmChan].outVol));
break;
}
int ops=(slots[3][c.chan]!=255 && chan[c.chan].state.ops==4 && oplType==3)?4:2;
@ -2243,7 +2246,7 @@ void DivPlatformOPL::reset() {
adpcmB->reset();
// volume
immWrite(18,0xff);
immWrite(18,(isMuted[adpcmChan]?0:0xff));
// ADPCM limit
immWrite(20,0xff);
immWrite(19,0xff);