prepare for possible major optimization

by just forwarding an output buffer to the dispatch and begin/length,
the number of calls may be reduced which improves performance.
This commit is contained in:
tildearrow 2021-12-06 05:21:42 -05:00
parent 055b4f9c26
commit 6efcfc2e8a
19 changed files with 178 additions and 132 deletions

View file

@ -7,10 +7,12 @@
#define FREQ_BASE 8015.85f
void DivPlatformGB::acquire(int& l, int& r) {
GB_advance_cycles(gb,16);
l=gb->apu_output.final_sample.left<<2;
r=gb->apu_output.final_sample.right<<2;
void DivPlatformGB::acquire(short** buf, size_t start, size_t len) {
for (int i=start; i<start+len; i++) {
GB_advance_cycles(gb,16);
buf[0][i]=gb->apu_output.final_sample.left<<2;
buf[1][i]=gb->apu_output.final_sample.right<<2;
}
}
void DivPlatformGB::updateWave() {