dev155 - fix broken macro after note off in some

FM chips

issue #1017
This commit is contained in:
tildearrow 2023-05-05 02:14:53 -05:00
parent 2ad258823f
commit 565f67dd0f
9 changed files with 27 additions and 9 deletions

View file

@ -32,6 +32,9 @@ these fields are 0 in format versions prior to 100 (0.6pre1).
the format versions are: the format versions are:
- 155: Furnace dev155
- 154: Furnace dev154
- 153: Furnace dev153
- 152: Furnace dev152 - 152: Furnace dev152
- 151: Furnace dev151 - 151: Furnace dev151
- 150: Furnace dev150 - 150: Furnace dev150
@ -422,7 +425,8 @@ size | description
1 | automatic patchbay (>=136) 1 | automatic patchbay (>=136)
--- | **a couple more compat flags** (>=138) --- | **a couple more compat flags** (>=138)
1 | broken portamento during legato 1 | broken portamento during legato
7 | reserved 1 | broken macro during note off in some FM chips (>=155)
6 | reserved
--- | **speed pattern of first song** (>=139) --- | **speed pattern of first song** (>=139)
1 | length of speed pattern (fail if this is lower than 0 or higher than 16) 1 | length of speed pattern (fail if this is lower than 0 or higher than 16)
16 | speed pattern (this overrides speed 1 and speed 2 settings) 16 | speed pattern (this overrides speed 1 and speed 2 settings)

View file

@ -53,8 +53,8 @@
#define EXTERN_BUSY_BEGIN_SOFT e->softLocked=true; e->isBusy.lock(); #define EXTERN_BUSY_BEGIN_SOFT e->softLocked=true; e->isBusy.lock();
#define EXTERN_BUSY_END e->isBusy.unlock(); e->softLocked=false; #define EXTERN_BUSY_END e->isBusy.unlock(); e->softLocked=false;
#define DIV_VERSION "dev154" #define DIV_VERSION "dev155"
#define DIV_ENGINE_VERSION 154 #define DIV_ENGINE_VERSION 155
// for imports // for imports
#define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02 #define DIV_VERSION_FC 0xff02

View file

@ -1792,6 +1792,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version<138) { if (ds.version<138) {
ds.brokenPortaLegato=true; ds.brokenPortaLegato=true;
} }
if (ds.version<155) {
ds.brokenFMOff=true;
}
ds.isDMF=false; ds.isDMF=false;
reader.readS(); // reserved reader.readS(); // reserved
@ -2300,7 +2303,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version>=138) { if (ds.version>=138) {
ds.brokenPortaLegato=reader.readC(); ds.brokenPortaLegato=reader.readC();
for (int i=0; i<7; i++) { if (ds.version>=155) {
ds.brokenFMOff=reader.readC();
} else {
reader.readC();
}
for (int i=0; i<6; i++) {
reader.readC(); reader.readC();
} }
} }

View file

@ -567,7 +567,7 @@ int DivPlatformYM2203::dispatch(DivCommand c) {
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false; chan[c.chan].keyOn=false;
chan[c.chan].active=false; chan[c.chan].active=false;
chan[c.chan].macroInit(NULL); if (parent->song.brokenFMOff) chan[c.chan].macroInit(NULL);
break; break;
case DIV_CMD_NOTE_OFF_ENV: case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;

View file

@ -1007,7 +1007,7 @@ int DivPlatformYM2608::dispatch(DivCommand c) {
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false; chan[c.chan].keyOn=false;
chan[c.chan].active=false; chan[c.chan].active=false;
chan[c.chan].macroInit(NULL); if (parent->song.brokenFMOff) chan[c.chan].macroInit(NULL);
break; break;
case DIV_CMD_NOTE_OFF_ENV: case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;

View file

@ -979,7 +979,7 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false; chan[c.chan].keyOn=false;
chan[c.chan].active=false; chan[c.chan].active=false;
chan[c.chan].macroInit(NULL); if (parent->song.brokenFMOff) chan[c.chan].macroInit(NULL);
break; break;
case DIV_CMD_NOTE_OFF_ENV: case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;

View file

@ -1046,7 +1046,7 @@ int DivPlatformYM2610B::dispatch(DivCommand c) {
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;
chan[c.chan].keyOn=false; chan[c.chan].keyOn=false;
chan[c.chan].active=false; chan[c.chan].active=false;
chan[c.chan].macroInit(NULL); if (parent->song.brokenFMOff) chan[c.chan].macroInit(NULL);
break; break;
case DIV_CMD_NOTE_OFF_ENV: case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].keyOff=true; chan[c.chan].keyOff=true;

View file

@ -352,6 +352,7 @@ struct DivSong {
bool oldArpStrategy; bool oldArpStrategy;
bool patchbayAuto; bool patchbayAuto;
bool brokenPortaLegato; bool brokenPortaLegato;
bool brokenFMOff;
std::vector<DivInstrument*> ins; std::vector<DivInstrument*> ins;
std::vector<DivWavetable*> wave; std::vector<DivWavetable*> wave;
@ -467,7 +468,8 @@ struct DivSong {
autoSystem(true), autoSystem(true),
oldArpStrategy(false), oldArpStrategy(false),
patchbayAuto(true), patchbayAuto(true),
brokenPortaLegato(false) { brokenPortaLegato(false),
brokenFMOff(false) {
for (int i=0; i<DIV_MAX_CHIPS; i++) { for (int i=0; i<DIV_MAX_CHIPS; i++) {
system[i]=DIV_SYSTEM_NULL; system[i]=DIV_SYSTEM_NULL;
systemVol[i]=1.0; systemVol[i]=1.0;

View file

@ -180,6 +180,10 @@ void FurnaceGUI::drawCompatFlags() {
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6pre4"); ImGui::SetTooltip("behavior changed in 0.6pre4");
} }
ImGui::Checkbox("Broken macros in some FM chips after note off",&e->song.brokenFMOff);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.6pre5");
}
ImGui::EndTabItem(); ImGui::EndTabItem();
} }
if (ImGui::BeginTabItem(".mod import")) { if (ImGui::BeginTabItem(".mod import")) {