|
From: <sag...@us...> - 2010-11-13 13:49:15
|
Revision: 760
http://modplug.svn.sourceforge.net/modplug/?rev=760&view=rev
Author: saga-games
Date: 2010-11-13 13:49:04 +0000 (Sat, 13 Nov 2010)
Log Message:
-----------
[Fix] Pattern jumps to the same row+pattern as the jump command are not ignored anymore. (http://forum.openmpt.org/index.php?topic=1810.0)
[Fix] MOD Loader: Tentative fix for MODs with short loops at the sample start that were most likely not intended.
[Mod] IT Loader: MIDI macros are now cleared when loading IT files made with old Impulse Tracker versions (<2.14), so that Zxx commands won't break the songs anymore (fixes denonde.it, fix from Schism Tracker).
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Load_mod.cpp
trunk/OpenMPT/soundlib/Snd_fx.cpp
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2010-11-07 16:37:22 UTC (rev 759)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-11-13 13:49:04 UTC (rev 760)
@@ -775,6 +775,13 @@
dwMemPos += sizeof(MODMIDICFG);
}
}
+ // 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.
+ if (pifh->cwtv < 0x0214)
+ {
+ MemsetZero(m_MidiCfg);
+ m_dwSongFlags |= SONG_EMBEDMIDICFG;
+ }
+
// Read pattern names: "PNAM"
if ((dwMemPos + 8 < dwMemLength) && (*((DWORD *)(lpStream+dwMemPos)) == 0x4d414e50))
{
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-11-07 16:37:22 UTC (rev 759)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-11-13 13:49:04 UTC (rev 760)
@@ -275,7 +275,7 @@
// Check Mod Magic
memcpy(s, pMagic->Magic, 4);
if ((IsMagic(s, "M.K.")) || (IsMagic(s, "M!K!"))
- || (IsMagic(s, "M&K!")) || (IsMagic(s, "N.T."))) m_nChannels = 4; else
+ || (IsMagic(s, "M&K!")) || (IsMagic(s, "N.T.")) || (IsMagic(s, "FEST"))) m_nChannels = 4; else
if ((IsMagic(s, "CD81")) || (IsMagic(s, "OKTA"))) m_nChannels = 8; else
if ((s[0]=='F') && (s[1]=='L') && (s[2]=='T') && (s[3]>='4') && (s[3]<='9')) m_nChannels = s[3] - '0'; else
if ((s[0]>='4') && (s[0]<='9') && (s[1]=='C') && (s[2]=='H') && (s[3]=='N')) m_nChannels = s[0] - '0'; else
@@ -332,6 +332,11 @@
psmp->nLoopStart = 0;
psmp->nLoopEnd = 0;
}
+ // Fix for most likely broken sample loops. This fixes super_sufm_-_new_life.mod which has a long sample which is looped from 0 to 4.
+ if(psmp->nLoopEnd <= 8 && psmp->nLoopStart == 0 && psmp->nLength > psmp->nLoopEnd)
+ {
+ psmp->nLoopEnd = 0;
+ }
if (psmp->nLoopEnd > psmp->nLoopStart)
{
psmp->uFlags |= CHN_LOOP;
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-07 16:37:22 UTC (rev 759)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-11-13 13:49:04 UTC (rev 760)
@@ -1996,7 +1996,7 @@
case CMD_POSITIONJUMP:
m_nNextPatStartRow = 0; // FT2 E60 bug
nPosJump = param;
- if((m_dwSongFlags & SONG_PATTERNLOOP && m_nSeqOverride == 0))
+ if((m_dwSongFlags & SONG_PATTERNLOOP) && m_nSeqOverride == 0)
{
m_nSeqOverride = param + 1;
//Releasing pattern loop after position jump could cause
@@ -2104,15 +2104,18 @@
//if (((!bNoLoop) && (nPosJump < MAX_ORDERS))
if (nPosJump>=Order.size())
nPosJump = 0;
- if ((!bNoLoop)
- //end rewbs.fix
- && ((nPosJump != (int)m_nCurrentPattern) || (nBreakRow != (int)m_nRow)))
+
+ // This checks whether we're jumping to the same row we're already on.
+ // Sounds pretty stupid and pointless to me. And noone else does this, either.
+ //if((nPosJump != (int)m_nCurrentPattern) || (nBreakRow != (int)m_nRow))
{
// IT compatibility: don't reset loop count on pattern break
if (nPosJump != (int)m_nCurrentPattern && !IsCompatibleMode(TRK_IMPULSETRACKER))
{
for (CHANNELINDEX i = 0; i < m_nChannels; i++)
+ {
Chn[i].nPatternLoopCount = 0;
+ }
}
m_nNextPattern = nPosJump;
m_nNextRow = (UINT)nBreakRow;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|