OPN/A/B: fix CSM when using ymfm

and now there's a crash
This commit is contained in:
tildearrow 2024-10-17 02:53:08 -05:00
parent 3164f311f5
commit a0f0c863c9
13 changed files with 37 additions and 43 deletions

View file

@ -18,7 +18,6 @@
*/
#include "ym2610.h"
#include <math.h>
const char* regCheatSheetYM2610[]={
// SSG
@ -395,6 +394,7 @@ void DivPlatformYM2610::acquire_ymfm(short** buf, size_t len) {
}
fm->generate(&fmout);
iface.clock();
os[0]+=((fmout.data[0]*fmVol)>>8)+((fmout.data[2]*ssgVol)>>8);
if (os[0]<-32768) os[0]=-32768;
@ -1791,7 +1791,7 @@ int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, const DivCo
}
void DivPlatformYM2610::setCSM(bool isCSM) {
this->isCSM=isCSM;
this->isCSM=isCSM?1:0;
psgChanOffs=4+isCSM; // doing this hurts me...
adpcmAChanOffs=7+isCSM;
adpcmBChanOffs=13+isCSM;