From 0cf6c7cd646925a8662a96d189375117f2ce2f9a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 26 Sep 2024 14:20:14 -0500 Subject: [PATCH] OPL: fix YMF289 in ymfm ymfm offers a class called ymf289, but I am too lazy to use it and it probably does not resample anyway --- src/engine/platform/opl.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index 41e04f9dc..ce9837823 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -494,6 +494,16 @@ void DivPlatformOPL::acquire_ymfm3(short** buf, size_t len) { fm_ymfm3->generate(&out,1); + if (downsample) { + // 49716-44100 + downsamplerStep+=5616; + if (downsamplerStep>=44100) { + downsamplerStep-=44100; + h--; + continue; + } + } + buf[0][h]=out.data[0]>>1; if (totalOutputs>1) { buf[1][h]=out.data[1]>>1; @@ -2730,6 +2740,7 @@ void DivPlatformOPL::reset() { while (!writes.empty()) writes.pop(); memset(regPool,0,768); + downsamplerStep=0; oldOpMask=0; dacVal=0; dacVal2=0;