- this is a work-in-progress chiptune tracker which interacts with DefleMask module files (.dmf).
+ the biggest chiptune tracker ever made!
- it supports creating songs for Sega Genesis, Master System, Game Boy, PC Engine, NES, C64, YM2151/PCM and Neo Geo. featuring a clean-room design (zero reverse-engineered code and zero decompilation; using official DMF specs, guesswork and ABX tests only), bug/quirk implementation for increased playback accuracy, and accurate emulation cores whether possible (Nuked, MAME, SameBoy, Mednafen PCE, puNES, reSID and ymfm).
+ it allows you to create songs using a music tracker interface for several computer/game console/arcade sound chips.
+
+
+ it also offers DefleMask compatibility, allowing you to import your songs and even export them back for interoperability.
diff --git a/src/engine/engine.h b/src/engine/engine.h
index 8c054c39..962e0fcc 100644
--- a/src/engine/engine.h
+++ b/src/engine/engine.h
@@ -45,8 +45,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false;
-#define DIV_VERSION "dev99"
-#define DIV_ENGINE_VERSION 99
+#define DIV_VERSION "0.6pre1"
+#define DIV_ENGINE_VERSION 100
// for imports
#define DIV_VERSION_MOD 0xff01
@@ -88,7 +88,7 @@ struct DivChannelState {
int tremoloDepth, tremoloRate, tremoloPos;
unsigned char arp, arpStage, arpTicks, panL, panR;
bool doNote, legato, portaStop, keyOn, keyOff, nowYouCanStop, stopOnOff;
- bool arpYield, delayLocked, inPorta, scheduledSlideReset, shorthandPorta, noteOnInhibit, resetArp;
+ bool arpYield, delayLocked, inPorta, scheduledSlideReset, shorthandPorta, wasShorthandPorta, noteOnInhibit, resetArp;
int midiNote, curMidiNote, midiPitch;
size_t midiAge;
@@ -136,6 +136,7 @@ struct DivChannelState {
inPorta(false),
scheduledSlideReset(false),
shorthandPorta(false),
+ wasShorthandPorta(false),
noteOnInhibit(false),
resetArp(false),
midiNote(-1),
diff --git a/src/engine/fileOps.cpp b/src/engine/fileOps.cpp
index 7a4fb8f1..d4c45323 100644
--- a/src/engine/fileOps.cpp
+++ b/src/engine/fileOps.cpp
@@ -171,6 +171,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.newVolumeScaling=false;
ds.volMacroLinger=false;
ds.brokenOutVol=true; // ???
+ ds.e1e2StopOnSameNote=true;
// 1.1 compat flags
if (ds.version>24) {
@@ -1043,6 +1044,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
ds.volMacroLinger=false;
ds.brokenOutVol=true;
}
+ if (ds.version<100) {
+ ds.e1e2StopOnSameNote=false;
+ }
ds.isDMF=false;
reader.readS(); // reserved
@@ -1439,7 +1443,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
reader.readC();
reader.readC();
}
- for (int i=0; i<9; i++) {
+ if (ds.version>=100) {
+ ds.e1e2StopOnSameNote=reader.readC();
+ } else {
+ reader.readC();
+ }
+ for (int i=0; i<8; i++) {
reader.readC();
}
}
@@ -2912,7 +2921,8 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
w->writeC(song.newVolumeScaling);
w->writeC(song.volMacroLinger);
w->writeC(song.brokenOutVol);
- for (int i=0; i<9; i++) {
+ w->writeC(song.e1e2StopOnSameNote);
+ for (int i=0; i<8; i++) {
w->writeC(0);
}
diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp
index 02d3228f..d672c2d4 100644
--- a/src/engine/playback.cpp
+++ b/src/engine/playback.cpp
@@ -456,6 +456,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].nowYouCanStop=false;
chan[i].stopOnOff=false;
chan[i].scheduledSlideReset=false;
+ chan[i].wasShorthandPorta=false;
chan[i].inPorta=false;
if (!song.arpNonPorta) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
}
@@ -475,6 +476,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].nowYouCanStop=false;
chan[i].stopOnOff=false;
chan[i].scheduledSlideReset=false;
+ chan[i].wasShorthandPorta=false;
chan[i].inPorta=false;
if (!song.arpNonPorta) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
}
@@ -494,6 +496,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
chan[i].portaNote=chan[i].note;
chan[i].portaSpeed=effectVal;
chan[i].inPorta=true;
+ chan[i].wasShorthandPorta=false;
}
chan[i].portaStop=true;
if (chan[i].keyOn) chan[i].doNote=false;
@@ -573,6 +576,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
if ((effectVal&15)!=0) {
chan[i].inPorta=true;
chan[i].shorthandPorta=true;
+ chan[i].wasShorthandPorta=true;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
if (song.e1e2AlsoTakePriority) lastSlide=0x1337; // ...
} else {
@@ -590,6 +594,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
if ((effectVal&15)!=0) {
chan[i].inPorta=true;
chan[i].shorthandPorta=true;
+ chan[i].wasShorthandPorta=true;
if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,true,0));
if (song.e1e2AlsoTakePriority) lastSlide=0x1337; // ...
} else {
@@ -715,7 +720,14 @@ void DivEngine::processRow(int i, bool afterDelay) {
dispatchCmd(DivCommand(DIV_CMD_LEGATO,i,chan[i].note));
} else {
if (chan[i].inPorta && chan[i].keyOn && !chan[i].shorthandPorta) {
- chan[i].portaNote=chan[i].note;
+ if (song.e1e2StopOnSameNote && chan[i].wasShorthandPorta) {
+ chan[i].portaSpeed=-1;
+ if (!song.brokenShortcutSlides) dispatchCmd(DivCommand(DIV_CMD_PRE_PORTA,i,false,0));
+ chan[i].wasShorthandPorta=false;
+ chan[i].inPorta=false;
+ } else {
+ chan[i].portaNote=chan[i].note;
+ }
} else if (!chan[i].noteOnInhibit) {
dispatchCmd(DivCommand(DIV_CMD_NOTE_ON,i,chan[i].note,chan[i].volume>>8));
keyHit[i]=true;
diff --git a/src/engine/song.h b/src/engine/song.h
index df622d86..2248292e 100644
--- a/src/engine/song.h
+++ b/src/engine/song.h
@@ -494,6 +494,7 @@ struct DivSong {
bool newVolumeScaling;
bool volMacroLinger;
bool brokenOutVol;
+ bool e1e2StopOnSameNote;
std::vector