dev83 - yet another E1xy/E2xy fix

and 17xx fix in ExtCh
This commit is contained in:
tildearrow 2022-04-13 00:34:00 -05:00
parent aab7cf2512
commit fbf7f9304e
7 changed files with 47 additions and 7 deletions

View file

@ -42,8 +42,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false;
#define DIV_VERSION "dev82"
#define DIV_ENGINE_VERSION 82
#define DIV_VERSION "dev83"
#define DIV_ENGINE_VERSION 83
// for imports
#define DIV_VERSION_MOD 0xff01

View file

@ -154,6 +154,8 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.ignoreJumpAtEnd=true;
ds.buggyPortaAfterSlide=true;
ds.gbInsAffectsEnvelope=true;
ds.ignoreDACModeOutsideIntendedChannel=false;
ds.e1e2AlsoTakePriority=true;
// 1.1 compat flags
if (ds.version>24) {
@ -1315,7 +1317,14 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} else {
reader.readC();
}
for (int i=0; i<25; i++) {
if (ds.version>=82) {
ds.ignoreDACModeOutsideIntendedChannel=reader.readC();
ds.e1e2AlsoTakePriority=reader.readC();
} else {
reader.readC();
reader.readC();
}
for (int i=0; i<23; i++) {
reader.readC();
}
}
@ -2219,7 +2228,9 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
w->writeC(song.buggyPortaAfterSlide);
w->writeC(song.gbInsAffectsEnvelope);
w->writeC(song.sharedExtStat);
for (int i=0; i<25; i++) {
w->writeC(song.ignoreDACModeOutsideIntendedChannel);
w->writeC(song.e1e2AlsoTakePriority);
for (int i=0; i<23; i++) {
w->writeC(0);
}

View file

@ -156,9 +156,21 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
break;
}
case DIV_CMD_SAMPLE_MODE: {
// ignored on extended channel 3 mode.
// not ignored actually!
if (!parent->song.ignoreDACModeOutsideIntendedChannel) {
dacMode=c.value;
rWrite(0x2b,c.value<<7);
}
break;
}
case DIV_CMD_SAMPLE_BANK:
if (!parent->song.ignoreDACModeOutsideIntendedChannel) {
sampleBank=c.value;
if (sampleBank>(parent->song.sample.size()/12)) {
sampleBank=parent->song.sample.size()/12;
}
}
break;
case DIV_CMD_LEGATO: {
opChan[ch].baseFreq=NOTE_FREQUENCY(c.value);
opChan[ch].freqChanged=true;

View file

@ -1174,6 +1174,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].inPorta=true;
chan[i].shorthandPorta=true;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
if (song.e1e2AlsoTakePriority) lastSlide=0x1337; // ...
} else {
chan[i].inPorta=false;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0));
@ -1190,6 +1191,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].inPorta=true;
chan[i].shorthandPorta=true;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
if (song.e1e2AlsoTakePriority) lastSlide=0x1337; // ...
} else {
chan[i].inPorta=false;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0));

View file

@ -321,6 +321,8 @@ struct DivSong {
bool buggyPortaAfterSlide;
bool gbInsAffectsEnvelope;
bool sharedExtStat;
bool ignoreDACModeOutsideIntendedChannel;
bool e1e2AlsoTakePriority;
DivOrders orders;
std::vector<DivInstrument*> ins;
@ -400,7 +402,9 @@ struct DivSong {
ignoreJumpAtEnd(false),
buggyPortaAfterSlide(false),
gbInsAffectsEnvelope(true),
sharedExtStat(true) {
sharedExtStat(true),
ignoreDACModeOutsideIntendedChannel(false),
e1e2AlsoTakePriority(false) {
for (int i=0; i<32; i++) {
system[i]=DIV_SYSTEM_NULL;
systemVol[i]=64;