diff --git a/src/engine/fileOps/it.cpp b/src/engine/fileOps/it.cpp index 1a7449a74..8252d01f6 100644 --- a/src/engine/fileOps/it.cpp +++ b/src/engine/fileOps/it.cpp @@ -623,6 +623,9 @@ bool DivEngine::loadIT(unsigned char* file, size_t len) { } ds.systemLen=(maxChan+32)>>5; + // find subsongs + ds.findSubSongs(); + if (active) quitDispatch(); BUSY_BEGIN_SOFT; saveLock.lock(); diff --git a/src/engine/fileOps/mod.cpp b/src/engine/fileOps/mod.cpp index 9aa72e444..8cb3ea0c1 100644 --- a/src/engine/fileOps/mod.cpp +++ b/src/engine/fileOps/mod.cpp @@ -417,6 +417,9 @@ bool DivEngine::loadMod(unsigned char* file, size_t len) { ds.ins.push_back(ins); } ds.insLen=ds.ins.size(); + + // find subsongs + ds.findSubSongs(); if (active) quitDispatch(); BUSY_BEGIN_SOFT; diff --git a/src/engine/fileOps/s3m.cpp b/src/engine/fileOps/s3m.cpp index ee4dc823c..f0781d808 100644 --- a/src/engine/fileOps/s3m.cpp +++ b/src/engine/fileOps/s3m.cpp @@ -999,6 +999,9 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) { } } + // find subsongs + ds.findSubSongs(); + if (active) quitDispatch(); BUSY_BEGIN_SOFT; saveLock.lock(); diff --git a/src/engine/fileOps/xm.cpp b/src/engine/fileOps/xm.cpp index 8ebc32785..3fb8cbab0 100644 --- a/src/engine/fileOps/xm.cpp +++ b/src/engine/fileOps/xm.cpp @@ -370,6 +370,9 @@ bool DivEngine::loadXM(unsigned char* file, size_t len) { ds.sampleLen=ds.sample.size(); + // find subsongs + ds.findSubSongs(); + if (active) quitDispatch(); BUSY_BEGIN_SOFT; saveLock.lock(); diff --git a/src/engine/song.cpp b/src/engine/song.cpp index 816b152ea..760692bb6 100644 --- a/src/engine/song.cpp +++ b/src/engine/song.cpp @@ -128,6 +128,10 @@ void DivSubSong::makePatUnique() { } } +void DivSong::findSubSongs() { + +} + void DivSong::clearSongData() { for (DivSubSong* i: subsong) { i->clearData(); diff --git a/src/engine/song.h b/src/engine/song.h index af5597b24..f9e9bc740 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -353,6 +353,11 @@ struct DivSong { DivWavetable nullWave; DivSample nullSample; + /** + * find data past 0Bxx effects and place that into new sub-songs. + */ + void findSubSongs(); + /** * clear orders and patterns. */