AY: fix wave macro and effect

This commit is contained in:
tildearrow 2022-01-18 15:48:40 -05:00
parent a148a04e2c
commit 05fd372728
3 changed files with 34 additions and 6 deletions

View file

@ -71,8 +71,12 @@ void DivPlatformYM2610::tick() {
rWrite(0x06,31-chan[i].std.duty);
}
if (chan[i].std.hadWave) {
chan[i].psgMode&=4;
chan[i].psgMode|=(chan[i].std.wave+1)&3;
chan[i].psgMode=(chan[i].std.wave+1)&7;
if (isMuted[i]) {
rWrite(0x04+i,0);
} else {
rWrite(0x04+i,(chan[i].outVol&15)|((chan[i].psgMode&4)<<2));
}
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true);
@ -450,7 +454,13 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
break;
}
case DIV_CMD_STD_NOISE_MODE:
if (c.chan<4 || c.chan>6) break;
chan[c.chan].psgMode=(c.value+1)&7;
if (isMuted[c.chan]) {
rWrite(0x04+c.chan,0);
} else if (chan[c.chan].active) {
rWrite(0x04+c.chan,(chan[c.chan].outVol&15)|((chan[c.chan].psgMode&4)<<2));
}
break;
case DIV_CMD_STD_NOISE_FREQ:
if (c.chan<4 || c.chan>6) break;