new chan osc, part 4
adapt dispatch code to it
This commit is contained in:
parent
c0e4552c52
commit
a16d20e190
18 changed files with 218 additions and 88 deletions
|
|
@ -54,6 +54,10 @@ const char** DivPlatformArcade::getRegisterSheet() {
|
|||
void DivPlatformArcade::acquire_nuked(short** buf, size_t len) {
|
||||
thread_local int o[2];
|
||||
|
||||
for (int i=0; i<8; i++) {
|
||||
oscBuf[i]->begin(len);
|
||||
}
|
||||
|
||||
for (size_t h=0; h<len; h++) {
|
||||
if (delay>0) delay--;
|
||||
for (int i=0; i<8; i++) {
|
||||
|
|
@ -81,7 +85,7 @@ void DivPlatformArcade::acquire_nuked(short** buf, size_t len) {
|
|||
|
||||
for (int i=0; i<8; i++) {
|
||||
int chOut=(int16_t)fm.ch_out[i];
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(chOut<<1,-32768,32767);
|
||||
oscBuf[i]->putSample(h,CLAMP(chOut<<1,-32768,32767));
|
||||
}
|
||||
|
||||
if (o[0]<-32768) o[0]=-32768;
|
||||
|
|
@ -93,6 +97,10 @@ void DivPlatformArcade::acquire_nuked(short** buf, size_t len) {
|
|||
buf[0][h]=o[0];
|
||||
buf[1][h]=o[1];
|
||||
}
|
||||
|
||||
for (int i=0; i<8; i++) {
|
||||
oscBuf[i]->end(len);
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformArcade::acquire_ymfm(short** buf, size_t len) {
|
||||
|
|
@ -100,6 +108,10 @@ void DivPlatformArcade::acquire_ymfm(short** buf, size_t len) {
|
|||
|
||||
ymfm::ym2151::fm_engine* fme=fm_ymfm->debug_engine();
|
||||
|
||||
for (int i=0; i<8; i++) {
|
||||
oscBuf[i]->begin(len);
|
||||
}
|
||||
|
||||
for (size_t h=0; h<len; h++) {
|
||||
os[0]=0; os[1]=0;
|
||||
if (!writes.empty()) {
|
||||
|
|
@ -121,7 +133,7 @@ void DivPlatformArcade::acquire_ymfm(short** buf, size_t len) {
|
|||
|
||||
for (int i=0; i<8; i++) {
|
||||
int chOut=fme->debug_channel(i)->debug_output(0)+fme->debug_channel(i)->debug_output(1);
|
||||
oscBuf[i]->data[oscBuf[i]->needle++]=CLAMP(chOut,-32768,32767);
|
||||
oscBuf[i]->putSample(h,CLAMP(chOut,-32768,32767));
|
||||
}
|
||||
|
||||
os[0]=out_ymfm.data[0];
|
||||
|
|
@ -135,6 +147,10 @@ void DivPlatformArcade::acquire_ymfm(short** buf, size_t len) {
|
|||
buf[0][h]=os[0];
|
||||
buf[1][h]=os[1];
|
||||
}
|
||||
|
||||
for (int i=0; i<8; i++) {
|
||||
oscBuf[i]->end(len);
|
||||
}
|
||||
}
|
||||
|
||||
void DivPlatformArcade::acquire(short** buf, size_t len) {
|
||||
|
|
@ -964,7 +980,7 @@ void DivPlatformArcade::setFlags(const DivConfig& flags) {
|
|||
|
||||
rate=chipClock/64;
|
||||
for (int i=0; i<8; i++) {
|
||||
oscBuf[i]->rate=rate;
|
||||
oscBuf[i]->setRate(rate);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue