anti-click
This commit is contained in:
parent
6c5e806fb2
commit
0cb36206c4
|
@ -72,7 +72,9 @@ void DivPlatformSM8521::updateWave(int ch) {
|
||||||
int nibble2=15-chan[ch].ws.output[((1+(i<<1))+chan[ch].antiClickWavePos-1)&31];
|
int nibble2=15-chan[ch].ws.output[((1+(i<<1))+chan[ch].antiClickWavePos-1)&31];
|
||||||
rWrite(0x60+i+(ch*16),(nibble2<<4)|nibble1);
|
rWrite(0x60+i+(ch*16),(nibble2<<4)|nibble1);
|
||||||
}
|
}
|
||||||
rWrite(0x40,temp|(1<<ch));
|
if (chan[ch].active) {
|
||||||
|
rWrite(0x40,temp|(1<<ch));
|
||||||
|
}
|
||||||
chan[ch].antiClickWavePos&=31;
|
chan[ch].antiClickWavePos&=31;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,6 +127,10 @@ void DivPlatformSM8521::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
}
|
}
|
||||||
|
if (chan[i].std.phaseReset.had && chan[i].std.phaseReset.val==1) {
|
||||||
|
chan[i].antiClickWavePos=0;
|
||||||
|
chan[i].antiClickPeriodCount=0;
|
||||||
|
}
|
||||||
if (chan[i].active) {
|
if (chan[i].active) {
|
||||||
if (chan[i].ws.tick() || (chan[i].std.phaseReset.had && chan[i].std.phaseReset.val==1)) {
|
if (chan[i].ws.tick() || (chan[i].std.phaseReset.had && chan[i].std.phaseReset.val==1)) {
|
||||||
updateWave(i);
|
updateWave(i);
|
||||||
|
@ -343,6 +349,7 @@ void DivPlatformSM8521::notifyInsDeletion(void* ins) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivPlatformSM8521::setFlags(const DivConfig& flags) {
|
void DivPlatformSM8521::setFlags(const DivConfig& flags) {
|
||||||
|
antiClickEnabled=!flags.getBool("noAntiClick",false);
|
||||||
chipClock=10000000;
|
chipClock=10000000;
|
||||||
CHECK_CUSTOM_CLOCK;
|
CHECK_CUSTOM_CLOCK;
|
||||||
rate=chipClock/4;
|
rate=chipClock/4;
|
||||||
|
|
Loading…
Reference in a new issue