diff --git a/src/engine/engine.h b/src/engine/engine.h index 394639505..f4c46de32 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -54,8 +54,8 @@ class DivWorkPool; #define DIV_UNSTABLE -#define DIV_VERSION "dev185" -#define DIV_ENGINE_VERSION 185 +#define DIV_VERSION "dev186" +#define DIV_ENGINE_VERSION 186 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index 78b79cb5b..0175c02e2 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -3008,6 +3008,15 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) { } } + // C64 1Exy compat + if (ds.version<186) { + for (int i=0; i>4) { case 0: chan[c.chan].attack=c.value&15; + if (!no1EUpdate) { + rWrite(c.chan*7+5,(chan[c.chan].attack<<4)|(chan[c.chan].decay)); + } break; case 1: chan[c.chan].decay=c.value&15; + if (!no1EUpdate) { + rWrite(c.chan*7+5,(chan[c.chan].attack<<4)|(chan[c.chan].decay)); + } break; case 2: chan[c.chan].sustain=c.value&15; + if (!no1EUpdate) { + rWrite(c.chan*7+6,(chan[c.chan].sustain<<4)|(chan[c.chan].release)); + } break; case 3: chan[c.chan].release=c.value&15; + if (!no1EUpdate) { + rWrite(c.chan*7+6,(chan[c.chan].sustain<<4)|(chan[c.chan].release)); + } break; case 4: chan[c.chan].ring=c.value; @@ -652,6 +664,7 @@ void DivPlatformC64::setFlags(const DivConfig& flags) { if (sidCore==1) sid_fp->setSamplingParameters(chipClock,reSIDfp::DECIMATE,rate,0); } keyPriority=flags.getBool("keyPriority",true); + no1EUpdate=flags.getBool("no1EUpdate",false); testAD=((flags.getInt("testAttack",0)&15)<<4)|(flags.getInt("testDecay",0)&15); testSR=((flags.getInt("testSustain",0)&15)<<4)|(flags.getInt("testRelease",0)&15); diff --git a/src/engine/platform/c64.h b/src/engine/platform/c64.h index 38e735d9a..67ead6aa7 100644 --- a/src/engine/platform/c64.h +++ b/src/engine/platform/c64.h @@ -72,7 +72,7 @@ class DivPlatformC64: public DivDispatch { unsigned char sidCore; int filtCut, resetTime; - bool keyPriority, sidIs6581, needInitTables; + bool keyPriority, sidIs6581, needInitTables, no1EUpdate; unsigned char chanOrder[3]; unsigned char testAD, testSR; diff --git a/src/gui/sysConf.cpp b/src/gui/sysConf.cpp index b8caa7390..19a42a877 100644 --- a/src/gui/sysConf.cpp +++ b/src/gui/sysConf.cpp @@ -586,6 +586,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl case DIV_SYSTEM_C64_6581: { int clockSel=flags.getInt("clockSel",0); bool keyPriority=flags.getBool("keyPriority",true); + bool no1EUpdate=flags.getBool("no1EUpdate",false); int testAttack=flags.getInt("testAttack",0); int testDecay=flags.getInt("testDecay",0); int testSustain=flags.getInt("testSustain",0); @@ -644,10 +645,15 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl altered=true; } + if (ImGui::Checkbox("Disable 1Exy env ipdate (compatibility)",&no1EUpdate)) { + altered=true; + } + if (altered) { e->lockSave([&]() { flags.set("clockSel",clockSel); flags.set("keyPriority",keyPriority); + flags.set("no1EUpdate",no1EUpdate); flags.set("testAttack",testAttack); flags.set("testDecay",testDecay); flags.set("testSustain",testSustain);