From: <sag...@us...> - 2013-03-09 22:08:24
|
Revision: 1555 http://sourceforge.net/p/modplug/code/1555 Author: saga-games Date: 2013-03-09 22:08:15 +0000 (Sat, 09 Mar 2013) Log Message: ----------- [Fix] MOD Playback: In PT1.x mode, periods are now clamped properly (taking the finetune setting into account). Test case: AmigaLimitsFinetune.mod [Fix] Mod Cleanup: Accidentlly broke "remove unused samples" in previous refacotring commit. Modified Paths: -------------- trunk/OpenMPT/mptrack/CleanupSong.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/CleanupSong.cpp =================================================================== --- trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-03-09 21:27:25 UTC (rev 1554) +++ trunk/OpenMPT/mptrack/CleanupSong.cpp 2013-03-09 22:08:15 UTC (rev 1555) @@ -530,7 +530,7 @@ // Check if any samples are not referenced in the patterns (sample mode) or by an instrument (instrument mode). // This doesn't check yet if a sample is referenced by an instrument, but actually unused in the patterns. - for(SAMPLEINDEX smp = 1; smp <= pSndFile->GetNumSamples(); smp--) if (pSndFile->GetSample(smp).pSample) + for(SAMPLEINDEX smp = 1; smp <= pSndFile->GetNumSamples(); smp++) if (pSndFile->GetSample(smp).pSample) { if(!pSndFile->IsSampleUsed(smp)) { Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2013-03-09 21:27:25 UTC (rev 1554) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2013-03-09 22:08:15 UTC (rev 1555) @@ -313,6 +313,7 @@ { m_SndFile.GetSample(i).pSample = nullptr; m_SndFile.GetSample(i).nLength = 0; + strcpy(m_SndFile.m_szNames[i], ""); } // Now, create new sample list. Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2013-03-09 21:27:25 UTC (rev 1554) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2013-03-09 22:08:15 UTC (rev 1555) @@ -1596,6 +1596,7 @@ if(m_SongFlags.test_all(SONG_FIRSTTICK | SONG_PT1XMODE)) { // ProTracker doesn't apply vibrato nor advance on the first tick. + // Test case: VibratoReset.mod return; } else if((GetType() & MOD_TYPE_XM) && (chn.nVibratoType & 0x03) == 1) { @@ -2095,12 +2096,15 @@ ProcessArpeggio(pChn, period, arpeggioSteps); - // Preserve Amiga freq limits - // Test case: AmigaLimits.s3m + // Preserve Amiga freq limits. + // In ST3, the frequency is always clamped to periods 113 to 856, while in ProTracker, + // the limit is variable, depending on the finetune of the sample. + // Test case: AmigaLimits.s3m, AmigaLimitsFinetune.mod if(m_SongFlags[SONG_AMIGALIMITS | SONG_PT1XMODE]) { - Limit(period, 113 * 4, 856 * 4); - Limit(pChn->nPeriod, 113 * 4, 856 * 4); + ASSERT(pChn->nFineTune == 0 || GetType() != MOD_TYPE_S3M); + Limit(period, 113 * 4 - pChn->nFineTune, 856 * 4 - pChn->nFineTune); + Limit(pChn->nPeriod, 113 * 4 - pChn->nFineTune, 856 * 4 - pChn->nFineTune); } ProcessPanbrello(pChn); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |