From f05d1693f8448e8df7fbc1810eee2f0a65fbbe34 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 29 Oct 2023 04:14:54 -0500 Subject: [PATCH] C64: add chip flag to set env reset time 2 by default 1 for .dmf and old Furnace songs --- src/engine/fileOps.cpp | 12 +++++++++++- src/engine/platform/c64.cpp | 4 +++- src/engine/platform/c64.h | 2 +- src/gui/sysConf.cpp | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp index 2d27d8b52..d7b515402 100644 --- a/src/engine/fileOps.cpp +++ b/src/engine/fileOps.cpp @@ -1062,9 +1062,10 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) { ds.systemFlags[0].set("dpcmMode",false); } - // C64 no key priority + // C64 no key priority and reset time if (ds.system[0]==DIV_SYSTEM_C64_8580 || ds.system[0]==DIV_SYSTEM_C64_6581) { ds.systemFlags[0].set("keyPriority",false); + ds.systemFlags[0].set("initResetTime",1); } // OPM broken pitch @@ -3033,6 +3034,15 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) { } } + // C64 original reset time + if (ds.version<187) { + for (int i=0; i4); + if (CWSliderInt("##InitReset",&initResetTime,0,16)) { + if (initResetTime<0) initResetTime=0; + if (initResetTime>16) initResetTime=16; + altered=true; + } + popWarningColor(); + + ImGui::Text("- 0 disables envelope reset. not recommended!\n- 1 may trigger SID envelope bugs.\n- values that are too high may result in notes being skipped."); + if (ImGui::Checkbox("Disable 1Exy env update (compatibility)",&no1EUpdate)) { altered=true; } @@ -658,6 +671,7 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl flags.set("testDecay",testDecay); flags.set("testSustain",testSustain); flags.set("testRelease",testRelease); + flags.set("initResetTime",initResetTime); }); } break;