This commit is contained in:
tildearrow 2022-02-13 23:49:01 -05:00
parent 53482105dc
commit bfb902f649
2 changed files with 7 additions and 1 deletions

View file

@ -106,9 +106,12 @@ void DivPlatformSMS::tick() {
} }
if (value<3) { if (value<3) {
value=2-value; value=2-value;
if (value!=oldValue || updateSNMode || resetPhase) {
oldValue=value;
rWrite(0xe0|value|((snNoiseMode&1)<<2)); rWrite(0xe0|value|((snNoiseMode&1)<<2));
} }
} }
}
chan[3].freqChanged=false; chan[3].freqChanged=false;
updateSNMode=false; updateSNMode=false;
} }
@ -240,6 +243,7 @@ void DivPlatformSMS::reset() {
snNoiseMode=3; snNoiseMode=3;
rWrite(0xe7); rWrite(0xe7);
updateSNMode=false; updateSNMode=false;
oldValue=0xff;
} }
bool DivPlatformSMS::keyOffAffectsArp(int ch) { bool DivPlatformSMS::keyOffAffectsArp(int ch) {
@ -304,6 +308,7 @@ int DivPlatformSMS::init(DivEngine* p, int channels, int sugRate, unsigned int f
dumpWrites=false; dumpWrites=false;
skipRegisterWrites=false; skipRegisterWrites=false;
resetPhase=false; resetPhase=false;
oldValue=0xff;
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -30,6 +30,7 @@ class DivPlatformSMS: public DivDispatch {
}; };
Channel chan[4]; Channel chan[4];
bool isMuted[4]; bool isMuted[4];
unsigned char oldValue;
unsigned char snNoiseMode; unsigned char snNoiseMode;
bool updateSNMode; bool updateSNMode;
bool resetPhase; bool resetPhase;