From: <sag...@us...> - 2013-12-19 18:30:02
|
Revision: 3507 http://sourceforge.net/p/modplug/code/3507 Author: saga-games Date: 2013-12-19 18:29:51 +0000 (Thu, 19 Dec 2013) Log Message: ----------- [Fix] XM: Support F00 "stop song" behaviour (it actually just sets the ticks/row to 65536 in FT2, so we can emulate that easily) [Mod] OpenMPT: Version is now 1.22.07.09 Modified Paths: -------------- trunk/OpenMPT/common/versionNumber.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/common/versionNumber.h =================================================================== --- trunk/OpenMPT/common/versionNumber.h 2013-12-19 18:23:14 UTC (rev 3506) +++ trunk/OpenMPT/common/versionNumber.h 2013-12-19 18:29:51 UTC (rev 3507) @@ -17,7 +17,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 22 #define VER_MINOR 07 -#define VER_MINORMINOR 08 +#define VER_MINORMINOR 09 //Version string. For example "1.17.02.28" #define MPT_VERSION_STR VER_STRINGIZE(VER_MAJORMAJOR) "." VER_STRINGIZE(VER_MAJOR) "." VER_STRINGIZE(VER_MINOR) "." VER_STRINGIZE(VER_MINORMINOR) Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-12-19 18:23:14 UTC (rev 3506) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-12-19 18:29:51 UTC (rev 3507) @@ -306,6 +306,14 @@ break; // Set Speed case CMD_SPEED: +#ifdef MODPLUG_TRACKER + // FT2 appears to be decrementing the tick count before checking for zero, + // so it effectively counts down 65536 ticks with speed = 0 (song speed is a 16-bit variable in FT2) + if(GetType() == MOD_TYPE_XM && !param) + { + memory.musicSpeed = uint16_max; + } +#endif // MODPLUG_TRACKER if (!param) break; // Allow high speed values here for VBlank MODs. (Maybe it would be better to have a "VBlank MOD" flag somewhere? Is it worth the effort?) if ((param <= GetModSpecifications().speedMax) || GetType() == MOD_TYPE_MOD) @@ -4482,6 +4490,15 @@ void CSoundFile::SetSpeed(UINT param) //----------------------------------- { +#ifdef MODPLUG_TRACKER + // FT2 appears to be decrementing the tick count before checking for zero, + // so it effectively counts down 65536 ticks with speed = 0 (song speed is a 16-bit variable in FT2) + if(GetType() == MOD_TYPE_XM && !param) + { + m_nMusicSpeed = uint16_max; + } +#endif // MODPLUG_TRACKER + // Allow high speed values here for VBlank MODs. (Maybe it would be better to have a "VBlank MOD" flag somewhere? Is it worth the effort?) if ((param) && (param <= GetModSpecifications().speedMax || (GetType() & MOD_TYPE_MOD))) m_nMusicSpeed = param; } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2013-12-19 18:23:14 UTC (rev 3506) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2013-12-19 18:29:51 UTC (rev 3507) @@ -2330,6 +2330,12 @@ const uint16 param = static_cast<uint16>(m.param) + static_cast<uint16>(m.vol << 4); m.param = mpt::saturate_cast<uint8>(param); } + + if(sndFile.m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 22, 07, 09) && m.command == CMD_SPEED && m.param == 0) + { + // OpenMPT can emulate FT2's F00 behaviour now. + m.command = CMD_NONE; + } } chn++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |