From: <sag...@us...> - 2010-01-20 22:10:16
|
Revision: 472 http://modplug.svn.sourceforge.net/modplug/?rev=472&view=rev Author: saga-games Date: 2010-01-20 22:09:23 +0000 (Wed, 20 Jan 2010) Log Message: ----------- [Mod] Changed a label in the installer [New] MPTM command S7D explicitely enforces pitch envelope, S7E enforces filter envelope. Modified Paths: -------------- trunk/OpenMPT/installer/install.iss trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/soundlib/Snd_defs.h trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp trunk/OpenMPT/soundlib/Sndmix.cpp Modified: trunk/OpenMPT/installer/install.iss =================================================================== --- trunk/OpenMPT/installer/install.iss 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/installer/install.iss 2010-01-20 22:09:23 UTC (rev 472) @@ -28,7 +28,7 @@ ; icons and install mode Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked -Name: "portable"; Description: "Use program directory to store configuration in (portable mode)"; GroupDescription: "Options:"; Flags: unchecked +Name: "portable"; Description: "Use program directory to store configuration in"; GroupDescription: "Options:"; Flags: unchecked ; file associations - put this below all other [tasks]! #include "filetypes.iss" @@ -104,3 +104,4 @@ + Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -1834,7 +1834,7 @@ //rewbs.graph void CModDoc::OnEditGraph() -//---------------------------- +//------------------------- { if (m_SndFile.m_nType & (MOD_TYPE_XM|MOD_TYPE_IT | MOD_TYPE_MPT)) SendMessageToActiveViews(WM_MOD_ACTIVATEVIEW, IDD_CONTROL_GRAPH); } @@ -2646,6 +2646,9 @@ case 0x0A: strcpy(s, "7A: Pan Env On"); break; case 0x0B: strcpy(s, "7B: Pitch Env Off"); break; case 0x0C: strcpy(s, "7C: Pitch Env On"); break; + // intentional fall-through follows + case 0x0D: if(m_SndFile.GetType() == MOD_TYPE_MPT) { strcpy(s, "7D: Force Pitch Env"); break; } + case 0x0E: if(m_SndFile.GetType() == MOD_TYPE_MPT) { strcpy(s, "7E: Force Filter Env"); break; } default: wsprintf(s, "%02X: undefined", param); break; } } else Modified: trunk/OpenMPT/soundlib/Snd_defs.h =================================================================== --- trunk/OpenMPT/soundlib/Snd_defs.h 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Snd_defs.h 2010-01-20 22:09:23 UTC (rev 472) @@ -155,7 +155,11 @@ #define CHN_SOLO 0x10000000 // -> CODE#0012 -> DESC="midi keyboard split" -! NEW_FEATURE#0012 #define CHN_NOFX 0x20000000 // -> CODE#0015 -> DESC="channels management dlg" -! NEW_FEATURE#0015 #define CHN_SYNCMUTE 0x40000000 +#define CHN_FILTERENV 0x80000000 +#define CHN_SAMPLEFLAGS (CHN_16BIT|CHN_LOOP|CHN_PINGPONGLOOP|CHN_SUSTAINLOOP|CHN_PINGPONGSUSTAIN|CHN_PANNING|CHN_STEREO|CHN_PINGPONGFLAG) +#define CHN_CHANNELFLAGS (~CHN_SAMPLEFLAGS) + // instrument envelope-specific flags #define ENV_ENABLED 0x01 // env is enabled #define ENV_LOOP 0x02 // env loop Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -554,7 +554,7 @@ { if(m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) return; pChn->dwFlags &= ~(CHN_KEYOFF|CHN_NOTEFADE); - pChn->dwFlags = (pChn->dwFlags & (0xFFFFFF00 | CHN_PINGPONGFLAG)) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & (CHN_CHANNELFLAGS | CHN_PINGPONGFLAG)) | (pSmp->uFlags & CHN_SAMPLEFLAGS); } else { pChn->dwFlags &= ~(CHN_KEYOFF|CHN_NOTEFADE|CHN_VOLENV|CHN_PANENV|CHN_PITCHENV); @@ -562,9 +562,9 @@ //IT compatibility tentative fix: Don't change bidi loop direction when //no sample nor instrument is changed. if(IsCompatibleMode(TRK_IMPULSETRACKER) && pSmp == pChn->pModSample && !bInstrumentChanged) - pChn->dwFlags = (pChn->dwFlags & (0xFFFFFF00 | CHN_PINGPONGFLAG)) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & (CHN_CHANNELFLAGS | CHN_PINGPONGFLAG)) | (pSmp->uFlags & CHN_SAMPLEFLAGS); else - pChn->dwFlags = (pChn->dwFlags & 0xFFFFFF00) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & CHN_CHANNELFLAGS) | (pSmp->uFlags & CHN_SAMPLEFLAGS); if (pIns) @@ -574,7 +574,13 @@ if (pIns->PitchEnv.dwFlags & ENV_ENABLED) pChn->dwFlags |= CHN_PITCHENV; if ((pIns->PitchEnv.dwFlags & ENV_ENABLED) && (pIns->PitchEnv.dwFlags & ENV_FILTER)) { + pChn->dwFlags |= CHN_FILTERENV; if (!pChn->nCutOff) pChn->nCutOff = 0x7F; + } else + { + // Special case: Reset filter envelope flag manually (because of S7D/S7E effects). + // This way, the S7x effects can be applied to several notes, as long as they don't come with an instrument number. + pChn->dwFlags &= ~CHN_FILTERENV; } if (pIns->nIFC & 0x80) pChn->nCutOff = pIns->nIFC & 0x7F; if (pIns->nIFR & 0x80) pChn->nResonance = pIns->nIFR & 0x7F; @@ -709,7 +715,7 @@ pChn->nLength = pSmp->nLength; pChn->nLoopEnd = pSmp->nLength; pChn->nLoopStart = 0; - pChn->dwFlags = (pChn->dwFlags & 0xFFFFFF00) | (pSmp->uFlags & 0xFF); + pChn->dwFlags = (pChn->dwFlags & CHN_CHANNELFLAGS) | (pSmp->uFlags & CHN_SAMPLEFLAGS); if (pChn->dwFlags & CHN_SUSTAINLOOP) { pChn->nLoopStart = pSmp->nSustainStart; @@ -2192,6 +2198,7 @@ // Implemented for IMF compatibility, can't actually save this in any formats // sign should be 1 (up) or -1 (down) void CSoundFile::NoteSlide(MODCHANNEL *pChn, UINT param, int sign) +//---------------------------------------------------------------- { BYTE x, y; if (m_dwSongFlags & SONG_FIRSTTICK) { @@ -2593,7 +2600,7 @@ case 0x50: if(((param & 0x0F) < 0x04) || !IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nPanbrelloType = param & 0x07; break; // S6x: Pattern Delay for x frames case 0x60: m_nFrameDelay = param; break; - // S7x: Envelope Control + // S7x: Envelope Control / Instrument Control case 0x70: if(!(m_dwSongFlags & SONG_FIRSTTICK)) break; switch(param) { @@ -2606,9 +2613,17 @@ { if (bkp->nMasterChn == nChn+1) { - if (param == 1) KeyOff(i); else - if (param == 2) bkp->dwFlags |= CHN_NOTEFADE; else - { bkp->dwFlags |= CHN_NOTEFADE; bkp->nFadeOutVol = 0; } + if (param == 1) + { + KeyOff(i); + } else if (param == 2) + { + bkp->dwFlags |= CHN_NOTEFADE; + } else + { + bkp->dwFlags |= CHN_NOTEFADE; + bkp->nFadeOutVol = 0; + } } } } @@ -2623,6 +2638,20 @@ case 10: pChn->dwFlags |= CHN_PANENV; break; case 11: pChn->dwFlags &= ~CHN_PITCHENV; break; case 12: pChn->dwFlags |= CHN_PITCHENV; break; + case 13: + case 14: + if(GetType() == MOD_TYPE_MPT) + { + pChn->dwFlags |= CHN_PITCHENV; + if(param == 13) // pitch env on, filter env off + { + pChn->dwFlags &= ~CHN_FILTERENV; + } else // filter env on + { + pChn->dwFlags |= CHN_FILTERENV; + } + } + break; } break; // S8x: Set 4-bit Panning Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -3227,7 +3227,7 @@ case 0x40: m->param = (m->param & 0x0F) | 0x70; break; case 0x50: case 0x60: - case 0x70: + case 0x70: if(((m->param & 0xF0) == 0x70) && ((m->param & 0x0F) > 0x0A)) { m->command = CMD_NONE; break; } // no pitch env in XM format case 0x90: case 0xA0: m->command = CMD_XFINEPORTAUPDOWN; break; case 0xB0: m->param = (m->param & 0x0F) | 0x60; break; @@ -3275,8 +3275,8 @@ } } // End if(m->command == CMD_PANNING8) - ////////////////////////// - // Convert param control + ///////////////////////////////////////////////////// + // Convert param control, extended envelope control if(oldTypeIsMPT) { if(m->note == NOTE_PC || m->note == NOTE_PCS) @@ -3286,6 +3286,12 @@ m->volcmd = VOLCMD_NONE; m->note = NOTE_NONE; } + + // adjust extended envelope control commands + if((m->command == CMD_S3MCMDEX) && ((m->param & 0xF0) == 0x70) && ((m->param & 0x0F) > 0x0C)) + { + m->param = 0x7C; + } } // End if(oldTypeIsMPT) ///////////////////////////////////////// Modified: trunk/OpenMPT/soundlib/Sndmix.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndmix.cpp 2010-01-19 22:57:23 UTC (rev 471) +++ trunk/OpenMPT/soundlib/Sndmix.cpp 2010-01-20 22:09:23 UTC (rev 472) @@ -1300,7 +1300,8 @@ } envpitch = CLAMP(envpitch, -256, 256); // Filter Envelope: controls cutoff frequency - if (pIns->PitchEnv.dwFlags & ENV_FILTER) + //if (pIns->PitchEnv.dwFlags & ENV_FILTER) + if (pChn->dwFlags & CHN_FILTERENV) { #ifndef NO_FILTER SetupChannelFilter(pChn, (pChn->dwFlags & CHN_FILTER) ? false : true, envpitch); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |