emu2413, part 2

missing:
- YM2423 patches
This commit is contained in:
tildearrow 2024-04-05 17:31:13 -05:00
parent dc2daccf05
commit a613cfb303

View file

@ -102,11 +102,20 @@ void DivPlatformOPLL::acquire_emu(short** buf, size_t len) {
OPLL_writeReg(fm_emu,w.addr,w.val); OPLL_writeReg(fm_emu,w.addr,w.val);
writes.pop(); writes.pop();
} }
os=OPLL_calc(fm_emu)<<1; os=OPLL_calc(fm_emu);
os=os+(os<<1);
if (os<-32768) os=-32768; if (os<-32768) os=-32768;
if (os>32767) os=32767; if (os>32767) os=32767;
buf[0][h]=os; buf[0][h]=os;
for (int i=0; i<11; i++) {
if (i>=6 && properDrums) {
oscBuf[i]->data[oscBuf[i]->needle++]=fm_emu->ch_out[i+3]<<3;
} else {
oscBuf[i]->data[oscBuf[i]->needle++]=fm_emu->ch_out[i]<<3;
}
}
} }
} }
@ -1001,6 +1010,10 @@ int DivPlatformOPLL::getRegisterPoolSize() {
return 64; return 64;
} }
static const unsigned char nukedToEmuPatch[4]={
0, 2, 0 /* TODO */, 1
};
void DivPlatformOPLL::reset() { void DivPlatformOPLL::reset() {
while (!writes.empty()) writes.pop(); while (!writes.empty()) writes.pop();
memset(regPool,0,256); memset(regPool,0,256);
@ -1026,6 +1039,11 @@ void DivPlatformOPLL::reset() {
if (dumpWrites) { if (dumpWrites) {
addWrite(0xffffffff,0); addWrite(0xffffffff,0);
} }
if (selCore==1) {
OPLL_reset(fm_emu);
OPLL_setChipType(fm_emu,vrc7?1:0);
OPLL_resetPatch(fm_emu,nukedToEmuPatch[patchSet&3]);
}
for (int i=0; i<11; i++) { for (int i=0; i<11; i++) {
chan[i]=DivPlatformOPLL::Channel(); chan[i]=DivPlatformOPLL::Channel();
chan[i].std.setEngine(parent); chan[i].std.setEngine(parent);