diff --git a/src/engine/dispatch.h b/src/engine/dispatch.h index 12238cfe2..6757fe1e8 100644 --- a/src/engine/dispatch.h +++ b/src/engine/dispatch.h @@ -260,6 +260,9 @@ enum DivDispatchCmds { DIV_CMD_MINMOD_ECHO, + DIV_CMD_BIFURCATOR_STATE_LOAD, + DIV_CMD_BIFURCATOR_PARAMETER, + DIV_CMD_MAX }; diff --git a/src/engine/platform/bifurcator.cpp b/src/engine/platform/bifurcator.cpp index af340e269..800f2b8f9 100644 --- a/src/engine/platform/bifurcator.cpp +++ b/src/engine/platform/bifurcator.cpp @@ -249,6 +249,12 @@ int DivPlatformBifurcator::dispatch(DivCommand c) { if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_FREQUENCY(chan[c.chan].note); chan[c.chan].inPorta=c.value; break; + case DIV_CMD_BIFURCATOR_STATE_LOAD: + rWrite(c.chan*8+c.value,c.value2); + break; + case DIV_CMD_BIFURCATOR_PARAMETER: + rWrite(c.chan*8+2+c.value,c.value2); + break; case DIV_CMD_GET_VOLMAX: return 255; break; diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 1e7d823c2..82d07d636 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -259,6 +259,9 @@ const char* cmdName[]={ "DAVE_CLOCK_DIV", "MINMOD_ECHO", + + "BIFURCATOR_STATE_LOAD", + "BIFURCATOR_PARAMETER" }; static_assert((sizeof(cmdName)/sizeof(void*))==DIV_CMD_MAX,"update cmdName!"); diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index 286b6ce9e..030c8fb56 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -2097,7 +2097,14 @@ void DivEngine::registerSystems() { {"Channel 1", "Channel 2", "Channel 3", "Channel 4"}, {"CH1", "CH2", "CH3", "CH4"}, {DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE}, - {DIV_INS_BIFURCATOR, DIV_INS_BIFURCATOR, DIV_INS_BIFURCATOR, DIV_INS_BIFURCATOR} + {DIV_INS_BIFURCATOR, DIV_INS_BIFURCATOR, DIV_INS_BIFURCATOR, DIV_INS_BIFURCATOR}, + {}, + { + {0x10, {DIV_CMD_BIFURCATOR_STATE_LOAD, "10xx: Load low byte of channel sample state", constVal<0>, effectVal}}, + {0x11, {DIV_CMD_BIFURCATOR_STATE_LOAD, "11xx: Load high byte of channel sample state", constVal<1>, effectVal}}, + {0x12, {DIV_CMD_BIFURCATOR_PARAMETER, "12xx: Set low byte of channel parameter", constVal<0>, effectVal}}, + {0x13, {DIV_CMD_BIFURCATOR_PARAMETER, "13xx: Set high byte of channel parameter", constVal<1>, effectVal}}, + } ); sysDefs[DIV_SYSTEM_DUMMY]=new DivSysDef(