YM2612: more DualPCM muting fixes

This commit is contained in:
tildearrow 2022-06-04 01:00:29 -05:00
parent 641648ca0f
commit a550c4cb30
1 changed files with 15 additions and 11 deletions

View File

@ -24,7 +24,7 @@
#include "genesisshared.h"
#define IS_REALLY_MUTED(x) (isMuted[x] && (x<5 || !softPCM || (isMuted[5] && isMuted[6]) || !chan[5].dacMode))
#define IS_REALLY_MUTED(x) (isMuted[x] && (x<5 || !softPCM || (isMuted[5] && isMuted[6])))
static unsigned char konOffs[6]={
0, 1, 2, 4, 5, 6
@ -563,7 +563,8 @@ void DivPlatformGenesis::tick(bool sysTick) {
void DivPlatformGenesis::muteChannel(int ch, bool mute) {
isMuted[ch]=mute;
if (ch>5) return;
if (ch>6) return;
if (ch<6) {
for (int j=0; j<4; j++) {
unsigned short baseAddr=chanOffs[ch]|opOffs[j];
DivInstrumentFM::Operator& op=chan[ch].state.op[j];
@ -577,6 +578,9 @@ void DivPlatformGenesis::muteChannel(int ch, bool mute) {
}
}
}
} else {
ch--;
}
rWrite(chanOffs[ch]+ADDR_LRAF,(IS_REALLY_MUTED(ch)?0:(chan[ch].pan<<6))|(chan[ch].state.fms&7)|((chan[ch].state.ams&3)<<4));
}