OPN[A/B/2]?: implement 18xx effect

This commit is contained in:
tildearrow 2022-06-28 01:16:46 -05:00
parent e2449d91f1
commit f483292a88
11 changed files with 92 additions and 5 deletions

View file

@ -34,6 +34,10 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
}
int ch=c.chan-2;
int ordch=orderedOps[ch];
if (!extMode) {
c.chan=2;
return DivPlatformGenesis::dispatch(c);
}
switch (c.cmd) {
case DIV_CMD_NOTE_ON: {
DivInstrument* ins=parent->getIns(opChan[ch].ins,DIV_INS_FM);
@ -173,6 +177,11 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
opChan[ch].freqChanged=true;
break;
}
case DIV_CMD_FM_EXTCH: {
extMode=c.value;
immWrite(0x27,extMode?0x40:0);
break;
}
case DIV_CMD_FM_LFO: {
lfoValue=(c.value&7)|((c.value>>4)<<3);
rWrite(0x22,lfoValue);
@ -489,7 +498,7 @@ void DivPlatformGenesisExt::forceIns() {
for (int j=0; j<4; j++) {
unsigned short baseAddr=chanOffs[i]|opOffs[j];
DivInstrumentFM::Operator& op=chan[i].state.op[j];
if (i==2) { // extended channel
if (i==2 && extMode) { // extended channel
if (isOpMuted[j]) {
rWrite(baseAddr+0x40,127);
} else if (isOutput[chan[i].state.alg][j]) {
@ -592,6 +601,7 @@ int DivPlatformGenesisExt::init(DivEngine* parent, int channels, int sugRate, un
for (int i=0; i<4; i++) {
isOpMuted[i]=false;
}
extSys=true;
reset();
return 13;