mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-31 20:11:29 +00:00
replay keyOn in active channels during forceIns
fixes an issue when playing orders
This commit is contained in:
parent
197d3ab39d
commit
e697c055b6
7 changed files with 54 additions and 0 deletions
|
@ -619,10 +619,12 @@ int DivPlatformArcade::dispatch(DivCommand c) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_NOTE_OFF_ENV:
|
case DIV_CMD_NOTE_OFF_ENV:
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
chan[c.chan].std.release();
|
chan[c.chan].std.release();
|
||||||
break;
|
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_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));
|
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++) {
|
for (int i=8; i<13; i++) {
|
||||||
chan[i].insChanged=true;
|
chan[i].insChanged=true;
|
||||||
|
|
|
@ -258,11 +258,13 @@ int DivPlatformC64::dispatch(DivCommand c) {
|
||||||
case DIV_CMD_NOTE_OFF:
|
case DIV_CMD_NOTE_OFF:
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
//chan[c.chan].std.init(NULL);
|
//chan[c.chan].std.init(NULL);
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_NOTE_OFF_ENV:
|
case DIV_CMD_NOTE_OFF_ENV:
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
chan[c.chan].std.release();
|
chan[c.chan].std.release();
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_ENV_RELEASE:
|
case DIV_CMD_ENV_RELEASE:
|
||||||
|
@ -439,6 +441,10 @@ void DivPlatformC64::forceIns() {
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<3; i++) {
|
||||||
chan[i].insChanged=true;
|
chan[i].insChanged=true;
|
||||||
chan[i].testWhen=0;
|
chan[i].testWhen=0;
|
||||||
|
if (chan[i].active) {
|
||||||
|
chan[i].keyOn=true;
|
||||||
|
chan[i].freqChanged=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateFilter();
|
updateFilter();
|
||||||
}
|
}
|
||||||
|
|
|
@ -578,6 +578,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
||||||
if (dumpWrites) addWrite(0xffff0002,0);
|
if (dumpWrites) addWrite(0xffff0002,0);
|
||||||
}
|
}
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_NOTE_OFF_ENV:
|
case DIV_CMD_NOTE_OFF_ENV:
|
||||||
|
@ -586,6 +587,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
||||||
if (dumpWrites) addWrite(0xffff0002,0);
|
if (dumpWrites) addWrite(0xffff0002,0);
|
||||||
}
|
}
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
chan[c.chan].std.release();
|
chan[c.chan].std.release();
|
||||||
break;
|
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_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));
|
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) {
|
if (dacMode) {
|
||||||
rWrite(0x2b,0x80);
|
rWrite(0x2b,0x80);
|
||||||
|
|
|
@ -81,6 +81,7 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
|
||||||
}
|
}
|
||||||
case DIV_CMD_NOTE_OFF:
|
case DIV_CMD_NOTE_OFF:
|
||||||
opChan[ch].keyOff=true;
|
opChan[ch].keyOff=true;
|
||||||
|
opChan[ch].keyOn=false;
|
||||||
opChan[ch].active=false;
|
opChan[ch].active=false;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_VOLUME: {
|
case DIV_CMD_VOLUME: {
|
||||||
|
@ -315,6 +316,10 @@ void DivPlatformGenesisExt::forceIns() {
|
||||||
DivPlatformGenesis::forceIns();
|
DivPlatformGenesis::forceIns();
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
opChan[i].insChanged=true;
|
opChan[i].insChanged=true;
|
||||||
|
if (opChan[i].active) {
|
||||||
|
opChan[i].keyOn=true;
|
||||||
|
opChan[i].freqChanged=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -515,6 +515,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
chan[c.chan].std.init(NULL);
|
chan[c.chan].std.init(NULL);
|
||||||
break;
|
break;
|
||||||
|
@ -528,6 +529,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
chan[c.chan].keyOff=true;
|
chan[c.chan].keyOff=true;
|
||||||
|
chan[c.chan].keyOn=false;
|
||||||
chan[c.chan].active=false;
|
chan[c.chan].active=false;
|
||||||
chan[c.chan].std.release();
|
chan[c.chan].std.release();
|
||||||
break;
|
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_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));
|
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++) {
|
for (int i=4; i<14; i++) {
|
||||||
chan[i].insChanged=true;
|
chan[i].insChanged=true;
|
||||||
|
|
|
@ -71,6 +71,7 @@ int DivPlatformYM2610Ext::dispatch(DivCommand c) {
|
||||||
}
|
}
|
||||||
case DIV_CMD_NOTE_OFF:
|
case DIV_CMD_NOTE_OFF:
|
||||||
opChan[ch].keyOff=true;
|
opChan[ch].keyOff=true;
|
||||||
|
opChan[ch].keyOn=false;
|
||||||
opChan[ch].active=false;
|
opChan[ch].active=false;
|
||||||
break;
|
break;
|
||||||
case DIV_CMD_VOLUME: {
|
case DIV_CMD_VOLUME: {
|
||||||
|
@ -282,6 +283,10 @@ void DivPlatformYM2610Ext::forceIns() {
|
||||||
DivPlatformYM2610::forceIns();
|
DivPlatformYM2610::forceIns();
|
||||||
for (int i=0; i<4; i++) {
|
for (int i=0; i<4; i++) {
|
||||||
opChan[i].insChanged=true;
|
opChan[i].insChanged=true;
|
||||||
|
if (opChan[i].active) {
|
||||||
|
opChan[i].keyOn=true;
|
||||||
|
opChan[i].freqChanged=true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"}
|
{"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 {
|
enum FMParams {
|
||||||
FM_ALG=0,
|
FM_ALG=0,
|
||||||
FM_FB=1,
|
FM_FB=1,
|
||||||
|
|
Loading…
Reference in a new issue