OPLL: add effect to change patch

10xx
This commit is contained in:
tildearrow 2024-05-16 12:35:34 -05:00
parent 30cf8ff00b
commit 9e1b43f401
3 changed files with 9 additions and 0 deletions

View file

@ -27,6 +27,7 @@ the YM2413 is equipped with the following features:
## effects ## effects
- `10xx`: **change patch.**
- `11xx`: **set feedback of channel.** - `11xx`: **set feedback of channel.**
- `12xx`: **set operator 1 level.** - `12xx`: **set operator 1 level.**
- `13xx`: **set operator 2 level.** - `13xx`: **set operator 2 level.**

View file

@ -692,6 +692,13 @@ int DivPlatformOPLL::dispatch(DivCommand c) {
chan[c.chan].freqChanged=true; chan[c.chan].freqChanged=true;
break; break;
} }
case DIV_CMD_WAVE: {
if (c.chan>=6 && (crapDrums || properDrums)) break;
if (c.chan>=9) break;
chan[c.chan].state.opllPreset=c.value&15;
rWrite(0x30+c.chan,((15-VOL_SCALE_LOG_BROKEN(chan[c.chan].outVol,15-chan[c.chan].state.op[1].tl,15))&15)|(chan[c.chan].state.opllPreset<<4));
break;
}
case DIV_CMD_FM_FB: { case DIV_CMD_FM_FB: {
if (c.chan>=9 && !properDrums) return 0; if (c.chan>=9 && !properDrums) return 0;
//DivInstrumentFM::Operator& mod=chan[c.chan].state.op[0]; //DivInstrumentFM::Operator& mod=chan[c.chan].state.op[0];

View file

@ -550,6 +550,7 @@ void DivEngine::registerSystems() {
}); });
EffectHandlerMap fmOPLLPostEffectHandlerMap={ EffectHandlerMap fmOPLLPostEffectHandlerMap={
{0x10, {DIV_CMD_WAVE, "10xx: Set patch (0 to F)"}},
{0x11, {DIV_CMD_FM_FB, "11xx: Set feedback (0 to 7)"}}, {0x11, {DIV_CMD_FM_FB, "11xx: Set feedback (0 to 7)"}},
{0x12, {DIV_CMD_FM_TL, "12xx: Set level of operator 1 (0 highest, 3F lowest)", constVal<0>, effectVal}}, {0x12, {DIV_CMD_FM_TL, "12xx: Set level of operator 1 (0 highest, 3F lowest)", constVal<0>, effectVal}},
{0x13, {DIV_CMD_FM_TL, "13xx: Set level of operator 2 (0 highest, 3F lowest)", constVal<1>, effectVal}}, {0x13, {DIV_CMD_FM_TL, "13xx: Set level of operator 2 (0 highest, 3F lowest)", constVal<1>, effectVal}},