it gets worse
This commit is contained in:
parent
0d78e9bb10
commit
3d59d68158
|
@ -77,36 +77,19 @@ void DivPlatformNDS::acquireDirect(blip_buffer_t** bb, size_t len) {
|
||||||
nds.set_oscbuf(oscBuf);
|
nds.set_oscbuf(oscBuf);
|
||||||
nds.resetTS(0);
|
nds.resetTS(0);
|
||||||
nds.tick(len);
|
nds.tick(len);
|
||||||
/*
|
|
||||||
for (size_t h=0; h<len; h++) {
|
|
||||||
int advance=len;//nds.predict();
|
|
||||||
//if (advance<1) advance=1;
|
|
||||||
//if (advance>(int)(len-h)) advance=len-h;
|
|
||||||
|
|
||||||
h+=advance-1;
|
|
||||||
|
|
||||||
int lout=((nds.loutput()-0x200)<<5); // scale to 16 bit
|
|
||||||
int rout=((nds.routput()-0x200)<<5); // scale to 16 bit
|
|
||||||
|
|
||||||
if (lastOut[0]!=lout) {
|
|
||||||
blip_add_delta(bb[0],h,lout-lastOut[0]);
|
|
||||||
lastOut[0]=lout;
|
|
||||||
}
|
|
||||||
if (lastOut[1]!=rout) {
|
|
||||||
blip_add_delta(bb[1],h,rout-lastOut[1]);
|
|
||||||
lastOut[1]=rout;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i=0; i<16; i++) {
|
|
||||||
oscBuf[i]->putSample(h,(nds.chan_lout(i)+nds.chan_rout(i))>>1);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
oscBuf[i]->end(len);
|
oscBuf[i]->end(len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivPlatformNDS::postProcess(short* buf, int outIndex, size_t len, int sampleRate) {
|
||||||
|
// this is where we handle global volume. it is faster than doing it on each blip...
|
||||||
|
for (size_t i=0; i<len; i++) {
|
||||||
|
buf[i]=((buf[i]*globalVolume)>>7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
u8 DivPlatformNDS::read_byte(u32 addr) {
|
u8 DivPlatformNDS::read_byte(u32 addr) {
|
||||||
if (addr<getSampleMemCapacity()) {
|
if (addr<getSampleMemCapacity()) {
|
||||||
return sampleMem[addr];
|
return sampleMem[addr];
|
||||||
|
|
|
@ -67,6 +67,7 @@ class DivPlatformNDS: public DivDispatch, public nds_sound_intf {
|
||||||
virtual void write_byte(u32 addr, u8 data) override;
|
virtual void write_byte(u32 addr, u8 data) override;
|
||||||
|
|
||||||
virtual void acquireDirect(blip_buffer_t** bb, size_t len) override;
|
virtual void acquireDirect(blip_buffer_t** bb, size_t len) override;
|
||||||
|
virtual void postProcess(short* buf, int outIndex, size_t len, int sampleRate) override;
|
||||||
virtual int dispatch(DivCommand c) override;
|
virtual int dispatch(DivCommand c) override;
|
||||||
virtual void* getChanState(int chan) override;
|
virtual void* getChanState(int chan) override;
|
||||||
virtual DivMacroInt* getChanMacroInt(int ch) override;
|
virtual DivMacroInt* getChanMacroInt(int ch) override;
|
||||||
|
|
Loading…
Reference in a new issue