what the hell

This commit is contained in:
tildearrow 2025-11-09 01:56:36 -05:00
parent f45bb97318
commit 734f36b483
4 changed files with 20 additions and 4 deletions

View file

@ -1103,6 +1103,9 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
}
}
// store channel count for later
int chCount=getChannelCount(ds.system[0]);
// handle compound systems
if (ds.system[0]==DIV_SYSTEM_GENESIS) {
ds.systemLen=2;
@ -1167,7 +1170,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
}
// always convert to normal sample mode (I have no idea how will I do export)
ds.convertLegacySampleMode();
ds.convertLegacySampleMode(chCount);
ds.systemName=getSongSystemLegacyName(ds,!getConfInt("noMultiSystem",0));

View file

@ -2183,7 +2183,7 @@ bool DivEngine::loadFur(unsigned char* file, size_t len, int variantID) {
// removal of legacy sample mode
if (ds.version<239) {
ds.convertLegacySampleMode();
ds.convertLegacySampleMode(tchans);
}
if (active) quitDispatch();

View file

@ -732,6 +732,19 @@ void DivSong::unload() {
// from this point onwards, a mess.
void DivSong::convertLegacySampleMode() {
void DivSong::convertLegacySampleMode(int chans) {
for (DivSubSong* h: subsong) {
for (int i=0; i<chans; i++) {
unsigned char sampleMode=0;
for (int j=0; j<h->ordersLen; j++) {
DivPattern* p=h->pat[i].data[h->orders.ord[i][j]];
if (p==NULL) continue;
switch (
for (int k=0; k<h->patLen; k++) {
}
}
}
}
}

View file

@ -411,7 +411,7 @@ struct DivSong {
/**
* try to convert usage of legacy sample mode into normal mode.
*/
void convertLegacySampleMode();
void convertLegacySampleMode(int chans);
/**
* clear orders and patterns.