move lastCenterRate=-1 from constructor to reset(), set lastCenterRate even if OOB
This commit is contained in:
parent
69363b4db9
commit
2938a9b8af
|
@ -144,6 +144,7 @@ void DivPlatformVERA::reset() {
|
|||
}
|
||||
chan[16].vol=15;
|
||||
chan[16].pan=3;
|
||||
lastCenterRate=-1;
|
||||
}
|
||||
|
||||
int DivPlatformVERA::calcNoteFreq(int ch, int note) {
|
||||
|
@ -226,9 +227,9 @@ void DivPlatformVERA::tick(bool sysTick) {
|
|||
double off=65536.0;
|
||||
if (chan[16].pcm.sample>=0 && chan[16].pcm.sample<parent->song.sampleLen) {
|
||||
DivSample* s=parent->getSample(chan[16].pcm.sample);
|
||||
lastCenterRate=s->centerRate;
|
||||
if (s->centerRate>=1) {
|
||||
off=65536.0*(s->centerRate/8363.0);
|
||||
lastCenterRate=s->centerRate;
|
||||
}
|
||||
} else if (lastCenterRate>=1) {
|
||||
off=65536.0*(lastCenterRate/8363.0);
|
||||
|
@ -530,7 +531,6 @@ int DivPlatformVERA::init(DivEngine* p, int channels, int sugRate, const DivConf
|
|||
pcm=new struct VERA_PCM;
|
||||
dumpWrites=false;
|
||||
skipRegisterWrites=false;
|
||||
lastCenterRate=-1;
|
||||
setFlags(flags);
|
||||
reset();
|
||||
return 17;
|
||||
|
|
Loading…
Reference in a new issue