From: <sag...@us...> - 2009-07-11 18:53:35
|
Revision: 291 http://modplug.svn.sourceforge.net/modplug/?rev=291&view=rev Author: saga-games Date: 2009-07-11 18:53:31 +0000 (Sat, 11 Jul 2009) Log Message: ----------- [Imp] Note properties: Explanation for Tremor effect [Fix] Tremor: Sounds like in IT when compatible playback mode is turned on. [Fix] IT loader: 31 BPM is an allowed default tempo. Tentative fix: Clamp to 32 (instead of 125) Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2009-07-11 16:47:56 UTC (rev 290) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2009-07-11 18:53:31 UTC (rev 291) @@ -2567,6 +2567,28 @@ strcpy(s, "continue"); break; + case CMD_TREMOR: + if(param) + { + BYTE ontime = param >> 4, offtime = param & 0x0F; + if(m_SndFile.m_dwSongFlags & SONG_ITOLDEFFECTS) + { + ontime++; + offtime++; + } + else + { + if(ontime == 0) ontime = 1; + if(offtime == 0) offtime = 1; + } + wsprintf(pszName, "ontime %d, offtime %d", ontime, offtime); + } + else + { + strcpy(s, "continue"); + } + break; + case CMD_MIDI: if (param < 0x80) { Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2009-07-11 16:47:56 UTC (rev 290) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2009-07-11 18:53:31 UTC (rev 291) @@ -983,6 +983,10 @@ } if (pifh->speed) m_nDefaultSpeed = pifh->speed; if (pifh->tempo) m_nDefaultTempo = pifh->tempo; + if(m_nDefaultTempo < 32) m_nDefaultTempo = 32; // tempo 31 is possible. due to conflicts with the rest of the engine, let's just clamp it to 32. + + if(m_nDefaultTempo < 32) m_nDefaultTempo = 32; // tempo 31 is possible. due to conflicts with the rest of the engine, let's just clamp it to 32. + m_nSamplePreAmp = pifh->mv & 0x7F; if (m_nSamplePreAmp<0x20) { m_nSamplePreAmp=100; Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-07-11 16:47:56 UTC (rev 290) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2009-07-11 18:53:31 UTC (rev 291) @@ -749,8 +749,8 @@ if(!GetModFlag(MSF_COMPATIBLE_PLAY)) { pChn->nRetrigCount = 0; + pChn->nTremorCount = 0; } - pChn->nTremorCount = 0; if (bResetEnv) { pChn->nVolSwing = pChn->nPanSwing = 0; Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2009-07-11 16:47:56 UTC (rev 290) +++ trunk/OpenMPT/soundlib/Sndfile.h 2009-07-11 18:53:31 UTC (rev 291) @@ -546,7 +546,7 @@ BYTE nOldOffset, nOldHiOffset; BYTE nCutOff, nResonance; BYTE nRetrigCount, nRetrigParam; - BYTE nTremorCount, nTremorParam; + BYTE nTremorCount, nTremorParam, nTremorOn, nTremorOff; BYTE nPatternLoop, nPatternLoopCount; BYTE nRowNote, nRowInstr; BYTE nRowVolCmd, nRowVolume; Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2009-07-11 16:47:56 UTC (rev 290) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2009-07-11 18:53:31 UTC (rev 291) @@ -986,18 +986,53 @@ } // Tremor - if (pChn->nCommand == CMD_TREMOR) + if(pChn->nCommand == CMD_TREMOR) { - UINT n = (pChn->nTremorParam >> 4) + (pChn->nTremorParam & 0x0F); - UINT ontime = pChn->nTremorParam >> 4; - if ((!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) || (m_dwSongFlags & SONG_ITOLDEFFECTS)) { n += 2; ontime++; } - UINT tremcount = (UINT)pChn->nTremorCount; - if (tremcount >= n) tremcount = 0; - if ((m_nTickCount) || (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) + if(GetModFlag(MSF_COMPATIBLE_PLAY) && (m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) { - if (tremcount >= ontime) vol = 0; - pChn->nTremorCount = (BYTE)(tremcount + 1); + // Original IT behaviour + if(pChn->nTremorOn) + pChn->nTremorOn--; + if(!pChn->nTremorOn) { + if(pChn->nTremorOff) + { + vol = 0; + pChn->nTremorOff--; + } + else + { + pChn->nTremorOn = pChn->nTremorParam >> 4; + pChn->nTremorOff = pChn->nTremorParam & 0x0F; + if(m_dwSongFlags & SONG_ITOLDEFFECTS) + { + pChn->nTremorOn++; + pChn->nTremorOff++; + } + else + { + if (!pChn->nTremorOn) pChn->nTremorOn = 1; + if (!pChn->nTremorOff) pChn->nTremorOff = 1; + } + } + } } + else + { + UINT n = (pChn->nTremorParam >> 4) + (pChn->nTremorParam & 0x0F); + UINT ontime = pChn->nTremorParam >> 4; + if ((!(m_nType & (MOD_TYPE_IT|MOD_TYPE_MPT))) || (m_dwSongFlags & SONG_ITOLDEFFECTS)) + { + n += 2; + ontime++; + } + UINT tremcount = (UINT)pChn->nTremorCount; + if (tremcount >= n) tremcount = 0; + if ((m_nTickCount) || (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) + { + if (tremcount >= ontime) vol = 0; + pChn->nTremorCount = (BYTE)(tremcount + 1); + } + } pChn->dwFlags |= CHN_FASTVOLRAMP; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |