.ftm import: convert wave pos to nibbles

This commit is contained in:
tildearrow 2026-01-18 16:38:38 -05:00
parent 5e715f21ba
commit 6d52cd370a

View file

@ -1944,10 +1944,14 @@ bool DivEngine::loadFTM(unsigned char* file, size_t len, bool dnft, bool dnft_si
if (pat->newData[row][DIV_PAT_FX(j)] == 0x12) {
pat->newData[row][DIV_PAT_FX(j)] = 0x110; // N163 wave change (we'll map this later)
} else if (pat->newData[row][DIV_PAT_FX(j)] == 0x11) {
// wave position (a value of 7F has special meaning)
// wave position:
// - in FamiTracker this is in bytes
// - a value of 7F has special meaning
if (pat->newData[row][DIV_PAT_FXVAL(j)]==0x7f) {
pat->newData[row][DIV_PAT_FX(j)]=-1;
pat->newData[row][DIV_PAT_FXVAL(j)]=-1;
} else {
pat->newData[row][DIV_PAT_FXVAL(j)]=MIN(pat->newData[row][DIV_PAT_FXVAL(j)]<<1,0xff);
}
}
}