Bifurcator: add effect commands

This commit is contained in:
Natt Akuma 2024-04-01 17:27:31 +07:00
parent b3e0825462
commit c60d1845e5
4 changed files with 20 additions and 1 deletions

View file

@ -260,6 +260,9 @@ enum DivDispatchCmds {
DIV_CMD_MINMOD_ECHO,
DIV_CMD_BIFURCATOR_STATE_LOAD,
DIV_CMD_BIFURCATOR_PARAMETER,
DIV_CMD_MAX
};

View file

@ -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;

View file

@ -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!");

View file

@ -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(