dev195 - C64: prevent cutoff macro race

issue #1790
This commit is contained in:
tildearrow 2024-03-13 02:11:57 -05:00
parent e1c4b20ef9
commit 7ffc67529c
5 changed files with 16 additions and 5 deletions

View file

@ -54,8 +54,8 @@ class DivWorkPool;
#define DIV_UNSTABLE #define DIV_UNSTABLE
#define DIV_VERSION "dev194" #define DIV_VERSION "dev195"
#define DIV_ENGINE_VERSION 194 #define DIV_ENGINE_VERSION 195
// 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

@ -1033,11 +1033,12 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.systemFlags[0].set("dpcmMode",false); ds.systemFlags[0].set("dpcmMode",false);
} }
// C64 no key priority, reset time and multiply relative // C64 no key priority, reset time, multiply relative and macro race
if (ds.system[0]==DIV_SYSTEM_C64_8580 || ds.system[0]==DIV_SYSTEM_C64_6581) { 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("keyPriority",false);
ds.systemFlags[0].set("initResetTime",1); ds.systemFlags[0].set("initResetTime",1);
ds.systemFlags[0].set("multiplyRel",true); ds.systemFlags[0].set("multiplyRel",true);
ds.systemFlags[0].set("macroRace",true);
} }
// OPM broken pitch // OPM broken pitch

View file

@ -2064,6 +2064,15 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} }
} }
// C64 macro race
if (ds.version<195) {
for (int i=0; i<ds.systemLen; i++) {
if (ds.system[i]==DIV_SYSTEM_C64_8580 || ds.system[i]==DIV_SYSTEM_C64_6581) {
ds.systemFlags[i].set("macroRace",true);
}
}
}
if (active) quitDispatch(); if (active) quitDispatch();
BUSY_BEGIN_SOFT; BUSY_BEGIN_SOFT;
saveLock.lock(); saveLock.lock();

View file

@ -198,7 +198,7 @@ void DivPlatformC64::tick(bool sysTick) {
} }
chan[i].freqChanged=true; chan[i].freqChanged=true;
} }
if (chan[i].std.alg.had) { // new cutoff macro if (chan[i].std.alg.had && (_i==2 || macroRace)) { // new cutoff macro
DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_C64); DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_C64);
if (ins->c64.filterIsAbs) { if (ins->c64.filterIsAbs) {
filtCut=MIN(2047,chan[i].std.alg.val); filtCut=MIN(2047,chan[i].std.alg.val);
@ -732,6 +732,7 @@ void DivPlatformC64::setFlags(const DivConfig& flags) {
keyPriority=flags.getBool("keyPriority",true); keyPriority=flags.getBool("keyPriority",true);
no1EUpdate=flags.getBool("no1EUpdate",false); no1EUpdate=flags.getBool("no1EUpdate",false);
multiplyRel=flags.getBool("multiplyRel",false); multiplyRel=flags.getBool("multiplyRel",false);
macroRace=flags.getBool("macroRace",false);
testAD=((flags.getInt("testAttack",0)&15)<<4)|(flags.getInt("testDecay",0)&15); testAD=((flags.getInt("testAttack",0)&15)<<4)|(flags.getInt("testDecay",0)&15);
testSR=((flags.getInt("testSustain",0)&15)<<4)|(flags.getInt("testRelease",0)&15); testSR=((flags.getInt("testSustain",0)&15)<<4)|(flags.getInt("testRelease",0)&15);
initResetTime=flags.getInt("initResetTime",2); initResetTime=flags.getInt("initResetTime",2);

View file

@ -77,7 +77,7 @@ class DivPlatformC64: public DivDispatch {
unsigned char sidCore; unsigned char sidCore;
int filtCut, resetTime, initResetTime; int filtCut, resetTime, initResetTime;
bool keyPriority, sidIs6581, needInitTables, no1EUpdate, multiplyRel; bool keyPriority, sidIs6581, needInitTables, no1EUpdate, multiplyRel, macroRace;
unsigned char chanOrder[3]; unsigned char chanOrder[3];
unsigned char testAD, testSR; unsigned char testAD, testSR;