mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
YM2612: more DualPCM muting fixes
This commit is contained in:
parent
641648ca0f
commit
a550c4cb30
1 changed files with 15 additions and 11 deletions
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
#include "genesisshared.h"
|
#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]={
|
static unsigned char konOffs[6]={
|
||||||
0, 1, 2, 4, 5, 6
|
0, 1, 2, 4, 5, 6
|
||||||
|
@ -563,19 +563,23 @@ void DivPlatformGenesis::tick(bool sysTick) {
|
||||||
|
|
||||||
void DivPlatformGenesis::muteChannel(int ch, bool mute) {
|
void DivPlatformGenesis::muteChannel(int ch, bool mute) {
|
||||||
isMuted[ch]=mute;
|
isMuted[ch]=mute;
|
||||||
if (ch>5) return;
|
if (ch>6) return;
|
||||||
for (int j=0; j<4; j++) {
|
if (ch<6) {
|
||||||
unsigned short baseAddr=chanOffs[ch]|opOffs[j];
|
for (int j=0; j<4; j++) {
|
||||||
DivInstrumentFM::Operator& op=chan[ch].state.op[j];
|
unsigned short baseAddr=chanOffs[ch]|opOffs[j];
|
||||||
if (isMuted[ch]) {
|
DivInstrumentFM::Operator& op=chan[ch].state.op[j];
|
||||||
rWrite(baseAddr+ADDR_TL,127);
|
if (isMuted[ch]) {
|
||||||
} else {
|
rWrite(baseAddr+ADDR_TL,127);
|
||||||
if (isOutput[chan[ch].state.alg][j]) {
|
|
||||||
rWrite(baseAddr+ADDR_TL,127-VOL_SCALE_LOG(127-op.tl,chan[ch].outVol&0x7f,127));
|
|
||||||
} else {
|
} else {
|
||||||
rWrite(baseAddr+ADDR_TL,op.tl);
|
if (isOutput[chan[ch].state.alg][j]) {
|
||||||
|
rWrite(baseAddr+ADDR_TL,127-VOL_SCALE_LOG(127-op.tl,chan[ch].outVol&0x7f,127));
|
||||||
|
} else {
|
||||||
|
rWrite(baseAddr+ADDR_TL,op.tl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} 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));
|
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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue