I have no idea what's going on

This commit is contained in:
tildearrow 2025-03-03 17:18:52 -05:00
parent acdce2c795
commit 95b1085aed
5 changed files with 18 additions and 5 deletions

View file

@ -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.

View file

@ -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<size; i++) {
bbOut[0][i]=bbOut[0][totalRead-1];//bbOut[0][totalRead];
}
}*/
}
void DivDispatchContainer::clear() {

View file

@ -29,6 +29,9 @@ void DivDispatch::acquireDirect(blip_buffer_t** bb, size_t off, size_t len) {
void DivDispatch::fillStream(std::vector<DivDelayedWrite>& stream, int sRate, size_t len) {
}
void DivDispatch::postProcess(short* buf, int outIndex, size_t len, int sampleRate) {
}
void DivDispatch::tick(bool sysTick) {
}

View file

@ -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<<ch);

View file

@ -140,6 +140,7 @@ class DivPlatformAmiga: public DivDispatch {
public:
void acquire(short** buf, size_t len);
void acquireDirect(blip_buffer_t** bb, size_t off, size_t len);
void postProcess(short* buf, int outIndex, size_t len, int sampleRate);
int dispatch(DivCommand c);
void* getChanState(int chan);
DivDispatchOscBuffer* getOscBuffer(int chan);