Skip to content

Commit

Permalink
Merged revision(s) 20305 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] IT: Allow Zxx to be used again in IT files made with older MPT versions (https://bugs.openmpt.org/view.php?id=1753).
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.29@20308 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed Mar 9, 2024
1 parent 3abb386 commit 77773dd
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions soundlib/Load_it.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,6 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags)
m_MidiCfg.Sanitize();
}

// Ignore MIDI data. Fixes some files like denonde.it that were made with old versions of Impulse Tracker (which didn't support Zxx filters) and have Zxx effects in the patterns.
// Example: denonde.it by Mystical
// Note: Do not compare against cwtv value, as IT 2.14 and 2.15 may write lower values there (see spx-visionsofthepast.it).
if(fileHeader.cmwt < 0x0214)
{
m_MidiCfg.ClearZxxMacros();
}

// Read pattern names: "PNAM"
FileReader patNames;
if(file.ReadMagic("PNAM"))
Expand Down Expand Up @@ -1265,6 +1257,17 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags)
}
}

// Ignore MIDI data. Fixes some files like denonde.it that were made with old versions of Impulse Tracker (which didn't support Zxx filters) and have Zxx effects in the patterns.
// Example: denonde.it by Mystical
// Note: Only checking the cwtv "made with" version is not enough: spx-visionsofthepast.it has the strange combination of cwtv=2.00, cmwt=2.16
// Hence to be sure, we check that both values are below 2.14.
// Note that all ModPlug Tracker alpha versions do not support filters yet. Earlier alphas identify as cwtv=2.02, cmwt=2.00, but later alpha versions identify as IT 2.14.
// Apart from that, there's an unknown XM conversion tool declaring a lower comaptible version, which naturally also does not support filters, so it's okay that it is caught here.
if((fileHeader.cwtv < 0x0214 && fileHeader.cmwt < 0x0214) || (m_dwLastSavedWithVersion && m_dwLastSavedWithVersion <= MPT_V("1.00.00.A6")))
{
m_MidiCfg.ClearZxxMacros();
}

if(GetType() == MOD_TYPE_MPT)
{
// START - mpt specific:
Expand Down

0 comments on commit 77773dd

Please sign in to comment.