From af6bbf94935a79fe126f900488a98a28fea3e049 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 30 Mar 2022 00:09:53 -0500 Subject: [PATCH] OPN: fix LFO effect not working in ext ch mode --- src/engine/platform/genesisext.cpp | 5 +++++ src/engine/platform/ym2610bext.cpp | 4 ++++ src/engine/platform/ym2610ext.cpp | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/src/engine/platform/genesisext.cpp b/src/engine/platform/genesisext.cpp index b53cd3894..2fb1ab390 100644 --- a/src/engine/platform/genesisext.cpp +++ b/src/engine/platform/genesisext.cpp @@ -159,6 +159,11 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) { opChan[ch].freqChanged=true; break; } + case DIV_CMD_FM_LFO: { + lfoValue=(c.value&7)|((c.value>>4)<<3); + rWrite(0x22,lfoValue); + break; + } case DIV_CMD_FM_MULT: { // TODO unsigned short baseAddr=chanOffs[2]|opOffs[orderedOps[c.value]]; DivInstrumentFM::Operator& op=chan[2].state.op[orderedOps[c.value]]; diff --git a/src/engine/platform/ym2610bext.cpp b/src/engine/platform/ym2610bext.cpp index e85215730..597710ced 100644 --- a/src/engine/platform/ym2610bext.cpp +++ b/src/engine/platform/ym2610bext.cpp @@ -147,6 +147,10 @@ int DivPlatformYM2610BExt::dispatch(DivCommand c) { opChan[ch].freqChanged=true; break; } + case DIV_CMD_FM_LFO: { + rWrite(0x22,(c.value&7)|((c.value>>4)<<3)); + break; + } case DIV_CMD_FM_MULT: { // TODO unsigned short baseAddr=chanOffs[2]|opOffs[orderedOps[c.value]]; DivInstrument* ins=parent->getIns(opChan[ch].ins); diff --git a/src/engine/platform/ym2610ext.cpp b/src/engine/platform/ym2610ext.cpp index 63d584d04..8ef9c16ea 100644 --- a/src/engine/platform/ym2610ext.cpp +++ b/src/engine/platform/ym2610ext.cpp @@ -147,6 +147,10 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) { opChan[ch].freqChanged=true; break; } + case DIV_CMD_FM_LFO: { + rWrite(0x22,(c.value&7)|((c.value>>4)<<3)); + break; + } case DIV_CMD_FM_MULT: { // TODO unsigned short baseAddr=chanOffs[1]|opOffs[orderedOps[c.value]]; DivInstrument* ins=parent->getIns(opChan[ch].ins);