emu2413: fix muting

This commit is contained in:
tildearrow 2024-04-07 17:00:23 -05:00
parent 707a81346c
commit c527eaa946

View file

@ -390,6 +390,19 @@ int DivPlatformOPLL::toFreq(int freq) {
void DivPlatformOPLL::muteChannel(int ch, bool mute) { void DivPlatformOPLL::muteChannel(int ch, bool mute) {
isMuted[ch]=mute; isMuted[ch]=mute;
if (selCore==1) {
OPLL_setMask(fm_emu,
(isMuted[0]?1:0)|
(isMuted[1]?2:0)|
(isMuted[2]?4:0)|
(isMuted[3]?8:0)|
(isMuted[4]?16:0)|
(isMuted[5]?32:0)|
(isMuted[6]?64:0)|
(isMuted[7]?128:0)|
(isMuted[8]?256:0)
);
}
} }
void DivPlatformOPLL::commitState(int ch, DivInstrument* ins) { void DivPlatformOPLL::commitState(int ch, DivInstrument* ins) {
@ -1043,6 +1056,17 @@ void DivPlatformOPLL::reset() {
OPLL_reset(fm_emu); OPLL_reset(fm_emu);
OPLL_setChipType(fm_emu,vrc7?1:0); OPLL_setChipType(fm_emu,vrc7?1:0);
OPLL_resetPatch(fm_emu,vrc7?1:nukedToEmuPatch[patchSet&3]); OPLL_resetPatch(fm_emu,vrc7?1:nukedToEmuPatch[patchSet&3]);
OPLL_setMask(fm_emu,
(isMuted[0]?1:0)|
(isMuted[1]?2:0)|
(isMuted[2]?4:0)|
(isMuted[3]?8:0)|
(isMuted[4]?16:0)|
(isMuted[5]?32:0)|
(isMuted[6]?64:0)|
(isMuted[7]?128:0)|
(isMuted[8]?256:0)
);
} }
for (int i=0; i<11; i++) { for (int i=0; i<11; i++) {
chan[i]=DivPlatformOPLL::Channel(); chan[i]=DivPlatformOPLL::Channel();