NES: enable duty and'ing on properNoiseLayout

This commit is contained in:
tildearrow 2022-02-07 00:49:01 -05:00
parent 76beedae0c
commit 1bb81394aa
2 changed files with 8 additions and 2 deletions

View File

@ -307,7 +307,7 @@ int DivPlatformGB::dispatch(DivCommand c) {
chan[c.chan].freqChanged=true;
chan[c.chan].note=c.value;
break;
case DIV_CMD_PRE_PORTA: // aaaaaaaa
case DIV_CMD_PRE_PORTA:
if (chan[c.chan].active) {
chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));
}

View File

@ -139,7 +139,13 @@ void DivPlatformNES::tick() {
}
if (chan[i].std.hadDuty) {
chan[i].duty=chan[i].std.duty;
if (i==3 && chan[i].duty>1) chan[i].duty=1;
if (i==3) {
if (parent->song.properNoiseLayout) {
chan[i].duty&=1;
} else if (chan[i].duty>1) {
chan[i].duty=1;
}
}
if (i!=2) {
rWrite(0x4000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
}