From 734f36b483ffaf5ad991bce7a3b2a79d79db277e Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 9 Nov 2025 01:56:36 -0500 Subject: [PATCH] what the hell --- src/engine/fileOps/dmf.cpp | 5 ++++- src/engine/fileOps/fur.cpp | 2 +- src/engine/song.cpp | 15 ++++++++++++++- src/engine/song.h | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/engine/fileOps/dmf.cpp b/src/engine/fileOps/dmf.cpp index 2ae9d2a92..ac517df40 100644 --- a/src/engine/fileOps/dmf.cpp +++ b/src/engine/fileOps/dmf.cpp @@ -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)); diff --git a/src/engine/fileOps/fur.cpp b/src/engine/fileOps/fur.cpp index ab80bc076..922499952 100644 --- a/src/engine/fileOps/fur.cpp +++ b/src/engine/fileOps/fur.cpp @@ -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(); diff --git a/src/engine/song.cpp b/src/engine/song.cpp index b7b363295..4f20b34e1 100644 --- a/src/engine/song.cpp +++ b/src/engine/song.cpp @@ -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; iordersLen; j++) { + DivPattern* p=h->pat[i].data[h->orders.ord[i][j]]; + if (p==NULL) continue; + switch ( + for (int k=0; kpatLen; k++) { + + } + } + } + } } diff --git a/src/engine/song.h b/src/engine/song.h index 2384dd51e..8d5d5c8c0 100644 --- a/src/engine/song.h +++ b/src/engine/song.h @@ -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.