From b0c8cfc1f6c615c37db47c95c8ef0b989f98ab2b Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 26 May 2022 00:39:15 -0500 Subject: [PATCH] Lynx: sample improvements --- src/engine/platform/lynx.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/engine/platform/lynx.cpp b/src/engine/platform/lynx.cpp index ae24312ed..9cc3a359c 100644 --- a/src/engine/platform/lynx.cpp +++ b/src/engine/platform/lynx.cpp @@ -236,7 +236,8 @@ void DivPlatformLynx::tick(bool sysTick) { off=(double)s->centerRate/8363.0; } } - chan[i].sampleFreq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,2,chan[i].pitch2,off,1); + chan[i].sampleFreq=off*parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,2,chan[i].pitch2,1,1); + WRITE_FEEDBACK(i,0); WRITE_LFSR(i,0); WRITE_OTHER(i,0); WRITE_CONTROL(i,0x18); @@ -258,8 +259,10 @@ void DivPlatformLynx::tick(bool sysTick) { chan[i].freqChanged=false; } else if (chan[i].std.duty.had) { chan[i].duty = chan[i].std.duty.val; - WRITE_FEEDBACK(i, chan[i].duty.feedback); - WRITE_CONTROL(i, (chan[i].fd.clockDivider|0x18|chan[i].duty.int_feedback7)); + if (!chan[i].pcm) { + WRITE_FEEDBACK(i, chan[i].duty.feedback); + WRITE_CONTROL(i, (chan[i].fd.clockDivider|0x18|chan[i].duty.int_feedback7)); + } } } } @@ -292,6 +295,9 @@ int DivPlatformLynx::dispatch(DivCommand c) { chan[c.chan].active=false; WRITE_VOLUME(c.chan, 0); chan[c.chan].macroInit(NULL); + if (chan[c.chan].pcm) { + chan[c.chan].pcm=false; + } break; case DIV_CMD_LYNX_LFSR_LOAD: chan[c.chan].freqChanged=true;