From 3a687eeb45f0c332ed4715c056377185982ab99f Mon Sep 17 00:00:00 2001 From: tildearrow Date: Tue, 3 Jan 2023 14:39:31 -0500 Subject: [PATCH] new dispatch, part 2 --- src/engine/dispatchContainer.cpp | 1 + src/engine/engine.h | 4 +++- src/engine/platform/k007232.cpp | 2 +- src/engine/platform/x1_010.cpp | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/engine/dispatchContainer.cpp b/src/engine/dispatchContainer.cpp index fa72b76b9..22c63d677 100644 --- a/src/engine/dispatchContainer.cpp +++ b/src/engine/dispatchContainer.cpp @@ -85,6 +85,7 @@ void DivDispatchContainer::setRates(double gotRate) { for (int i=0; irate,gotRate); } + rateMemory=gotRate; } void DivDispatchContainer::setQuality(bool lowQual) { diff --git a/src/engine/engine.h b/src/engine/engine.h index 652d71584..219c468bd 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -177,6 +177,7 @@ struct DivDispatchContainer { short* bbIn[DIV_MAX_OUTPUTS]; short* bbOut[DIV_MAX_OUTPUTS]; bool lowQuality, dcOffCompensation; + double rateMemory; void setRates(double gotRate); void setQuality(bool lowQual); @@ -194,7 +195,8 @@ struct DivDispatchContainer { runPos(0), lastAvail(0), lowQuality(false), - dcOffCompensation(false) { + dcOffCompensation(false), + rateMemory(0.0) { memset(bb,0,DIV_MAX_OUTPUTS*sizeof(blip_buffer_t*)); memset(temp,0,DIV_MAX_OUTPUTS*sizeof(int)); memset(prevSample,0,DIV_MAX_OUTPUTS*sizeof(int)); diff --git a/src/engine/platform/k007232.cpp b/src/engine/platform/k007232.cpp index a076d120e..6a333c6c6 100644 --- a/src/engine/platform/k007232.cpp +++ b/src/engine/platform/k007232.cpp @@ -84,7 +84,7 @@ void DivPlatformK007232::acquire(short** buf, size_t len) { } else { const unsigned char vol=regPool[0xc]; const signed int out[2]={(k007232.output(0)*(vol&0xf)),(k007232.output(1)*((vol>>4)&0xf))}; - buf[0][h]=buf[1][h]=(out[0]+out[1])<<4; + buf[0][h]=(out[0]+out[1])<<4; for (int i=0; i<2; i++) { oscBuf[i]->data[oscBuf[i]->needle++]=out[i]<<5; } diff --git a/src/engine/platform/x1_010.cpp b/src/engine/platform/x1_010.cpp index 17cda3b74..34973a99d 100644 --- a/src/engine/platform/x1_010.cpp +++ b/src/engine/platform/x1_010.cpp @@ -219,7 +219,7 @@ void DivPlatformX1_010::acquire(short** buf, size_t len) { //printf("tempL: %d tempR: %d\n",tempL,tempR); buf[0][h]=stereo?tempL:((tempL+tempR)>>1); - buf[1][h]=stereo?tempR:buf[0][h]; + if (stereo) buf[1][h]=tempR; for (int i=0; i<16; i++) { oscBuf[i]->data[oscBuf[i]->needle++]=(x1_010.voice_out(i,0)+x1_010.voice_out(i,1))>>1;