From 1c4391896abcd5e63ea648842214689e79a6093e Mon Sep 17 00:00:00 2001 From: Johannes Schultz Date: Mon, 30 Sep 2024 17:06:38 +0000 Subject: [PATCH] [Fix] IT: Command fixups need to be done before the command memory is updated. git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@21772 56274372-70c3-4bfc-bfc3-4c3a0b034d27 --- soundlib/Load_it.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/soundlib/Load_it.cpp b/soundlib/Load_it.cpp index d1dfb54e8c..bb301fda62 100644 --- a/soundlib/Load_it.cpp +++ b/soundlib/Load_it.cpp @@ -1130,11 +1130,6 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) { const auto [command, param] = patternData.ReadArray(); S3MConvert(m, command, param, true); - // In some IT-compatible trackers, it is possible to input a parameter without a command. - // In this case, we still need to update the last value memory. OpenMPT didn't do this until v1.25.01.07. - // 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) @@ -1143,6 +1138,13 @@ bool CSoundFile::ReadIT(FileReader &file, ModLoadingFlags loadFlags) // (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) m.param = 0x80; + + // In some IT-compatible trackers, it is possible to input a parameter without a command. + // In this case, we still need to update the last value memory (so that we don't reuse a previous non-empty effect). + // OpenMPT didn't do this until v1.25.01.07. + // Example: ckbounce.it + lastValue[ch].command = m.command; + lastValue[ch].param = m.param; } } }