uninitialized variables? oh my!

This commit is contained in:
tildearrow 2021-12-08 01:31:35 -05:00
parent 4eec990ec1
commit fe5f8afa05
3 changed files with 6 additions and 2 deletions

View file

@ -145,8 +145,10 @@ void DivPlatformNES::tick() {
if ((chan[i].prevFreq>>8)!=(chan[i].freq>>8) || i==2) { if ((chan[i].prevFreq>>8)!=(chan[i].freq>>8) || i==2) {
apu_wr_reg(0x4003+i*4,0xf8|(chan[i].freq>>8)); apu_wr_reg(0x4003+i*4,0xf8|(chan[i].freq>>8));
} }
if (chan[i].freq!=65535 && chan[i].freq!=0) {
chan[i].prevFreq=chan[i].freq; chan[i].prevFreq=chan[i].freq;
} }
}
if (chan[i].keyOn) chan[i].keyOn=false; if (chan[i].keyOn) chan[i].keyOn=false;
if (chan[i].keyOff) chan[i].keyOff=false; if (chan[i].keyOff) chan[i].keyOff=false;
chan[i].freqChanged=false; chan[i].freqChanged=false;

View file

@ -28,6 +28,7 @@ class DivPlatformNES: public DivDispatch {
keyOff(false), keyOff(false),
inPorta(false), inPorta(false),
vol(15), vol(15),
outVol(15),
wave(-1) {} wave(-1) {}
}; };
Channel chan[5]; Channel chan[5];

View file

@ -23,7 +23,8 @@ class DivPlatformSMS: public DivDispatch {
freqChanged(false), freqChanged(false),
keyOn(false), keyOn(false),
keyOff(false), keyOff(false),
vol(15) {} vol(15),
outVol(15) {}
}; };
Channel chan[4]; Channel chan[4];
unsigned char snNoiseMode; unsigned char snNoiseMode;