From 70ead337f36bf96546e9168b6c20ba015f7d16c8 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 21 May 2022 03:34:39 -0500 Subject: [PATCH] Y8950: fix ADPCM VGM export --- src/engine/platform/opl.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/engine/platform/opl.cpp b/src/engine/platform/opl.cpp index 77492cd2b..c81fb6daa 100644 --- a/src/engine/platform/opl.cpp +++ b/src/engine/platform/opl.cpp @@ -734,12 +734,12 @@ int DivPlatformOPL::dispatch(DivCommand c) { chan[c.chan].sample=ins->amiga.getSample(c.value); if (chan[c.chan].sample>=0 && chan[c.chan].samplesong.sampleLen) { DivSample* s=parent->getSample(chan[c.chan].sample); - immWrite(9,(s->offB>>2)&0xff); - immWrite(10,(s->offB>>10)&0xff); + immWrite(9,(s->offB>>5)&0xff); + immWrite(10,(s->offB>>13)&0xff); int end=s->offB+s->lengthB-1; - immWrite(11,(end>>2)&0xff); - immWrite(12,(end>>10)&0xff); - immWrite(8,2); + immWrite(11,(end>>5)&0xff); + immWrite(12,(end>>13)&0xff); + immWrite(8,1); immWrite(7,(s->loopStart>=0)?0xb0:0xa0); // start/repeat if (c.value!=DIV_NOTE_NULL) { chan[c.chan].note=c.value; @@ -774,7 +774,7 @@ int DivPlatformOPL::dispatch(DivCommand c) { int end=s->offB+s->lengthB-1; immWrite(11,(end>>2)&0xff); immWrite(12,(end>>10)&0xff); - immWrite(8,2); + immWrite(8,1); immWrite(7,(s->loopStart>=0)?0xb0:0xa0); // start/repeat int freq=(65536.0*(double)s->rate)/(double)rate; immWrite(16,freq&0xff); @@ -1698,7 +1698,7 @@ int DivPlatformOPL::init(DivEngine* p, int channels, int sugRate, unsigned int f adpcmBMemLen=0; iface.adpcmBMem=adpcmBMem; iface.sampleBank=0; - adpcmB=new ymfm::adpcm_b_engine(iface,2); + adpcmB=new ymfm::adpcm_b_engine(iface,5); } reset();