VERA: fix custom clock

This commit is contained in:
tildearrow 2023-07-02 00:26:57 -05:00
parent f67faf9f23
commit 72ed5deeb1
2 changed files with 11 additions and 6 deletions

View file

@ -441,6 +441,15 @@ void DivPlatformVERA::poke(std::vector<DivRegWrite>& wlist) {
for (auto &i: wlist) poke(i.addr,i.val); for (auto &i: wlist) poke(i.addr,i.val);
} }
void DivPlatformVERA::setFlags(const DivConfig& flags) {
chipClock=25000000;
CHECK_CUSTOM_CLOCK;
rate=chipClock/512;
for (int i=0; i<17; i++) {
oscBuf[i]->rate=rate;
}
}
int DivPlatformVERA::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) { int DivPlatformVERA::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
for (int i=0; i<17; i++) { for (int i=0; i<17; i++) {
isMuted[i]=false; isMuted[i]=false;
@ -451,12 +460,7 @@ int DivPlatformVERA::init(DivEngine* p, int channels, int sugRate, const DivConf
pcm=new struct VERA_PCM; pcm=new struct VERA_PCM;
dumpWrites=false; dumpWrites=false;
skipRegisterWrites=false; skipRegisterWrites=false;
chipClock=25000000; setFlags(flags);
CHECK_CUSTOM_CLOCK;
rate=chipClock/512;
for (int i=0; i<17; i++) {
oscBuf[i]->rate=rate;
}
reset(); reset();
return 17; return 17;
} }

View file

@ -70,6 +70,7 @@ class DivPlatformVERA: public DivDispatch {
void reset(); void reset();
void tick(bool sysTick=true); void tick(bool sysTick=true);
void muteChannel(int ch, bool mute); void muteChannel(int ch, bool mute);
void setFlags(const DivConfig& flags);
void notifyInsDeletion(void* ins); void notifyInsDeletion(void* ins);
float getPostAmp(); float getPostAmp();
int getOutputCount(); int getOutputCount();