fix E1xy/E2xy behaving wrong with arps

This commit is contained in:
tildearrow 2022-02-18 01:27:26 -05:00
parent f272f3f3f7
commit fbed03dd0c
6 changed files with 26 additions and 5 deletions

View File

@ -165,6 +165,7 @@ size | description
1 | target resets slides (>=45) or reserved 1 | target resets slides (>=45) or reserved
1 | arpeggio inhibits portamento (>=47) or reserved 1 | arpeggio inhibits portamento (>=47) or reserved
1 | wack algorithm macro (>=47) or reserved 1 | wack algorithm macro (>=47) or reserved
1 | broken shortcut slides (>=49) or reserved
8 | reserved 8 | reserved
4?? | pointers to instruments 4?? | pointers to instruments
4?? | pointers to wavetables 4?? | pointers to wavetables

View File

@ -1564,6 +1564,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.targetResetsSlides=true; ds.targetResetsSlides=true;
ds.arpNonPorta=false; ds.arpNonPorta=false;
ds.algMacroBehavior=false; ds.algMacroBehavior=false;
ds.brokenShortcutSlides=false;
// Neo Geo detune // Neo Geo detune
if (ds.system[0]==DIV_SYSTEM_YM2610 || ds.system[0]==DIV_SYSTEM_YM2610_EXT) { if (ds.system[0]==DIV_SYSTEM_YM2610 || ds.system[0]==DIV_SYSTEM_YM2610_EXT) {
@ -2113,6 +2114,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
ds.arpNonPorta=false; ds.arpNonPorta=false;
ds.algMacroBehavior=false; ds.algMacroBehavior=false;
} }
if (ds.version<49) {
ds.brokenShortcutSlides=true;
}
reader.readS(); // reserved reader.readS(); // reserved
int infoSeek=reader.readI(); int infoSeek=reader.readI();
@ -2230,7 +2234,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} else { } else {
reader.readC(); reader.readC();
} }
for (int i=0; i<8; i++) reader.readC(); if (ds.version>=49) {
ds.brokenShortcutSlides=reader.readC();
} else {
reader.readC();
}
for (int i=0; i<7; i++) reader.readC();
} else { } else {
for (int i=0; i<20; i++) reader.readC(); for (int i=0; i<20; i++) reader.readC();
} }
@ -2613,7 +2622,8 @@ SafeWriter* DivEngine::saveFur() {
w->writeC(song.targetResetsSlides); w->writeC(song.targetResetsSlides);
w->writeC(song.arpNonPorta); w->writeC(song.arpNonPorta);
w->writeC(song.algMacroBehavior); w->writeC(song.algMacroBehavior);
for (int i=0; i<8; i++) { w->writeC(song.brokenShortcutSlides);
for (int i=0; i<7; i++) {
w->writeC(0); w->writeC(0);
} }

View File

@ -30,8 +30,8 @@
#include <map> #include <map>
#include <queue> #include <queue>
#define DIV_VERSION "0.5.6" #define DIV_VERSION "0.5.7pre1"
#define DIV_ENGINE_VERSION 48 #define DIV_ENGINE_VERSION 49
enum DivStatusView { enum DivStatusView {
DIV_STATUS_NOTHING=0, DIV_STATUS_NOTHING=0,

View File

@ -685,8 +685,10 @@ void DivEngine::processRow(int i, bool afterDelay) {
if ((effectVal&15)!=0) { if ((effectVal&15)!=0) {
chan[i].inPorta=true; chan[i].inPorta=true;
chan[i].shorthandPorta=true; chan[i].shorthandPorta=true;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
} else { } else {
chan[i].inPorta=false; chan[i].inPorta=false;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0));
} }
break; break;
case 0xe2: // portamento down case 0xe2: // portamento down
@ -699,8 +701,10 @@ void DivEngine::processRow(int i, bool afterDelay) {
if ((effectVal&15)!=0) { if ((effectVal&15)!=0) {
chan[i].inPorta=true; chan[i].inPorta=true;
chan[i].shorthandPorta=true; chan[i].shorthandPorta=true;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
} else { } else {
chan[i].inPorta=false; chan[i].inPorta=false;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0));
} }
break; break;
case 0xe3: // vibrato direction case 0xe3: // vibrato direction

View File

@ -245,6 +245,7 @@ struct DivSong {
bool targetResetsSlides; bool targetResetsSlides;
bool arpNonPorta; bool arpNonPorta;
bool algMacroBehavior; bool algMacroBehavior;
bool brokenShortcutSlides;
DivOrders orders; DivOrders orders;
std::vector<DivInstrument*> ins; std::vector<DivInstrument*> ins;
@ -302,7 +303,8 @@ struct DivSong {
noteOffResetsSlides(true), noteOffResetsSlides(true),
targetResetsSlides(true), targetResetsSlides(true),
arpNonPorta(false), arpNonPorta(false),
algMacroBehavior(false) { algMacroBehavior(false),
brokenShortcutSlides(false) {
for (int i=0; i<32; i++) { for (int i=0; i<32; i++) {
system[i]=DIV_SYSTEM_NULL; system[i]=DIV_SYSTEM_NULL;
systemVol[i]=64; systemVol[i]=64;

View File

@ -1843,6 +1843,10 @@ void FurnaceGUI::drawCompatFlags() {
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.5.5"); ImGui::SetTooltip("behavior changed in 0.5.5");
} }
ImGui::Checkbox("Broken shortcut slides (E1xy/E2xy)",&e->song.brokenShortcutSlides);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("behavior changed in 0.5.7");
}
} }
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS; if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_COMPAT_FLAGS;
ImGui::End(); ImGui::End();