replay keyOn in active channels during forceIns

fixes an issue when playing orders
This commit is contained in:
tildearrow 2022-02-20 21:39:14 -05:00
parent 197d3ab39d
commit e697c055b6
7 changed files with 54 additions and 0 deletions

View file

@ -619,10 +619,12 @@ int DivPlatformArcade::dispatch(DivCommand c) {
}
}
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
chan[c.chan].active=false;
break;
case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
chan[c.chan].active=false;
chan[c.chan].std.release();
break;
@ -851,6 +853,10 @@ void DivPlatformArcade::forceIns() {
rWrite(chanOffs[i]+ADDR_LR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3)|((chan[i].chVolL&1)<<6)|((chan[i].chVolR&1)<<7));
}
rWrite(chanOffs[i]+ADDR_FMS_AMS,((chan[i].state.fms&7)<<4)|(chan[i].state.ams&3));
if (chan[i].active) {
chan[i].keyOn=true;
chan[i].freqChanged=true;
}
}
for (int i=8; i<13; i++) {
chan[i].insChanged=true;

View file

@ -258,11 +258,13 @@ int DivPlatformC64::dispatch(DivCommand c) {
case DIV_CMD_NOTE_OFF:
chan[c.chan].active=false;
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
//chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].active=false;
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
chan[c.chan].std.release();
break;
case DIV_CMD_ENV_RELEASE:
@ -439,6 +441,10 @@ void DivPlatformC64::forceIns() {
for (int i=0; i<3; i++) {
chan[i].insChanged=true;
chan[i].testWhen=0;
if (chan[i].active) {
chan[i].keyOn=true;
chan[i].freqChanged=true;
}
}
updateFilter();
}

View file

@ -578,6 +578,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
if (dumpWrites) addWrite(0xffff0002,0);
}
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
chan[c.chan].active=false;
break;
case DIV_CMD_NOTE_OFF_ENV:
@ -586,6 +587,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
if (dumpWrites) addWrite(0xffff0002,0);
}
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
chan[c.chan].active=false;
chan[c.chan].std.release();
break;
@ -781,6 +783,10 @@ void DivPlatformGenesis::forceIns() {
}
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
rWrite(chanOffs[i]+ADDR_LRAF,(isMuted[i]?0:(chan[i].pan<<6))|(chan[i].state.fms&7)|((chan[i].state.ams&3)<<4));
if (chan[i].active) {
chan[i].keyOn=true;
chan[i].freqChanged=true;
}
}
if (dacMode) {
rWrite(0x2b,0x80);

View file

@ -81,6 +81,7 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
}
case DIV_CMD_NOTE_OFF:
opChan[ch].keyOff=true;
opChan[ch].keyOn=false;
opChan[ch].active=false;
break;
case DIV_CMD_VOLUME: {
@ -315,6 +316,10 @@ void DivPlatformGenesisExt::forceIns() {
DivPlatformGenesis::forceIns();
for (int i=0; i<4; i++) {
opChan[i].insChanged=true;
if (opChan[i].active) {
opChan[i].keyOn=true;
opChan[i].freqChanged=true;
}
}
}

View file

@ -515,6 +515,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
break;
}
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
chan[c.chan].active=false;
chan[c.chan].std.init(NULL);
break;
@ -528,6 +529,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
break;
}
chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false;
chan[c.chan].active=false;
chan[c.chan].std.release();
break;
@ -829,6 +831,10 @@ void DivPlatformYM2610::forceIns() {
}
rWrite(chanOffs[i]+ADDR_FB_ALG,(chan[i].state.alg&7)|(chan[i].state.fb<<3));
rWrite(chanOffs[i]+ADDR_LRAF,(isMuted[i]?0:(chan[i].pan<<6))|(chan[i].state.fms&7)|((chan[i].state.ams&3)<<4));
if (chan[i].active) {
chan[i].keyOn=true;
chan[i].freqChanged=true;
}
}
for (int i=4; i<14; i++) {
chan[i].insChanged=true;

View file

@ -71,6 +71,7 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) {
}
case DIV_CMD_NOTE_OFF:
opChan[ch].keyOff=true;
opChan[ch].keyOn=false;
opChan[ch].active=false;
break;
case DIV_CMD_VOLUME: {
@ -282,6 +283,10 @@ void DivPlatformYM2610Ext::forceIns() {
DivPlatformYM2610::forceIns();
for (int i=0; i<4; i++) {
opChan[i].insChanged=true;
if (opChan[i].active) {
opChan[i].keyOn=true;
opChan[i].freqChanged=true;
}
}
}

View file

@ -62,6 +62,26 @@ const char* fmParamNames[3][16]={
{"ALG", "FB", "FMS/PMS", "AMS", "AR", "DR", "D2R", "RR", "SL", "TL", "RS", "MULT", "DT", "DT2", "SSG-EG", "AM"}
};
const char* opllInsNames[18]={
"User",
"Violin",
"Guitar",
"Piano",
"Flute",
"Clarinet",
"Oboe",
"Trumpet",
"Organ",
"Horn",
"Synth",
"Harpsichord",
"Vibraphone",
"Synth Bass",
"Acoustic Bass",
"Electric Guitar",
"Drums (compatibility only!)"
};
enum FMParams {
FM_ALG=0,
FM_FB=1,