Fix notes and patterns that don't have the same size as the biggest

pattern in the song
This commit is contained in:
techmetx11 2024-04-11 15:58:54 +00:00
parent 1de99ca6c6
commit 772a7a4144
No known key found for this signature in database
GPG key ID: 20E0C88A0E7E5AF2

View file

@ -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]<ds.subsong[0]->patLen) {
pat->data[patLens[i]][4]=0x0D;
pat->data[patLens[i]][5]=0x00;
}
// volume
reader.read(patDataBuf, 256);