VERA/ZSM: remember last sample played so that async pitch changes work on ZSM export

This commit is contained in:
MooingLemur 2023-12-05 22:28:36 -07:00 committed by tildearrow
parent 52e0c7f430
commit b83cc98eb1
2 changed files with 7 additions and 0 deletions

View file

@ -230,7 +230,12 @@ void DivPlatformVERA::tick(bool sysTick) {
off=65536.0;
} else {
off=65536.0*(s->centerRate/8363.0);
lastCenterRate=s->centerRate;
}
} else if (lastCenterRate<1) {
off=65536.0;
} else {
off=65536.0*(lastCenterRate/8363.0);
}
chan[16].freq=parent->calcFreq(chan[16].baseFreq,chan[16].pitch,chan[16].fixedArp?chan[16].baseNoteOverride:chan[16].arpOff,chan[16].fixedArp,false,8,chan[16].pitch2,chipClock,off);
if (chan[16].freq>128) chan[16].freq=128;
@ -529,6 +534,7 @@ 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;

View file

@ -54,6 +54,7 @@ class DivPlatformVERA: public DivDispatch {
unsigned char regPool[69];
struct VERA_PSG* psg;
struct VERA_PCM* pcm;
int lastCenterRate;
int calcNoteFreq(int ch, int note);
friend void putDispatchChip(void*,int);