|
From: <sag...@us...> - 2012-07-05 19:10:18
|
Revision: 1316
http://modplug.svn.sourceforge.net/modplug/?rev=1316&view=rev
Author: saga-games
Date: 2012-07-05 19:10:12 +0000 (Thu, 05 Jul 2012)
Log Message:
-----------
[Fix] Better fix for XM Tremor.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Snd_fx.cpp
trunk/OpenMPT/soundlib/Sndmix.cpp
Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-07-03 15:56:38 UTC (rev 1315)
+++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-07-05 19:10:12 UTC (rev 1316)
@@ -1122,8 +1122,14 @@
if(!IsCompatibleMode(TRK_IMPULSETRACKER))
{
// FT2 compatibility: FT2 also doesn't reset retrigger
- if(!IsCompatibleMode(TRK_FASTTRACKER2)) pChn->nRetrigCount = 0;
- pChn->nTremorCount = 0;
+ if(!IsCompatibleMode(TRK_FASTTRACKER2))
+ {
+ pChn->nRetrigCount = 0;
+ pChn->nTremorCount = 0;
+ } else
+ {
+ pChn->nTremorCount = 0x20;
+ }
}
if (bResetEnv)
Modified: trunk/OpenMPT/soundlib/Sndmix.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Sndmix.cpp 2012-07-03 15:56:38 UTC (rev 1315)
+++ trunk/OpenMPT/soundlib/Sndmix.cpp 2012-07-05 19:10:12 UTC (rev 1316)
@@ -1016,33 +1016,29 @@
{
if(IsCompatibleMode(TRK_FASTTRACKER2))
{
- // Weird XM tremor. Not quite correct yet, but much better than non-compatible tremor.
+ // Weird XM tremor.
if(pChn->nTremorCount & 0x80)
{
if(!(m_dwSongFlags & SONG_FIRSTTICK) && pChn->nCommand == CMD_TREMOR)
{
- const uint8 onTime = (pChn->nTremorParam >> 4) + 1, totalTime = onTime + (pChn->nTremorParam & 0x0F) + 1;
-
- if((pChn->nTremorCount & 0x3F) == totalTime)
+ pChn->nTremorCount &= ~0x20;
+ if(pChn->nTremorCount == 0x80)
{
- // Reset tremor count after one full cycle
- pChn->nTremorCount &= 0xC0;
- }
-
- if((pChn->nTremorCount & 0x3F) >= onTime)
+ // Reached end of off-time
+ pChn->nTremorCount = (pChn->nTremorParam >> 4) | 0xC0;
+ } else if(pChn->nTremorCount == 0xC0)
{
- // Volume Off
- pChn->nTremorCount |= 0x40;
+ // Reached end of on-time
+ pChn->nTremorCount = (pChn->nTremorParam & 0x0F) | 0x80;
} else
{
- // Volume On
- pChn->nTremorCount &= ~0x40;
+ pChn->nTremorCount--;
}
-
- pChn->nTremorCount = (pChn->nTremorCount & 0xC0) | ((pChn->nTremorCount + 1) & 0x3F);
+
+ pChn->dwFlags |= CHN_FASTVOLRAMP;
}
- if((pChn->nTremorCount & 0xC0) == 0xC0)
+ if((pChn->nTremorCount & 0xE0) == 0x80)
{
vol = 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|