From a3f7b96b5ecf10872d95ade6084d76357ba452be Mon Sep 17 00:00:00 2001 From: Johannes Schultz Date: Mon, 30 Sep 2024 16:59:29 +0000 Subject: [PATCH] [Imp] IT: Don't import SAx High Offset command for IT 1.xx modules. This feature was added in IT 2.00. git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@21771 56274372-70c3-4bfc-bfc3-4c3a0b034d27 --- soundlib/Load_it.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/soundlib/Load_it.cpp b/soundlib/Load_it.cpp index 1f2fa8b0b3..d1dfb54e8c 100644 --- a/soundlib/Load_it.cpp +++ b/soundlib/Load_it.cpp @@ -1022,6 +1022,7 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) auto patData = Patterns[pat].begin(); ROWINDEX row = 0; + ModCommand dummy{}; while(row < numRows && patternData.CanRead(1)) { uint8 b = patternData.ReadUint8(); @@ -1052,7 +1053,6 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) } // Now we grab the data for this particular row/channel. - ModCommand dummy{}; ModCommand &m = ch < GetNumChannels() ? patData[ch] : dummy; if(chnMask[ch] & 0x10) @@ -1135,6 +1135,10 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) // Example: ckbounce.it lastValue[ch].command = m.command; lastValue[ch].param = m.param; + + // IT 1.xx does not support high offset command + if(m.command == CMD_S3MCMDEX && (m.param & 0xF0) == 0xA0 && fileHeader.cmwt < 0x0200) + m.command = CMD_DUMMY; // Fix handling of commands V81-VFF in ITs made with old Schism Tracker versions // (fixed in https://github.com/schismtracker/schismtracker/commit/ab5517d4730d4c717f7ebffb401445679bd30888 - one of the last versions to identify as v0.50) if(m.command == CMD_GLOBALVOLUME && m.param > 0x80 && fileHeader.cwtv >= 0x1000 && fileHeader.cwtv <= 0x1050)