dev136 - Merge branch 'newDispatch' (PLEASE READ!)

the following changes have been made:
- a different strategy for DivDispatch audio output.
  - if you're working on a new chip, be sure to replace isStereo()
    with getOutputCount(). if isStereo() was true, return 2; otherwise
    1.
    do not return 0 or you will melt the oven!
  - additionally, the acquire() function has changed. it's now:
    `acquire(short** buf, size_t len)`
    replace bufL with buf[0] and bufR with buf[1].
    `start` is gone. if you really needed to use it, take a look at
    pcspkr.
    if you write to buf[1] and getOutputCount is 1, the oven will
    melt as well!
- support for more-than-stereo audio, with up to 16 outputs.
- a brand-new patchbay routing feature. arbitrarily route chip outputs
  to system outputs.
This commit is contained in:
tildearrow 2023-01-12 03:59:53 -05:00
commit 9b80af3a4e
130 changed files with 2818 additions and 1721 deletions

View file

@ -64,16 +64,16 @@ const char** DivPlatformPOKEY::getRegisterSheet() {
return regCheatSheetPOKEY;
}
void DivPlatformPOKEY::acquire(short* bufL, short* bufR, size_t start, size_t len) {
void DivPlatformPOKEY::acquire(short** buf, size_t len) {
if (useAltASAP) {
acquireASAP(bufL, start, len);
acquireASAP(buf[0],len);
} else {
acquireMZ(bufL, start, len);
acquireMZ(buf[0],len);
}
}
void DivPlatformPOKEY::acquireMZ(short* buf, size_t start, size_t len) {
for (size_t h=start; h<start+len; h++) {
void DivPlatformPOKEY::acquireMZ(short* buf, size_t len) {
for (size_t h=0; h<len; h++) {
while (!writes.empty()) {
QueuedWrite w=writes.front();
Update_pokey_sound_mz(&pokey,w.addr,w.val,0);
@ -93,14 +93,14 @@ void DivPlatformPOKEY::acquireMZ(short* buf, size_t start, size_t len) {
}
}
void DivPlatformPOKEY::acquireASAP(short* buf, size_t start, size_t len) {
void DivPlatformPOKEY::acquireASAP(short* buf, size_t len) {
while (!writes.empty()) {
QueuedWrite w=writes.front();
altASAP.write(w.addr, w.val);
writes.pop();
}
for (size_t h=start; h<start+len; h++) {
for (size_t h=0; h<len; h++) {
if (++oscBufDelay>=2) {
oscBufDelay=0;
buf[h]=altASAP.sampleAudio(oscBuf);