Fix muting

This commit is contained in:
cam900 2023-04-11 13:11:54 +09:00
parent f66b703a81
commit fe0ba4e530
2 changed files with 5 additions and 3 deletions

View file

@ -78,10 +78,10 @@ void DivPlatformPV1000::tick(bool sysTick) {
if (chan[i].freq>62) chan[i].freq=62; if (chan[i].freq>62) chan[i].freq=62;
if (isMuted[i]) chan[i].keyOn=false; if (isMuted[i]) chan[i].keyOn=false;
if (chan[i].keyOn) { if (chan[i].keyOn) {
rWrite(i,(isMuted[i] || (chan[i].outVol<=0)) ? 0 : chan[i].freq); rWrite(i,(isMuted[i] || (chan[i].outVol<=0)) ? 0x3f : chan[i].freq);
chan[i].keyOn=false; chan[i].keyOn=false;
} else if (chan[i].freqChanged && chan[i].active && !isMuted[i]) { } else if (chan[i].freqChanged && chan[i].active && !isMuted[i]) {
rWrite(i,(isMuted[i] || (chan[i].outVol<=0)) ? 0 : chan[i].freq); rWrite(i,(isMuted[i] || (chan[i].outVol<=0)) ? 0x3f : chan[i].freq);
} }
if (chan[i].keyOff) { if (chan[i].keyOff) {
rWrite(i,0x3f); rWrite(i,0x3f);

View file

@ -138,7 +138,8 @@ void d65010g031_write(struct d65010g031_t *d65010g031, const unsigned char a, co
d65010g031->ctrl = d; d65010g031->ctrl = d;
break; break;
default: default:
unsigned char per = (unsigned char)(~d) & 0x3f; {
const unsigned char per = (unsigned char)(~d) & 0x3f;
if ((per == 0) && (d65010g031->square[a].period != 0)) if ((per == 0) && (d65010g031->square[a].period != 0))
{ {
d65010g031->square[a].out ^= 1; d65010g031->square[a].out ^= 1;
@ -147,3 +148,4 @@ void d65010g031_write(struct d65010g031_t *d65010g031, const unsigned char a, co
break; break;
} }
} }
}