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 (isMuted[i]) chan[i].keyOn=false;
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;
} 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) {
rWrite(i,0x3f);

View File

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