new chan osc, part 4

adapt dispatch code to it
This commit is contained in:
tildearrow 2025-03-01 19:49:56 -05:00
parent c0e4552c52
commit a16d20e190
18 changed files with 218 additions and 88 deletions

View file

@ -40,6 +40,9 @@
void DivPlatformESFM::acquire(short** buf, size_t len) {
thread_local short o[2];
for (int i=0; i<18; i++) {
oscBuf[i]->begin(len);
}
for (size_t h=0; h<len; h++) {
if (!writes.empty()) {
QueuedWrite& w=writes.front();
@ -52,12 +55,15 @@ void DivPlatformESFM::acquire(short** buf, size_t len) {
ESFM_generate(&chip,o);
for (int c=0; c<18; c++) {
oscBuf[c]->data[oscBuf[c]->needle++]=ESFM_get_channel_output_native(&chip,c);
oscBuf[c]->putSample(h,ESFM_get_channel_output_native(&chip,c));
}
buf[0][h]=o[0];
buf[1][h]=o[1];
}
for (int i=0; i<18; i++) {
oscBuf[i]->end(len);
}
}
void DivPlatformESFM::tick(bool sysTick) {
@ -1068,6 +1074,9 @@ void DivPlatformESFM::poke(std::vector<DivRegWrite>& wlist) {
void DivPlatformESFM::setFlags(const DivConfig& flags) {
chipClock=COLOR_NTSC*4.0;
rate=chipClock/288.0;
for (int i=0; i<18; i++) {
oscBuf[i]->setRate(rate);
}
}
void DivPlatformESFM::setFast(bool fast) {