POKEY: optimize ASAP core a lot

This commit is contained in:
tildearrow 2022-12-22 19:45:08 -05:00
parent 42367a5601
commit 84c4e48fbe

View file

@ -101,7 +101,7 @@ void DivPlatformPOKEY::acquireASAP(short* buf, size_t start, size_t len) {
} }
for (size_t h=start; h<start+len; h++) { for (size_t h=start; h<start+len; h++) {
if (++oscBufDelay>=14) { if (++oscBufDelay>=2) {
oscBufDelay=0; oscBufDelay=0;
buf[h]=altASAP->sampleAudio(oscBuf); buf[h]=altASAP->sampleAudio(oscBuf);
} else { } else {
@ -448,16 +448,21 @@ void DivPlatformPOKEY::setFlags(const DivConfig& flags) {
chipClock=COLOR_NTSC/2.0; chipClock=COLOR_NTSC/2.0;
} }
CHECK_CUSTOM_CLOCK; CHECK_CUSTOM_CLOCK;
rate=chipClock;
for (int i=0; i<4; i++) {
oscBuf[i]->rate=rate/14;
}
if (useAltASAP) { if (useAltASAP) {
rate=chipClock/7;
for (int i=0; i<4; i++) {
oscBuf[i]->rate=rate/2;
}
if (altASAP) { if (altASAP) {
delete altASAP; delete altASAP;
} }
altASAP=new AltASAP::Pokey(chipClock, chipClock); altASAP=new AltASAP::Pokey(chipClock,rate);
} else {
rate=chipClock;
for (int i=0; i<4; i++) {
oscBuf[i]->rate=rate/14;
}
} }
} }