diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index f7caf09a8..c25e32d39 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -113,14 +113,15 @@ const unsigned char dacLogTableAY[256]={ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 }; -void DivPlatformAY8910::runDAC() { +void DivPlatformAY8910::runDAC(int runRate) { + if (runRate==0) runRate=dacRate; for (int i=0; i<3; i++) { if (chan[i].active && (chan[i].curPSGMode.val&8) && chan[i].dac.sample!=-1) { chan[i].dac.period+=chan[i].dac.rate; bool end=false; bool changed=false; int prevOut=chan[i].dac.out; - while (chan[i].dac.period>dacRate && !end) { + while (chan[i].dac.period>runRate && !end) { DivSample* s=parent->getSample(chan[i].dac.sample); if (s->samples<=0 || chan[i].dac.pos<0 || chan[i].dac.pos>=(int)s->samples) { chan[i].dac.sample=-1; @@ -143,7 +144,7 @@ void DivPlatformAY8910::runDAC() { end=true; break; } - chan[i].dac.period-=dacRate; + chan[i].dac.period-=runRate; } if (changed && !end) { if (!isMuted[i]) { @@ -154,13 +155,15 @@ void DivPlatformAY8910::runDAC() { } } -void DivPlatformAY8910::runTFX() { +void DivPlatformAY8910::runTFX(int runRate) { /* developer's note: if you are checking for intellivision make sure to add "&& selCore" because for some reason, the register remap doesn't work when the user uses AtomicSSG core */ + // TODO: this + if (runRate==0) runRate=dacRate; int timerPeriod, output; for (int i=0; i<3; i++) { if (chan[i].active && (chan[i].curPSGMode.val&16) && !(chan[i].curPSGMode.val&8) && chan[i].tfx.mode!=-1) { @@ -327,12 +330,9 @@ void DivPlatformAY8910::acquire(short** buf, size_t len) { void DivPlatformAY8910::fillStream(std::vector& stream, int sRate, size_t len) { writes.clear(); - int hrate=(int)(rate/sRate); for (size_t i=0; i& stream, int sRate, size_t len); diff --git a/src/engine/platform/ym2203.cpp b/src/engine/platform/ym2203.cpp index c1774f4fc..4b449d0e8 100644 --- a/src/engine/platform/ym2203.cpp +++ b/src/engine/platform/ym2203.cpp @@ -444,6 +444,10 @@ void DivPlatformYM2203::acquire_lle(short** buf, size_t len) { } } +void DivPlatformYM2203::fillStream(std::vector& stream, int sRate, size_t len) { + ay->fillStream(stream,sRate,len); +} + void DivPlatformYM2203::tick(bool sysTick) { // PSG ay->tick(sysTick); diff --git a/src/engine/platform/ym2203.h b/src/engine/platform/ym2203.h index 1a2d0eb3e..baff93ebe 100644 --- a/src/engine/platform/ym2203.h +++ b/src/engine/platform/ym2203.h @@ -74,6 +74,7 @@ class DivPlatformYM2203: public DivPlatformOPN { public: void acquire(short** buf, size_t len); + void fillStream(std::vector& stream, int sRate, size_t len); int dispatch(DivCommand c); void* getChanState(int chan); DivMacroInt* getChanMacroInt(int ch);