From: <sv...@op...> - 2024-05-28 16:05:19
|
Author: sagamusix Date: Sat May 25 23:29:11 2024 New Revision: 20849 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20849 Log: [Imp] STK: Avoid importing auto slides if it's more likely that the commands are really supposesd to toggle the LED filter. Modified: trunk/OpenMPT/soundlib/Load_stk.cpp Modified: trunk/OpenMPT/soundlib/Load_stk.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_stk.cpp Sat May 25 23:04:22 2024 (r20848) +++ trunk/OpenMPT/soundlib/Load_stk.cpp Sat May 25 23:29:11 2024 (r20849) @@ -236,12 +236,13 @@ FileReader::pos_type patOffset = file.GetPosition(); - // Scan patterns to identify Ultimate Soundtracker modules. + // Scan patterns to identify Soundtracker versions and reject garbage. uint32 illegalBytes = 0, totalNumDxx = 0; + bool useAutoSlides = false; for(PATTERNINDEX pat = 0; pat < numPatterns; pat++) { const bool patternInUse = mpt::contains(Order(), pat); - uint8 numDxx = 0; + uint8 numDxx = 0, autoSlides = 0; uint8 emptyCmds = 0; MODPatternData patternData; file.ReadArray(patternData); @@ -318,6 +319,10 @@ break; } numDxx++; + } else if(eff == 0x0E) + { + if(param > 1 || ++autoSlides > 1) + useAutoSlides = true; } break; case 0x0F: @@ -395,7 +400,7 @@ { // Volume is sent as-is to the chip, which ignores the highest bit. param &= 0x7F; - } else if(command == 0x0E && (param > 0x01 || minVersion < ST_IX)) + } else if(command == 0x0E && (param > 0x01 || minVersion < ST_IX) && useAutoSlides) { // Import auto-slides as normal slides and fake them using volume column slides. command = 0x0A; |