From 0b8fcc6e8dfacb91f0f165161c20a4428f1c0a44 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 5 Jun 2021 23:27:02 -0500 Subject: [PATCH] genesis: implement 10xx command --- src/engine/dispatch.h | 1 + src/engine/platform/genesis.cpp | 4 ++++ src/engine/playback.cpp | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 0436ce2f7..28609f8ae 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -18,6 +18,7 @@ enum DivDispatchCmds { DIV_CMD_SAMPLE_MODE, + DIV_CMD_FM_LFO, DIV_CMD_FM_TL, DIV_CMD_FM_AR, DIV_CMD_FM_FB, diff --git a/src/engine/platform/genesis.cpp b/src/engine/platform/genesis.cpp index fc3caab59..e67cba6df 100644 --- a/src/engine/platform/genesis.cpp +++ b/src/engine/platform/genesis.cpp @@ -279,6 +279,10 @@ int DivPlatformGenesis::dispatch(DivCommand c) { chan[c.chan].freqChanged=true; break; } + case DIV_CMD_FM_LFO: { + rWrite(0x22,(c.value&7)|((c.value>>4)<<3)); + break; + } case DIV_CMD_FM_MULT: { unsigned short baseAddr=chanOffs[c.chan]|opOffs[orderedOps[c.value]]; DivInstrument* ins=parent->getIns(chan[c.chan].ins); diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 0cdcd7209..7f33d0e55 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -26,6 +26,7 @@ const char* cmdName[DIV_CMD_MAX]={ "SAMPLE_MODE", + "FM_LFO", "FM_TL", "FM_AR", "FM_FB", @@ -119,6 +120,9 @@ bool DivEngine::perSystemPostEffect(int ch, unsigned char effect, unsigned char case DIV_SYSTEM_GENESIS: case DIV_SYSTEM_GENESIS_EXT: switch (effect) { + case 0x10: // LFO + dispatchCmd(DivCommand(DIV_CMD_FM_LFO,ch,effectVal)); + break; case 0x11: // FB dispatchCmd(DivCommand(DIV_CMD_FM_FB,ch,effectVal&7)); break;