From 772a7a414462dddfeb1258bedf546e54a6e0b5b0 Mon Sep 17 00:00:00 2001 From: techmetx11 Date: Thu, 11 Apr 2024 15:58:54 +0000 Subject: [PATCH] Fix notes and patterns that don't have the same size as the biggest pattern in the song --- src/engine/fileOps/tfm.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/engine/fileOps/tfm.cpp b/src/engine/fileOps/tfm.cpp index df53f6511..104b5e5d4 100644 --- a/src/engine/fileOps/tfm.cpp +++ b/src/engine/fileOps/tfm.cpp @@ -346,9 +346,19 @@ bool DivEngine::loadTFM(unsigned char* file, size_t len) { unsigned char invertedNote=~patDataBuf[k]; pat->data[k][0]=invertedNote%12; pat->data[k][1]=(invertedNote/12)-1; + + if (pat->data[k][0]==0) { + pat->data[k][0]=12; + pat->data[k][1]--; + } } } + // put a "jump to next pattern" effect if the pattern is smaller than the maximum pattern lengths + if (patLens[i]!=0 && patLens[i]patLen) { + pat->data[patLens[i]][4]=0x0D; + pat->data[patLens[i]][5]=0x00; + } // volume reader.read(patDataBuf, 256);