diff --git OpenMPT/soundlib/Load_mod.cpp OpenMPT/soundlib/Load_mod.cpp index 33c791a..582b648 100644 --- OpenMPT/soundlib/Load_mod.cpp +++ OpenMPT/soundlib/Load_mod.cpp @@ -936,7 +936,7 @@ bool CSoundFile::ReadM15(FileReader &file, ModLoadingFlags loadFlags) totalSampleLen += Samples[smp].nLength; - if(m_szNames[smp][0] && ((memcmp(m_szNames[smp], "st-", 3) && memcmp(m_szNames[smp], "ST-", 3)) || m_szNames[smp][0] < '0' || m_szNames[smp][0] > '9')) + if(m_szNames[smp][0] && ((memcmp(m_szNames[smp], "st-", 3) && memcmp(m_szNames[smp], "ST-", 3)) || m_szNames[smp][5] != ':')) { // Ultimate Soundtracker 1.8 and D.O.C. SoundTracker IX always have sample names containing disk names. hasDiskNames = false; @@ -1018,8 +1018,10 @@ bool CSoundFile::ReadM15(FileReader &file, ModLoadingFlags loadFlags) { uint8 data[4]; file.ReadArray(data); + const ROWINDEX row = i / 4; const uint8 eff = data[2] & 0x0F, param = data[3]; - if(emptyCmds != 0 && !memcmp(data, "\0\0\0\0", 4)) + // Check for empty space between the last Dxx command and the beginning of another pattern + if(emptyCmds != 0 && (row & 63) != 0 && !memcmp(data, "\0\0\0\0", 4)) { emptyCmds++; if(emptyCmds > 32) @@ -1041,7 +1043,7 @@ bool CSoundFile::ReadM15(FileReader &file, ModLoadingFlags loadFlags) { // If a 1xx / 2xx effect has a parameter greater than 0x20, it is assumed to be UST. minVersion = hasDiskNames ? UST1_80 : UST1_00; - } else if(eff == 1 && param < 0x03) + } else if(eff == 1 && param > 0 && param < 0x03) { // This doesn't look like an arpeggio. minVersion = std::max(minVersion, ST2_00_Exterminator); @@ -1054,12 +1056,18 @@ bool CSoundFile::ReadM15(FileReader &file, ModLoadingFlags loadFlags) case 0x0D: case 0x0E: minVersion = std::max(minVersion, ST2_00_Exterminator); - if(eff == 0x0D && param == 0) + if(eff == 0x0D) { - // Assume this is a pattern break command. - minVersion = std::max(minVersion, ST2_00); + emptyCmds = 1; + if (param == 0 && (row & 1) != 0) + { + // Assume this is a pattern break command. + // (now only if it's on an odd-numbered row, like it usually is. + // This fixes "digital touch" by SLL, which does runs of + // D00 D04 D08 D0F volslides repeatedly in one of its patterns) + minVersion = std::max(minVersion, ST2_00); + } } - emptyCmds = 1; break; case 0x0F: minVersion = std::max(minVersion, ST_III); @@ -1184,7 +1192,7 @@ bool CSoundFile::ReadM15(FileReader &file, ModLoadingFlags loadFlags) m_madeWithTracker = "Ultimate Soundtracker 1.8-2.0"; break; case ST2_00_Exterminator: - m_madeWithTracker = "SoundTracker 2.0 / D.O.C. Sountracker II"; + m_madeWithTracker = "SoundTracker 2.0 / D.O.C. SoundTracker II"; break; case ST_III: m_madeWithTracker = "Defjam Soundtracker III / Alpha Flight SoundTracker IV / D.O.C. SoundTracker IV / VI";