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,6 +152,12 @@ void DivPlatformC140::tick(bool sysTick) {
} }
if (is219) { if (is219) {
if (chan[i].std.duty.had) { if (chan[i].std.duty.had) {
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].noise=chan[i].std.duty.val&1;
chan[i].invert=chan[i].std.duty.val&2; chan[i].invert=chan[i].std.duty.val&2;
chan[i].surround=chan[i].std.duty.val&4; chan[i].surround=chan[i].std.duty.val&4;
@ -159,6 +165,7 @@ void DivPlatformC140::tick(bool sysTick) {
chan[i].writeCtrl=true; chan[i].writeCtrl=true;
} }
} }
}
if (chan[i].std.pitch.had) { if (chan[i].std.pitch.had) {
if (chan[i].std.pitch.mode) { if (chan[i].std.pitch.mode) {
chan[i].pitch2+=chan[i].std.pitch.val; chan[i].pitch2+=chan[i].std.pitch.val;