From 95b1085aed2df6f1bdf86a3f07d823fa0016cbbf Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 3 Mar 2025 17:18:52 -0500 Subject: [PATCH] I have no idea what's going on --- src/engine/dispatch.h | 9 +++++++++ src/engine/dispatchContainer.cpp | 6 +----- src/engine/platform/abstract.cpp | 3 +++ src/engine/platform/amiga.cpp | 4 ++++ src/engine/platform/amiga.h | 1 + 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index e633ac822..8bac742a6 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -658,6 +658,15 @@ class DivDispatch { */ virtual void acquireDirect(blip_buffer_t** bb, size_t off, size_t len); + /** + * post-process a rendered sound buffer. + * @param buf pointers to output buffers. + * @param outIndex the output index. + * @param len the number of samples in the buffer. + * @param sampleRate the current audio output rate (usually 44100 or 48000). + */ + virtual void postProcess(short* buf, int outIndex, size_t len, int sampleRate); + /** * fill a write stream with data (e.g. for software-mixed PCM). * @param stream the write stream. diff --git a/src/engine/dispatchContainer.cpp b/src/engine/dispatchContainer.cpp index 3b85c33f3..827e9c32e 100644 --- a/src/engine/dispatchContainer.cpp +++ b/src/engine/dispatchContainer.cpp @@ -225,12 +225,8 @@ void DivDispatchContainer::fillBuf(size_t runtotal, size_t offset, size_t size) if (bb[i]==NULL) continue; blip_end_frame(bb[i],runtotal); blip_read_samples(bb[i],bbOut[i]+offset,size,0); + dispatch->postProcess(bbOut[i]+offset,i,size,rateMemory); } - /*if (totalRead<(int)size && totalRead>0) { - for (size_t i=totalRead; i& stream, int sRate, size_t len) { } +void DivDispatch::postProcess(short* buf, int outIndex, size_t len, int sampleRate) { +} + void DivDispatch::tick(bool sysTick) { } diff --git a/src/engine/platform/amiga.cpp b/src/engine/platform/amiga.cpp index d3c8b6807..73576c89f 100644 --- a/src/engine/platform/amiga.cpp +++ b/src/engine/platform/amiga.cpp @@ -380,6 +380,10 @@ void DivPlatformAmiga::acquireDirect(blip_buffer_t** bb, size_t off, size_t len) } } +void DivPlatformAmiga::postProcess(short* buf, int outIndex, size_t len, int sampleRate) { + //buf[0]=32767; +} + void DivPlatformAmiga::irq(int ch) { // disable interrupt rWrite(0x9a,128<