|
From: <sag...@us...> - 2010-09-04 15:19:56
|
Revision: 699
http://modplug.svn.sourceforge.net/modplug/?rev=699&view=rev
Author: saga-games
Date: 2010-09-04 15:19:49 +0000 (Sat, 04 Sep 2010)
Log Message:
-----------
[Imp] Further improvements to VBlank MOD detection and playback (high speed values were simply ignored)
[Fix] MOD Specs: Max speed was off by one (31 instead of 32).
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/mod_specifications.h
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-02 23:45:48 UTC (rev 698)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-04 15:19:49 UTC (rev 699)
@@ -40,7 +40,7 @@
case 0x0C: command = CMD_VOLUME; break;
case 0x0D: command = CMD_PATTERNBREAK; param = ((param >> 4) * 10) + (param & 0x0F); break;
case 0x0E: command = CMD_MODCMDEX; break;
- case 0x0F: command = (param <= (UINT)((m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2)) ? 0x1F : 0x20)) ? CMD_SPEED : CMD_TEMPO;
+ case 0x0F: command = (param <= ((m_nType & (MOD_TYPE_MOD)) ? 0x20 : 0x1F)) ? CMD_SPEED : CMD_TEMPO;
if ((param == 0xFF) && (m_nSamples == 15) && (m_nType & MOD_TYPE_MOD)) command = 0; break; //<rewbs> what the hell is this?! :) //<jojo> it's the "stop tune" command! :-P
// Extension for XM extended effects
case 'G' - 55: command = CMD_GLOBALVOLUME; break; //16
@@ -262,7 +262,11 @@
if ((s[0]=='T') && (s[1]=='D') && (s[2]=='Z') && (s[3]>='4') && (s[3]<='9')) m_nChannels = s[3] - '0'; else
if (IsMagic(s,"16CN")) m_nChannels = 16; else
if (IsMagic(s,"32CN")) m_nChannels = 32; else m_nSamples = 15;
+ // Startrekker 8 channel mod (needs special treatment, see below)
bool bFLT8 = IsMagic(s, "FLT8") ? true : false;
+ // Only apply VBlank tests to M.K. (ProTracker) modules.
+ const bool bMdKd = IsMagic(s, "M.K.") ? true : false;
+
// Load Samples
nErr = 0;
dwTotalSampleLen = 0;
@@ -471,8 +475,10 @@
// (as this would indicate that f.e. a F30 command was really meant to set
// the ticks per row to 48, and not the tempo to 48 BPM).
// In the pattern loader above, a second condition is used: Only tempo commands
- // below 100 BPM are taken into account.
- if(bHasTempoCommands && GetSongTime() >= 10 * 60)
+ // below 100 BPM are taken into account. Furthermore, only M.K. (ProTracker)
+ // modules are checked.
+ // The same check is also applied to original NoiseTracker 15 sample mods.
+ if((bMdKd && bHasTempoCommands && GetSongTime() >= 10 * 60) || m_nSamples == 15)
{
Patterns.ForEachModCommand(FixVBlankMODs());
}
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-09-02 23:45:48 UTC (rev 698)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-09-04 15:19:49 UTC (rev 699)
@@ -243,11 +243,11 @@
nNextPatStartRow = 0; // FT2 E60 bug
if (nRow < Patterns[nPattern].GetNumRows() - 1)
{
- nextRow = Patterns[nPattern] + (nRow+1) * m_nChannels + nChn;
+ nextRow = Patterns[nPattern] + (nRow + 1) * m_nChannels + nChn;
}
if (nextRow && nextRow->command == CMD_XPARAM)
{
- nNextRow = (param<<8) + nextRow->param;
+ nNextRow = (param << 8) + nextRow->param;
} else
{
nNextRow = param;
@@ -266,9 +266,10 @@
// Set Speed
case CMD_SPEED:
if (!param) break;
- if ((param <= 0x20) || (m_nType != MOD_TYPE_MOD))
+ // 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) || (m_nType & MOD_TYPE_MOD))
{
- if (param < 128) nMusicSpeed = param;
+ nMusicSpeed = param;
}
break;
// Set Tempo
@@ -3610,7 +3611,8 @@
#endif // FASTSOUNDLIB
#endif // MODPLUG_TRACKER
//if ((m_nType & MOD_TYPE_S3M) && (param > 0x80)) param -= 0x80;
- if ((param) && (param <= GetModSpecifications().speedMax)) m_nMusicSpeed = param;
+ // 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 || (m_nType & MOD_TYPE_MOD))) m_nMusicSpeed = param;
}
Modified: trunk/OpenMPT/soundlib/mod_specifications.h
===================================================================
--- trunk/OpenMPT/soundlib/mod_specifications.h 2010-09-02 23:45:48 UTC (rev 698)
+++ trunk/OpenMPT/soundlib/mod_specifications.h 2010-09-04 15:19:49 UTC (rev 699)
@@ -129,7 +129,7 @@
mixLevels_original, // defaultMixLevels
0, // Max MIDI mapping directives
1, // Min Speed
- 31, // Max Speed
+ 32, // Max Speed
false, // No song comments
0, // No instrument envelopes
false, // No envelope release node
@@ -169,7 +169,7 @@
mixLevels_original, // defaultMixLevels
0, // Max MIDI mapping directives
1, // Min Speed
- 31, // Max Speed
+ 32, // Max Speed
false, // No song comments
0, // No instrument envelopes
false, // No envelope release node
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|