C219: don't phase reset if duty macro hasn't chang

ed
This commit is contained in:
tildearrow 2023-09-11 02:57:24 -05:00
parent f0255f30e8
commit 4777284a7c

View file

@ -152,11 +152,18 @@ void DivPlatformC140::tick(bool sysTick) {
}
if (is219) {
if (chan[i].std.duty.had) {
chan[i].noise=chan[i].std.duty.val&1;
chan[i].invert=chan[i].std.duty.val&2;
chan[i].surround=chan[i].std.duty.val&4;
chan[i].freqChanged=true;
chan[i].writeCtrl=true;
unsigned char singleByte=(
(chan[i].noise?1:0)|
(chan[i].invert?2:0)|
(chan[i].surround?4:0)
);
if (singleByte!=(chan[i].std.duty.val&7)) {
chan[i].noise=chan[i].std.duty.val&1;
chan[i].invert=chan[i].std.duty.val&2;
chan[i].surround=chan[i].std.duty.val&4;
chan[i].freqChanged=true;
chan[i].writeCtrl=true;
}
}
}
if (chan[i].std.pitch.had) {