From: <sag...@us...> - 2012-05-14 23:05:31
|
Revision: 1272 http://modplug.svn.sourceforge.net/modplug/?rev=1272&view=rev Author: saga-games Date: 2012-05-14 23:05:24 +0000 (Mon, 14 May 2012) Log Message: ----------- [Fix] Combinations of Qxy with a pattern delay at Speed y should now work as intended (partly fixes player abuse test case 17). Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-05-14 22:43:04 UTC (rev 1271) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-05-14 23:05:24 UTC (rev 1272) @@ -1240,7 +1240,7 @@ //-------------------------------------------------------------------------------- { ModChannel *pChn = &Chn[nChn]; - ModInstrument* pHeader = 0; + ModInstrument *pIns = nullptr; LPSTR pSample; if(!ModCommand::IsNote(note)) { @@ -1269,20 +1269,20 @@ pChn->nLeftVol = pChn->nRightVol = 0; return; } - if (instr >= MAX_INSTRUMENTS) instr = 0; + if(instr >= MAX_INSTRUMENTS) instr = 0; pSample = pChn->pSample; - pHeader = pChn->pModInstrument; - if ((instr) && (note)) + pIns = pChn->pModInstrument; + if(instr && note) { - pHeader = Instruments[instr]; - if (pHeader) + pIns = Instruments[instr]; + if (pIns) { UINT n = 0; - if (note <= 0x80) + if (note <= NOTE_MAX) { - n = pHeader->Keyboard[note-1]; - note = pHeader->NoteMap[note-1]; - if ((n) && (n < MAX_SAMPLES)) pSample = Samples[n].pSample; + n = pIns->Keyboard[note - 1]; + note = pIns->NoteMap[note - 1]; + if(n > 0 && n < MAX_SAMPLES) pSample = Samples[n].pSample; } } else pSample = nullptr; } @@ -1291,11 +1291,12 @@ if (pChn->dwFlags & CHN_MUTE) return; bool applyDNAtoPlug; //rewbs.VSTiNNA - for (CHANNELINDEX i=nChn; i<MAX_CHANNELS; p++, i++) - if ((i >= m_nChannels) || (p == pChn)) + + for(CHANNELINDEX i = nChn; i < MAX_CHANNELS; p++, i++) + if(i >= m_nChannels || p == pChn) { applyDNAtoPlug = false; //rewbs.VSTiNNA - if (((p->nMasterChn == nChn+1) || (p == pChn)) && (p->pModInstrument)) + if((p->nMasterChn == nChn + 1 || p == pChn) && p->pModInstrument != nullptr) { bool bOk = false; // Duplicate Check Type @@ -1303,22 +1304,22 @@ { // Note case DCT_NOTE: - if ((note) && (p->nNote == note) && (pHeader == p->pModInstrument)) bOk = true; - if (pHeader && pHeader->nMixPlug) applyDNAtoPlug = true; //rewbs.VSTiNNA + if(note && p->nNote == note && pIns == p->pModInstrument) bOk = true; + if(pIns && pIns->nMixPlug) applyDNAtoPlug = true; //rewbs.VSTiNNA break; // Sample case DCT_SAMPLE: - if ((pSample) && (pSample == p->pSample)) bOk = true; + if(pSample != nullptr && pSample == p->pSample) bOk = true; break; // Instrument case DCT_INSTRUMENT: - if (pHeader == p->pModInstrument) bOk = true; + if(pIns == p->pModInstrument) bOk = true; //rewbs.VSTiNNA - if (pHeader && pHeader->nMixPlug) applyDNAtoPlug = true; + if(pIns && pIns->nMixPlug) applyDNAtoPlug = true; break; // Plugin case DCT_PLUGIN: - if (pHeader && (pHeader->nMixPlug) && (pHeader->nMixPlug == p->pModInstrument->nMixPlug)) + if(pIns && (pIns->nMixPlug) && (pIns->nMixPlug == p->pModInstrument->nMixPlug)) { applyDNAtoPlug = true; bOk = true; @@ -1339,8 +1340,8 @@ case DNA_NOTEOFF: case DNA_NOTEFADE: //switch off duplicated note played on this plugin - IMixPlugin *pPlugin = m_MixPlugins[pHeader->nMixPlug-1].pMixPlugin; - if (pPlugin && p->nNote) + IMixPlugin *pPlugin = m_MixPlugins[pIns->nMixPlug-1].pMixPlugin; + if(pPlugin && p->nNote != NOTE_NONE) pPlugin->MidiCommand(GetBestMidiChannel(i), p->pModInstrument->nMidiProgram, p->pModInstrument->wMidiBank, p->nNote + NOTE_KEYOFF, 0, i); break; } @@ -1363,7 +1364,7 @@ p->dwFlags |= CHN_NOTEFADE; break; } - if (!p->nVolume) + if(!p->nVolume) { p->nFadeOutVol = 0; p->dwFlags |= (CHN_NOTEFADE|CHN_FASTVOLRAMP); @@ -1376,19 +1377,14 @@ // Do we need to apply New/Duplicate Note Action to a VSTi? bool applyNNAtoPlug = false; IMixPlugin *pPlugin = NULL; - if (pChn->pModInstrument && pChn->pModInstrument->HasValidMIDIChannel() && pChn->nNote > 0 && pChn->nNote < 128) // instro sends to a midi chan + if (pChn->pModInstrument && pChn->pModInstrument->HasValidMIDIChannel() && ModCommand::IsNote(pChn->nNote)) // instro sends to a midi chan { PLUGINDEX nPlugin = GetBestPlugin(nChn, PrioritiseInstrument, RespectMutes); - /* - UINT nPlugin = 0; - nPlugin = pChn->pModInstrument->nMixPlug; // first try intrument VST - if ((!nPlugin) || (nPlugin > MAX_MIXPLUGINS)) // Then try Channel VST - nPlugin = ChnSettings[nChn].nMixPlugin; - */ - if ((nPlugin) && (nPlugin <= MAX_MIXPLUGINS)) + + if(nPlugin > 0 && nPlugin <= MAX_MIXPLUGINS) { pPlugin = m_MixPlugins[nPlugin-1].pMixPlugin; - if (pPlugin) + if(pPlugin) { // apply NNA to this Plug iff this plug is currently playing a note on this tracking chan // (and if it is playing a note, we know that would be the last note played on this chan). @@ -1406,10 +1402,10 @@ // New Note Action //if ((pChn->nVolume) && (pChn->nLength)) - if (((pChn->nVolume) && (pChn->nLength)) || applyNNAtoPlug) //rewbs.VSTiNNA + if((pChn->nVolume != 0 && pChn->nLength != 0) || applyNNAtoPlug) //rewbs.VSTiNNA { CHANNELINDEX n = GetNNAChannel(nChn); - if (n) + if(n != 0) { ModChannel *p = &Chn[n]; // Copy Channel @@ -1423,7 +1419,7 @@ p->nMasterChn = nChn + 1; p->nCommand = 0; //rewbs.VSTiNNA - if (applyNNAtoPlug && pPlugin) + if(applyNNAtoPlug && pPlugin) { //Move note to the NNA channel (odd, but makes sense with DNA stuff). //Actually a bad idea since it then become very hard to kill some notes. @@ -1452,7 +1448,7 @@ p->dwFlags |= CHN_NOTEFADE; break; } - if (!p->nVolume) + if(!p->nVolume) { p->nFadeOutVol = 0; p->dwFlags |= (CHN_NOTEFADE|CHN_FASTVOLRAMP); @@ -3846,11 +3842,11 @@ //IT compatibility 15. Retrigger if(IsCompatibleMode(TRK_IMPULSETRACKER)) { - if ((m_dwSongFlags & SONG_FIRSTTICK) && pChn->rowCommand.note) + if(m_nTickCount == 0 && pChn->rowCommand.note) { pChn->nRetrigCount = param & 0xf; } - else if (!pChn->nRetrigCount || !--pChn->nRetrigCount) + else if(!pChn->nRetrigCount || !--pChn->nRetrigCount) { pChn->nRetrigCount = param & 0xf; bDoRetrig = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-06-23 14:47:51
|
Revision: 1306 http://modplug.svn.sourceforge.net/modplug/?rev=1306&view=rev Author: saga-games Date: 2012-06-23 14:47:45 +0000 (Sat, 23 Jun 2012) Log Message: ----------- [Fix] IT Compatibility: Combination of tick delay and note delay (fixes tickdelay.it) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-06-23 14:35:59 UTC (rev 1305) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-06-23 14:47:45 UTC (rev 1306) @@ -1591,8 +1591,8 @@ nStartTick = UINT_MAX; } - //IT compatibility 08. Handling of out-of-range delay command. - if(nStartTick >= m_nMusicSpeed && IsCompatibleMode(TRK_IMPULSETRACKER)) + // IT compatibility 08. Handling of out-of-range delay command. + if(nStartTick >= GetNumTicksOnCurrentRow() && IsCompatibleMode(TRK_IMPULSETRACKER)) { if(instr) { @@ -2907,7 +2907,7 @@ } } - LONG newvolume = pChn->nVolume; + int newvolume = pChn->nVolume; if (GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_STM|MOD_TYPE_AMF)) { if ((param & 0x0F) == 0x0F) //Fine upslide or slide -15 @@ -2953,7 +2953,7 @@ } if (m_nType == MOD_TYPE_MOD) pChn->dwFlags |= CHN_FASTVOLRAMP; } - newvolume = CLAMP(newvolume, 0, 256); + newvolume = Clamp(newvolume, 0, 256); pChn->nVolume = newvolume; } @@ -3757,12 +3757,17 @@ } else { // Not an internal device. Pass on to appropriate plugin. - const CHANNELINDEX nMasterCh = (nChn < GetNumChannels()) ? nChn + 1 : pChn->nMasterChn; - if((nMasterCh) && (nMasterCh <= GetNumChannels())) + const CHANNELINDEX plugChannel = (nChn < GetNumChannels()) ? nChn + 1 : pChn->nMasterChn; + if(plugChannel > 0 && plugChannel <= GetNumChannels()) // XXX do we need this? { - const PLUGINDEX nPlug = (pChn->dwFlags & CHN_NOFX) ? 0 : ((plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted)); - if((nPlug) && (nPlug <= MAX_MIXPLUGINS)) + PLUGINDEX nPlug = 0; + if(!(pChn->dwFlags & CHN_NOFX)) { + nPlug = (plugin != 0) ? plugin : GetBestPlugin(nChn, PrioritiseChannel, EvenIfMuted); + } + + if(nPlug > 0 && nPlug <= MAX_MIXPLUGINS) + { IMixPlugin *pPlugin = m_MixPlugins[nPlug - 1].pMixPlugin; if ((pPlugin) && (m_MixPlugins[nPlug - 1].pMixState)) { @@ -3796,29 +3801,28 @@ // -> CODE#0010 // -> DESC="add extended parameter mechanism to pattern effects" // rewbs.NOTE: maybe move param calculation outside of method to cope with [ effect. - //if (param) pChn->nOldOffset = param; else param = pChn->nOldOffset; - //param <<= 8; - //param |= (UINT)(pChn->nOldHiOffset) << 16; - ModCommand *m; - m = NULL; + //if (param) pChn->nOldOffset = param; else param = pChn->nOldOffset; + //param <<= 8; + //param |= (UINT)(pChn->nOldHiOffset) << 16; + ModCommand *m = nullptr; - if(m_nRow < Patterns[m_nPattern].GetNumRows() - 1) m = Patterns[m_nPattern].GetpModCommand(m_nRow + 1, nChn); + if(m_nRow < Patterns[m_nPattern].GetNumRows() - 1) m = Patterns[m_nPattern].GetpModCommand(m_nRow + 1, nChn); - if(m && m->command == CMD_XPARAM) - { - UINT tmp = m->param; - m = NULL; - if(m_nRow < Patterns[m_nPattern].GetNumRows() - 2) m = Patterns[m_nPattern].GetpModCommand(m_nRow + 2, nChn); + if(m && m->command == CMD_XPARAM) + { + UINT tmp = m->param; + m = nullptr; + if(m_nRow < Patterns[m_nPattern].GetNumRows() - 2) m = Patterns[m_nPattern].GetpModCommand(m_nRow + 2, nChn); - if(m && m->command == CMD_XPARAM) param = (param << 16) + (tmp << 8) + m->param; - else param = (param<<8) + tmp; - } - else - { - if (param) pChn->nOldOffset = param; else param = pChn->nOldOffset; - param <<= 8; - param |= (UINT)(pChn->nOldHiOffset) << 16; - } + if(m && m->command == CMD_XPARAM) param = (param << 16) + (tmp << 8) + m->param; + else param = (param<<8) + tmp; + } + else + { + if (param) pChn->nOldOffset = param; else param = pChn->nOldOffset; + param <<= 8; + param |= (UINT)(pChn->nOldHiOffset) << 16; + } // -! NEW_FEATURE#0010 if ((pChn->rowCommand.note >= NOTE_MIN) && (pChn->rowCommand.note <= NOTE_MAX)) @@ -4382,7 +4386,7 @@ { if ((!note) || (note >= NOTE_MIN_SPECIAL)) return 0; if (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_MDL|MOD_TYPE_ULT|MOD_TYPE_WAV - |MOD_TYPE_FAR|MOD_TYPE_DMF|MOD_TYPE_PTM|MOD_TYPE_AMS|MOD_TYPE_DBM|MOD_TYPE_AMF|MOD_TYPE_PSM|MOD_TYPE_J2B|MOD_TYPE_IMF)) + |MOD_TYPE_FAR|MOD_TYPE_DMF|MOD_TYPE_PTM|MOD_TYPE_AMS|MOD_TYPE_AMS2|MOD_TYPE_DBM|MOD_TYPE_AMF|MOD_TYPE_PSM|MOD_TYPE_J2B|MOD_TYPE_IMF)) { note--; if (m_dwSongFlags & SONG_LINEARSLIDES) @@ -4598,8 +4602,10 @@ { if (m_bChannelMuteTogglePending[chan]) { - if(m_pModDoc) - m_pModDoc->MuteChannel(chan, !m_pModDoc->IsChannelMuted(chan)); + if(GetpModDoc()) + { + GetpModDoc()->MuteChannel(chan, !GetpModDoc()->IsChannelMuted(chan)); + } m_bChannelMuteTogglePending[chan] = false; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-06-30 23:41:42
|
Revision: 1312 http://modplug.svn.sourceforge.net/modplug/?rev=1312&view=rev Author: saga-games Date: 2012-06-30 23:41:35 +0000 (Sat, 30 Jun 2012) Log Message: ----------- [Fix] FT2 compatibility: Fixed gxx memory (tx coda) as well as combinations of gxx and Gxx. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-06-30 18:26:37 UTC (rev 1311) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-06-30 23:41:35 UTC (rev 1312) @@ -1926,10 +1926,23 @@ { if (volcmd == VOLCMD_TONEPORTAMENTO) { - if (m_nType & (MOD_TYPE_IT | MOD_TYPE_MPT)) - TonePortamento(pChn, ImpulseTrackerPortaVolCmd[vol & 0x0F]); - else if(vol != 0 || !IsCompatibleMode(TRK_FASTTRACKER2)) - TonePortamento(pChn, vol * 16); + UINT param = 0; + if(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) + { + param = ImpulseTrackerPortaVolCmd[vol & 0x0F]; + } else + { + if(cmd == CMD_TONEPORTAMENTO && GetType() == MOD_TYPE_XM) + { + // Yes, FT2 is *that* weird. If there is a Mx command in the volume column + // and a normal 3xx command, the 3xx command is ignored but the Mx command's + // effectiveness is doubled. + cmd = CMD_NONE; + vol *= 2; + } + param = vol << 4; + } + TonePortamento(pChn, param); } else { // XM Compatibility: FT2 ignores some volume commands with parameter = 0. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-07-09 00:54:44
|
Revision: 1321 http://modplug.svn.sourceforge.net/modplug/?rev=1321&view=rev Author: saga-games Date: 2012-07-09 00:54:37 +0000 (Mon, 09 Jul 2012) Log Message: ----------- [Fix] Dxx/Bxx precendce in MOD files was wrong afterall (tx Bubsy). Test case: PatternJump.mod Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-07-07 18:03:04 UTC (rev 1320) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-07-09 00:54:37 UTC (rev 1321) @@ -287,7 +287,8 @@ nNextOrder = (ORDERINDEX)param; nNextPatStartRow = 0; // FT2 E60 bug // see http://forum.openmpt.org/index.php?topic=2769.0 - FastTracker resets Dxx if Bxx is called _after_ Dxx - if(!patternBreakOnThisRow || (GetType() == MOD_TYPE_XM)) + // Test case: PatternJump.mod + if(!patternBreakOnThisRow || (GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM))) nNextRow = 0; if ((adjustMode & eAdjust)) @@ -979,6 +980,7 @@ } } // IT Compatibility: Update multisample instruments frequency even if instrument is not specified (fixes the guitars in spx-shuttledeparture.it) + // Test case: freqreset-noins.it if(!bPorta && pSmp && IsCompatibleMode(TRK_IMPULSETRACKER)) pChn->nC5Speed = pSmp->nC5Speed; if(bPorta && pChn->nInc == 0) @@ -1128,6 +1130,8 @@ pChn->nTremorCount = 0; } else { + // FT2 Compatibility: Weird XM tremor. + // Test case: Tremor.xm pChn->nTremorCount = 0x20; } } @@ -1598,6 +1602,7 @@ } // IT compatibility 08. Handling of out-of-range delay command. + // Additional test case: tickdelay.it if(nStartTick >= GetNumTicksOnCurrentRow() && IsCompatibleMode(TRK_IMPULSETRACKER)) { if(instr) @@ -1678,12 +1683,12 @@ if(ModCommand::IsNote(note) && IsCompatibleMode(TRK_FASTTRACKER2)) { // Notes that exceed FT2's limit are completely ignored. - // Test case: note-limit.xm + // Test case: NoteLimit.xm int transpose = pChn->nTranspose; if(instr && !bPorta) { // Refresh transpose - // Test case: note-limit 2.xm + // Test case: NoteLimit2.xm SAMPLEINDEX sample = SAMPLEINDEX_INVALID; if(GetNumInstruments()) { @@ -1943,6 +1948,7 @@ // Yes, FT2 is *that* weird. If there is a Mx command in the volume column // and a normal 3xx command, the 3xx command is ignored but the Mx command's // effectiveness is doubled. + // Test case: TonePortamentoMemory.xm cmd = CMD_NONE; vol *= 2; } @@ -1962,6 +1968,7 @@ break; case VOLCMD_PANSLIDELEFT: // FT2 Compatibility: Pan slide left with zero parameter causes panning to be set to full left on every non-row tick. + // Test case: PanSlideZero.xm if(!(m_dwSongFlags & SONG_FIRSTTICK)) { pChn->nPan = 0; @@ -2133,6 +2140,7 @@ case CMD_OFFSET: if (m_nTickCount) break; // FT2 compatibility: Portamento + Offset = Ignore offset + // Test case: porta-offset.xm if(bPorta && GetType() == MOD_TYPE_XM) { break; @@ -2398,8 +2406,10 @@ //instant jumps - modifying behavior so that now position jumps //occurs also when pattern loop is enabled. } + // see http://forum.openmpt.org/index.php?topic=2769.0 - FastTracker resets Dxx if Bxx is called _after_ Dxx - if(GetType() == MOD_TYPE_XM && nBreakRow != ROWINDEX_INVALID) + // Test case: PatternJump.mod + if((GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM)) && nBreakRow != ROWINDEX_INVALID) { nBreakRow = 0; } @@ -2515,6 +2525,7 @@ // Update the effect memory of all S3M effects that use the last non-zero effect parameter ot show up (Dxy, Exx, Fxx, Ixy, Jxy, Kxy, Lxy, Qxy, Rxy, Sxy) +// Test case: ParamMemory.s3m void CSoundFile::UpdateS3MEffectMemory(ModChannel *pChn, UINT param) const //------------------------------------------------------------------------ { @@ -4003,6 +4014,7 @@ if (param < 0x100) bResetEnv = true; } // IT compatibility: Really weird combination of envelopes and retrigger (see Storlek's q.it testcase) + // Test case: retrig.it NoteChange(nChn, nNote, IsCompatibleMode(TRK_IMPULSETRACKER), bResetEnv); if (m_nInstruments) { @@ -4147,6 +4159,7 @@ if (pChn->nLength > pChn->nLoopEnd) pChn->nLength = pChn->nLoopEnd; if(pChn->nPos > pChn->nLength) { + // Test case: SusAfterLoop.it pChn->nPos = pChn->nPos - pChn->nLength + pChn->nLoopStart; pChn->nPosLo = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-07-20 16:49:50
|
Revision: 1331 http://modplug.svn.sourceforge.net/modplug/?rev=1331&view=rev Author: saga-games Date: 2012-07-20 16:49:43 +0000 (Fri, 20 Jul 2012) Log Message: ----------- [Fix] XM compatibility: FT2 ignores any notes next to note delays if the delay is greater than the current speed (*ignoring* any pattern delays). Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-07-19 21:26:58 UTC (rev 1330) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-07-20 16:49:43 UTC (rev 1331) @@ -1590,7 +1590,7 @@ NoteCut(nChn, cutAtTick); } else if ((cmd == CMD_MODCMDEX) || (cmd == CMD_S3MCMDEX)) { - if ((!param) && (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) param = pChn->nOldCmdEx; else pChn->nOldCmdEx = param; + if ((!param) && (GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) param = pChn->nOldCmdEx; else pChn->nOldCmdEx = param; // Note Delay ? if ((param & 0xF0) == 0xD0) { @@ -1602,13 +1602,11 @@ nStartTick = 1; //ST3 ignores notes with SD0 completely else if(GetType() == MOD_TYPE_S3M) - nStartTick = UINT_MAX; - } - - // IT compatibility 08. Handling of out-of-range delay command. - // Additional test case: tickdelay.it - if(nStartTick >= GetNumTicksOnCurrentRow() && IsCompatibleMode(TRK_IMPULSETRACKER)) + continue; + } else if(nStartTick >= GetNumTicksOnCurrentRow() && IsCompatibleMode(TRK_IMPULSETRACKER)) { + // IT compatibility 08. Handling of out-of-range delay command. + // Additional test case: tickdelay.it if(instr) { if(GetNumInstruments() < 1 && instr < MAX_SAMPLES) @@ -1621,6 +1619,12 @@ } } continue; + } else if(nStartTick >= m_nMusicSpeed && IsCompatibleMode(TRK_FASTTRACKER2)) + { + // FT2 compatibility: Note delays greater than the song speed should be ignored. + // However, EEx pattern delay is *not* considered at all. + // Test case: DelayCombination.xm + continue; } } else if(m_SongFlags[SONG_FIRSTTICK]) { @@ -1738,9 +1742,7 @@ { // XM: Key-Off + Sample == Note Cut (BUT: Only if no instr number or volume effect is present!) - if(note == NOTE_KEYOFF - && ((!instr && volcmd == VOLCMD_NONE && cmd != CMD_VOLUME) || !IsCompatibleMode(TRK_FASTTRACKER2)) - && (pChn->pModInstrument == nullptr || !pChn->pModInstrument->VolEnv.dwFlags[ENV_ENABLED])) + if ((note == NOTE_KEYOFF) && ((!instr && volcmd == VOLCMD_NONE && cmd != CMD_VOLUME) || !IsCompatibleMode(TRK_FASTTRACKER2)) && ((!pChn->pModInstrument) || (!(pChn->pModInstrument->VolEnv.dwFlags & ENV_ENABLED)))) { pChn->dwFlags.set(CHN_FASTVOLRAMP); pChn->nVolume = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2012-08-27 00:17:51
|
Revision: 1346 http://modplug.svn.sourceforge.net/modplug/?rev=1346&view=rev Author: saga-games Date: 2012-08-27 00:17:44 +0000 (Mon, 27 Aug 2012) Log Message: ----------- [Fix] IT Compatibility: Fixing Compatible Gxx even more... If there's no instrument number next to a portamento effect, also don't reset key-off status (extended test cases Off-Porta.it / Off-Porta-CompatGxx.it). Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-08-26 23:35:54 UTC (rev 1345) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-08-27 00:17:44 UTC (rev 1346) @@ -1083,7 +1083,7 @@ if (!bPorta || (!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT))) || (pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) - || (m_SongFlags[SONG_ITCOMPATGXX] && (pChn->rowCommand.instr))) + || (m_SongFlags[SONG_ITCOMPATGXX] && pChn->rowCommand.instr != 0)) { if((GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && pChn->dwFlags[CHN_NOTEFADE] && !pChn->nFadeOutVol) { @@ -1109,7 +1109,7 @@ // IT compatibility: Don't reset key-off flag on porta notes unless Compat Gxx is enabled // Test case: Off-Porta.it, Off-Porta-CompatGxx.it - if(IsCompatibleMode(TRK_IMPULSETRACKER) && bPorta && !m_SongFlags[SONG_ITCOMPATGXX]) + if(IsCompatibleMode(TRK_IMPULSETRACKER) && bPorta && (!m_SongFlags[SONG_ITCOMPATGXX] || pChn->rowCommand.instr == 0)) pChn->dwFlags.reset(CHN_EXTRALOUD); else pChn->dwFlags.reset(CHN_EXTRALOUD | CHN_KEYOFF); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-01-19 16:50:09
|
Revision: 1503 http://sourceforge.net/p/modplug/code/1503 Author: saga-games Date: 2013-01-19 16:50:01 +0000 (Sat, 19 Jan 2013) Log Message: ----------- [Fix] Revision 1484 changed one variable too much, breaking my tune amegas_remix.it Revision Links: -------------- http://sourceforge.net/p/modplug/code/1484 Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-01-19 16:40:12 UTC (rev 1502) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-01-19 16:50:01 UTC (rev 1503) @@ -795,7 +795,7 @@ reset = (!pChn->nLength || (insNumber && bPorta && m_SongFlags[SONG_ITCOMPATGXX]) || (insNumber && !bPorta && pChn->dwFlags[CHN_NOTEFADE | CHN_KEYOFF] && m_SongFlags[SONG_ITOLDEFFECTS])); - resetAlways = (insNumber || pChn->dwFlags[CHN_KEYOFF]); + resetAlways = (instrumentChanged || pChn->dwFlags[CHN_KEYOFF]); } else { reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-08 18:35:06
|
Revision: 1781 http://sourceforge.net/p/modplug/code/1781 Author: saga-games Date: 2013-04-08 18:34:59 +0000 (Mon, 08 Apr 2013) Log Message: ----------- [Fix] IT Compatibility: Test case vol-env-carry.it broke in rev 1481. Revision Links: -------------- http://sourceforge.net/p/modplug/code/1481 Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-08 17:30:30 UTC (rev 1780) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-08 18:34:59 UTC (rev 1781) @@ -774,7 +774,7 @@ // NOTE: IT2.14 with SB/GUS/etc. output is different. We are going after IT's WAV writer here. // For SB/GUS/etc. emulation, envelope carry should only apply when the NNA isn't set to "Note Cut". // Test case: CarryNNA.it - resetAlways = (instrumentChanged || pChn->dwFlags[CHN_KEYOFF]); + resetAlways = (!pChn->nFadeOutVol || instrumentChanged || pChn->dwFlags[CHN_KEYOFF]); } else { reset = (!bPorta || !(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || m_SongFlags[SONG_ITCOMPATGXX] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-21 18:35:41
|
Revision: 1926 http://sourceforge.net/p/modplug/code/1926 Author: saga-games Date: 2013-04-21 18:35:35 +0000 (Sun, 21 Apr 2013) Log Message: ----------- [Fix] FT2 Compatiblity: Now the Rxy tick-0 behaviour really should be "balls-on" (test case: RetrigTick0.xm) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 17:55:51 UTC (rev 1925) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 18:35:35 UTC (rev 1926) @@ -4123,12 +4123,13 @@ } else if(IsCompatibleMode(TRK_FASTTRACKER2) && (param & 0x100)) { // Buggy-like-hell FT2 Rxy retrig! + // Test case: retrig.xm if(m_SongFlags[SONG_FIRSTTICK]) { // Here are some really stupid things FT2 does. + // Test case: RetrigTick0.xm if(chn.rowCommand.volcmd == VOLCMD_VOLUME) return; - if(chn.rowCommand.instr > 0 && chn.rowCommand.note == NOTE_NONE) nRetrigCount = 1; - if(chn.rowCommand.IsNote()) nRetrigCount = 1; + if(chn.rowCommand.instr > 0 && chn.rowCommand.IsNoteOrEmpty()) nRetrigCount = 1; } if (nRetrigCount >= nRetrigSpeed) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-21 18:56:28
|
Revision: 1927 http://sourceforge.net/p/modplug/code/1927 Author: saga-games Date: 2013-04-21 18:56:04 +0000 (Sun, 21 Apr 2013) Log Message: ----------- [Fix] Even more stupid tick 0 fixes for XM Rxy. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 18:35:35 UTC (rev 1926) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 18:56:04 UTC (rev 1927) @@ -4126,14 +4126,14 @@ // Test case: retrig.xm if(m_SongFlags[SONG_FIRSTTICK]) { - // Here are some really stupid things FT2 does. + // Here are some really stupid things FT2 does on the first tick. // Test case: RetrigTick0.xm if(chn.rowCommand.volcmd == VOLCMD_VOLUME) return; if(chn.rowCommand.instr > 0 && chn.rowCommand.IsNoteOrEmpty()) nRetrigCount = 1; } - if (nRetrigCount >= nRetrigSpeed) + if(nRetrigCount >= nRetrigSpeed) { - if(!m_SongFlags[SONG_FIRSTTICK] || chn.rowCommand.note == NOTE_NONE) + if(!m_SongFlags[SONG_FIRSTTICK] || !chn.rowCommand.IsNote()) { bDoRetrig = true; nRetrigCount = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-21 19:47:47
|
Revision: 1928 http://sourceforge.net/p/modplug/code/1928 Author: saga-games Date: 2013-04-21 19:47:37 +0000 (Sun, 21 Apr 2013) Log Message: ----------- [Fix] Even more Rxy fixes. -_- Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 18:56:04 UTC (rev 1927) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 19:47:37 UTC (rev 1928) @@ -4104,9 +4104,9 @@ { // Retrig: bit 8 is set if it's the new XM retrig ModChannel &chn = Chn[nChn]; - int nRetrigSpeed = param & 0x0F; - int nRetrigCount = chn.nRetrigCount; - bool bDoRetrig = false; + int retrigSpeed = param & 0x0F; + int retrigCount = chn.nRetrigCount; + bool doRetrig = false; // IT compatibility 15. Retrigger if(IsCompatibleMode(TRK_IMPULSETRACKER)) @@ -4114,11 +4114,10 @@ if(m_nTickCount == 0 && chn.rowCommand.note) { chn.nRetrigCount = param & 0xf; - } - else if(!chn.nRetrigCount || !--chn.nRetrigCount) + } else if(!chn.nRetrigCount || !--chn.nRetrigCount) { chn.nRetrigCount = param & 0xf; - bDoRetrig = true; + doRetrig = true; } } else if(IsCompatibleMode(TRK_FASTTRACKER2) && (param & 0x100)) { @@ -4128,15 +4127,19 @@ { // Here are some really stupid things FT2 does on the first tick. // Test case: RetrigTick0.xm - if(chn.rowCommand.volcmd == VOLCMD_VOLUME) return; - if(chn.rowCommand.instr > 0 && chn.rowCommand.IsNoteOrEmpty()) nRetrigCount = 1; + if(chn.rowCommand.instr > 0 && chn.rowCommand.IsNoteOrEmpty()) retrigCount = 1; + if(chn.rowCommand.volcmd == VOLCMD_VOLUME) + { + chn.nRetrigCount = retrigCount; + return; + } } - if(nRetrigCount >= nRetrigSpeed) + if(retrigCount >= retrigSpeed) { if(!m_SongFlags[SONG_FIRSTTICK] || !chn.rowCommand.IsNote()) { - bDoRetrig = true; - nRetrigCount = 0; + doRetrig = true; + retrigCount = 0; } } } else @@ -4144,23 +4147,23 @@ // old routines if (GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT)) { - if (!nRetrigSpeed) nRetrigSpeed = 1; - if ((nRetrigCount) && (!(nRetrigCount % nRetrigSpeed))) bDoRetrig = true; - nRetrigCount++; + if (!retrigSpeed) retrigSpeed = 1; + if ((retrigCount) && (!(retrigCount % retrigSpeed))) doRetrig = true; + retrigCount++; } else { - int realspeed = nRetrigSpeed; + int realspeed = retrigSpeed; // FT2 bug: if a retrig (Rxy) occours together with a volume command, the first retrig interval is increased by one tick if ((param & 0x100) && (chn.rowCommand.volcmd == VOLCMD_VOLUME) && (chn.rowCommand.param & 0xF0)) realspeed++; if(!m_SongFlags[SONG_FIRSTTICK] || (param & 0x100)) { if (!realspeed) realspeed = 1; - if ((!(param & 0x100)) && (m_nMusicSpeed) && (!(m_nTickCount % realspeed))) bDoRetrig = true; - nRetrigCount++; - } else if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) nRetrigCount = 0; - if (nRetrigCount >= realspeed) + if ((!(param & 0x100)) && (m_nMusicSpeed) && (!(m_nTickCount % realspeed))) doRetrig = true; + retrigCount++; + } else if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) retrigCount = 0; + if (retrigCount >= realspeed) { - if ((m_nTickCount) || ((param & 0x100) && (!chn.rowCommand.note))) bDoRetrig = true; + if ((m_nTickCount) || ((param & 0x100) && (!chn.rowCommand.note))) doRetrig = true; } } } @@ -4172,7 +4175,7 @@ return; } - if (bDoRetrig) + if(doRetrig) { UINT dv = (param >> 4) & 0x0F; if (dv) @@ -4193,46 +4196,46 @@ chn.nVolume = vol; chn.dwFlags.set(CHN_FASTVOLRAMP); } - UINT nNote = chn.nNewNote; - int32 nOldPeriod = chn.nPeriod; - if ((nNote) && (nNote <= NOTE_MAX) && (chn.nLength)) CheckNNA(nChn, 0, nNote, true); - bool bResetEnv = false; - if (GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) + UINT note = chn.nNewNote; + int32 oldPeriod = chn.nPeriod; + if ((note) && (note <= NOTE_MAX) && (chn.nLength)) CheckNNA(nChn, 0, note, true); + bool resetEnv = false; + if(GetType() & (MOD_TYPE_XM|MOD_TYPE_MT2)) { - if ((chn.rowCommand.instr) && (param < 0x100)) + if((chn.rowCommand.instr) && (param < 0x100)) { InstrumentChange(&chn, chn.rowCommand.instr, false, false); - bResetEnv = true; + resetEnv = true; } - if (param < 0x100) bResetEnv = true; + if (param < 0x100) resetEnv = true; } // IT compatibility: Really weird combination of envelopes and retrigger (see Storlek's q.it testcase) // Test case: retrig.it - NoteChange(nChn, nNote, IsCompatibleMode(TRK_IMPULSETRACKER), bResetEnv); + NoteChange(nChn, note, IsCompatibleMode(TRK_IMPULSETRACKER), resetEnv); if(m_nInstruments) { - chn.rowCommand.note = nNote; // No retrig without note... + chn.rowCommand.note = note; // No retrig without note... ProcessMidiOut(nChn); //Send retrig to Midi } - if ((GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!chn.rowCommand.note) && (nOldPeriod)) chn.nPeriod = nOldPeriod; - if (!(GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) nRetrigCount = 0; + if ((GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!chn.rowCommand.note) && (oldPeriod)) chn.nPeriod = oldPeriod; + if (!(GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) retrigCount = 0; // IT compatibility: see previous IT compatibility comment =) if(IsCompatibleMode(TRK_IMPULSETRACKER)) chn.nPos = chn.nPosLo = 0; - if (offset) //rewbs.volOffset: apply offset on retrig + if(offset) //rewbs.volOffset: apply offset on retrig { - if (chn.pModSample) + if(chn.pModSample) chn.nLength = chn.pModSample->nLength; SampleOffset(nChn, offset); } } // buggy-like-hell FT2 Rxy retrig! - if(IsCompatibleMode(TRK_FASTTRACKER2) && (param & 0x100)) nRetrigCount++; + if(IsCompatibleMode(TRK_FASTTRACKER2) && (param & 0x100)) retrigCount++; // Now we can also store the retrig value for IT... if(!IsCompatibleMode(TRK_IMPULSETRACKER)) - chn.nRetrigCount = nRetrigCount; + chn.nRetrigCount = retrigCount; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-21 20:57:33
|
Revision: 1929 http://sourceforge.net/p/modplug/code/1929 Author: saga-games Date: 2013-04-21 20:57:27 +0000 (Sun, 21 Apr 2013) Log Message: ----------- [Fix] I can't believe this Rxy stuff was still wrong... or can I? Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 19:47:37 UTC (rev 1928) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-21 20:57:27 UTC (rev 1929) @@ -4128,8 +4128,9 @@ // Here are some really stupid things FT2 does on the first tick. // Test case: RetrigTick0.xm if(chn.rowCommand.instr > 0 && chn.rowCommand.IsNoteOrEmpty()) retrigCount = 1; - if(chn.rowCommand.volcmd == VOLCMD_VOLUME) + if(chn.rowCommand.volcmd == VOLCMD_VOLUME && chn.rowCommand.vol != 0) { + // I guess this condition simply checked if the volume byte was != 0 in FT2. chn.nRetrigCount = retrigCount; return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-04-22 21:47:51
|
Revision: 1940 http://sourceforge.net/p/modplug/code/1940 Author: manxorist Date: 2013-04-22 21:47:30 +0000 (Mon, 22 Apr 2013) Log Message: ----------- [Ref] ProcessMidiOut should be inside #ifdef MODPLUG_TRACKER. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-22 21:19:29 UTC (rev 1939) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-22 21:47:30 UTC (rev 1940) @@ -4216,7 +4216,9 @@ if(m_nInstruments) { chn.rowCommand.note = note; // No retrig without note... +#ifdef MODPLUG_TRACKER ProcessMidiOut(nChn); //Send retrig to Midi +#endif // MODPLUG_TRACKER } if ((GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT)) && (!chn.rowCommand.note) && (oldPeriod)) chn.nPeriod = oldPeriod; if (!(GetType() & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_MPT))) retrigCount = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-04-28 16:11:33
|
Revision: 1995 http://sourceforge.net/p/modplug/code/1995 Author: saga-games Date: 2013-04-28 16:11:23 +0000 (Sun, 28 Apr 2013) Log Message: ----------- [Fix] Noteoff with no volume envelope only should fade the sample if there is a volume command in the volume column (previously this applied to all kinds of commands in this column). Test case: NoteOffVolume.xm, http://bugs.openmpt.org/view.php?id=387 Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-28 15:53:16 UTC (rev 1994) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-04-28 16:11:23 UTC (rev 1995) @@ -1804,8 +1804,9 @@ { // XM: Key-Off + Sample == Note Cut (BUT: Only if no instr number or volume effect is present!) + // Test case: NoteOffVolume.xm if(note == NOTE_KEYOFF - && ((!instr && volcmd == VOLCMD_NONE && cmd != CMD_VOLUME) || !IsCompatibleMode(TRK_FASTTRACKER2)) + && ((!instr && volcmd != VOLCMD_VOLUME && cmd != CMD_VOLUME) || !IsCompatibleMode(TRK_FASTTRACKER2)) && (pChn->pModInstrument == nullptr || !pChn->pModInstrument->VolEnv.dwFlags[ENV_ENABLED])) { pChn->dwFlags.set(CHN_FASTVOLRAMP); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-05-12 19:33:21
|
Revision: 2074 http://sourceforge.net/p/modplug/code/2074 Author: saga-games Date: 2013-05-12 19:33:13 +0000 (Sun, 12 May 2013) Log Message: ----------- [Fix] S9F kind of broke in rev 1993 instead of being improved... Revision Links: -------------- http://sourceforge.net/p/modplug/code/1993 Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-05-12 14:34:36 UTC (rev 2073) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-05-12 19:33:13 UTC (rev 2074) @@ -3632,7 +3632,7 @@ break; // S9F: Go backward (and set playback position to the end if sample just started) case 0x0F: - if(!pChn->nPos && pChn->nLength && !pChn->rowCommand.IsNote()) + if(!pChn->nPos && pChn->nLength && (pChn->rowCommand.IsNote() || !pChn->dwFlags[CHN_LOOP])) { pChn->nPos = pChn->nLength - 1; pChn->nPosLo = 0xFFFF; @@ -4097,7 +4097,7 @@ pChn->nVolume = pChn->nPeriod = 0; } } - } else if ((param < pChn->nLength) && (GetType() & (MOD_TYPE_MTM|MOD_TYPE_DMF))) + } else if ((param < pChn->nLength) && (GetType() & (MOD_TYPE_MTM | MOD_TYPE_DMF | MOD_TYPE_MDL))) { // Some trackers can also call offset effects without notes next to them... pChn->nPos = param; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2013-06-22 22:35:04
|
Revision: 2400 http://sourceforge.net/p/modplug/code/2400 Author: saga-games Date: 2013-06-22 22:34:56 +0000 (Sat, 22 Jun 2013) Log Message: ----------- [Fix] IT compatibility: Fine volume slides in the volume column are only executed on the first tick, and not on multiples of the first tick in case of a pattern delay. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-06-21 16:47:24 UTC (rev 2399) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-06-22 22:34:56 UTC (rev 2400) @@ -2148,15 +2148,25 @@ break; case VOLCMD_FINEVOLUP: - // IT Compatibility: Volume column volume slides have their own memory - // Test case: VolColMemory.it - FineVolumeUp(pChn, vol, IsCompatibleMode(TRK_IMPULSETRACKER)); + // IT Compatibility: Fine volume slides in the volume column are only executed on the first tick, not on multiples of the first tick in case of pattern delay + // Test case: FineVolColSlide.it + if(m_nTickCount == 0 || !IsCompatibleMode(TRK_IMPULSETRACKER)) + { + // IT Compatibility: Volume column volume slides have their own memory + // Test case: VolColMemory.it + FineVolumeUp(pChn, vol, IsCompatibleMode(TRK_IMPULSETRACKER)); + } break; case VOLCMD_FINEVOLDOWN: - // IT Compatibility: Volume column volume slides have their own memory - // Test case: VolColMemory.it - FineVolumeDown(pChn, vol, IsCompatibleMode(TRK_IMPULSETRACKER)); + // IT Compatibility: Fine volume slides in the volume column are only executed on the first tick, not on multiples of the first tick in case of pattern delay + // Test case: FineVolColSlide.it + if(m_nTickCount == 0 || !IsCompatibleMode(TRK_IMPULSETRACKER)) + { + // IT Compatibility: Volume column volume slides have their own memory + // Test case: VolColMemory.it + FineVolumeDown(pChn, vol, IsCompatibleMode(TRK_IMPULSETRACKER)); + } break; case VOLCMD_VIBRATOSPEED: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <man...@us...> - 2013-06-30 16:11:37
|
Revision: 2448 http://sourceforge.net/p/modplug/code/2448 Author: manxorist Date: 2013-06-30 16:11:29 +0000 (Sun, 30 Jun 2013) Log Message: ----------- [Ref] Silence a gcc warning. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-06-30 16:07:07 UTC (rev 2447) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2013-06-30 16:11:29 UTC (rev 2448) @@ -995,7 +995,7 @@ // save the note that's actually used, as it's necessary to properly calculate PPS and stuff const int realnote = note; - if((pIns) && (note - NOTE_MIN < CountOf(pIns->Keyboard))) + if((pIns) && (note - NOTE_MIN < (int)CountOf(pIns->Keyboard))) { UINT n = pIns->Keyboard[note - NOTE_MIN]; if((n) && (n < MAX_SAMPLES)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-01-01 19:41:55
|
Revision: 3541 http://sourceforge.net/p/modplug/code/3541 Author: saga-games Date: 2014-01-01 19:41:45 +0000 (Wed, 01 Jan 2014) Log Message: ----------- [Fix] XM compatibility: The E90 command retriggers the note instantly and only once per row. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-01 19:04:56 UTC (rev 3540) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-01 19:41:45 UTC (rev 3541) @@ -4282,6 +4282,11 @@ { if ((m_nTickCount) || ((param & 0x100) && (!chn.rowCommand.note))) doRetrig = true; } + if(IsCompatibleMode(TRK_FASTTRACKER2) && param == 0) + { + // E90 = Retrig instantly, and only once + doRetrig = (m_nTickCount == 0); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-01-02 16:36:22
|
Revision: 3551 http://sourceforge.net/p/modplug/code/3551 Author: saga-games Date: 2014-01-02 16:36:08 +0000 (Thu, 02 Jan 2014) Log Message: ----------- [Fix] More DBM fixes for libopenmpt. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-02 16:27:20 UTC (rev 3550) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-02 16:36:08 UTC (rev 3551) @@ -3198,7 +3198,7 @@ else param = pChn->nOldVolumeSlide; - if((GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM | MOD_TYPE_MT2 | MOD_TYPE_MED | MOD_TYPE_DIGI | MOD_TYPE_DBM))) + if((GetType() & (MOD_TYPE_MOD | MOD_TYPE_XM | MOD_TYPE_MT2 | MOD_TYPE_MED | MOD_TYPE_DIGI))) { // MOD / XM nibble priority if((param & 0xF0) != 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-01-16 16:01:53
|
Revision: 3580 http://sourceforge.net/p/modplug/code/3580 Author: saga-games Date: 2014-01-16 16:01:46 +0000 (Thu, 16 Jan 2014) Log Message: ----------- [Fix] VSTi notes broke in r3578. Revision Links: -------------- http://sourceforge.net/p/modplug/code/3578 Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-15 22:48:37 UTC (rev 3579) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-01-16 16:01:46 UTC (rev 3580) @@ -733,13 +733,12 @@ } // Update Volume - if (bUpdVol) + if (bUpdVol && (!(GetType() & (MOD_TYPE_MOD | MOD_TYPE_S3M)) || (pSmp != nullptr && pSmp->pSample != nullptr))) { - if(!(GetType() & (MOD_TYPE_MOD | MOD_TYPE_S3M)) || pSmp->pSample != nullptr) + pChn->nVolume = 0; + if(pSmp) { - pChn->nVolume = 0; - if(pSmp) - pChn->nVolume = pSmp->nVolume; + pChn->nVolume = pSmp->nVolume; } else { if(pIns && pIns->nMixPlug) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-02-05 22:15:47
|
Revision: 3665 http://sourceforge.net/p/modplug/code/3665 Author: saga-games Date: 2014-02-05 22:15:39 +0000 (Wed, 05 Feb 2014) Log Message: ----------- [Fix] FT2 compatibility: Super mind-boggling combination of portamento and note-delay (PortaDelay.xm) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-05 21:18:59 UTC (rev 3664) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-05 22:15:39 UTC (rev 3665) @@ -1718,12 +1718,6 @@ } } continue; - } else if(nStartTick >= m_nMusicSpeed && IsCompatibleMode(TRK_FASTTRACKER2)) - { - // FT2 compatibility: Note delays greater than the song speed should be ignored. - // However, EEx pattern delay is *not* considered at all. - // Test case: DelayCombination.xm - continue; } } else if(m_SongFlags[SONG_FIRSTTICK]) { @@ -1781,11 +1775,17 @@ } bool triggerNote = (m_nTickCount == nStartTick); // Can be delayed by a note delay effect - // IT compatibility: Delayed notes (using SDx) that are on the same row as a Row Delay effect are retriggered. Scream Tracker 3 does the same. - // Test case: PatternDelay-NoteDelay.it if((GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)) && nStartTick > 0 && (m_nTickCount % (m_nMusicSpeed + m_nFrameDelay)) == nStartTick) { + // IT compatibility: Delayed notes (using SDx) that are on the same row as a Row Delay effect are retriggered. Scream Tracker 3 does the same. + // Test case: PatternDelay-NoteDelay.it triggerNote = true; + } else if(IsCompatibleMode(TRK_FASTTRACKER2) && nStartTick >= m_nMusicSpeed) + { + // FT2 compatibility: Note delays greater than the song speed should be ignored. + // However, EEx pattern delay is *not* considered at all. + // Test case: DelayCombination.xm, PortaDelay.xm + triggerNote = false; } // IT compatibility: Tick-0 vs non-tick-0 effect distinction is always based on tick delay. @@ -1795,6 +1795,13 @@ pChn->isFirstTick = triggerNote; } + // FT2 compatibility: Note + portamento + note delay = no portamento + // Test case: PortaDelay.xm + if(IsCompatibleMode(TRK_FASTTRACKER2) && nStartTick != 0) + { + bPorta = false; + } + // Handles note/instrument/volume changes if(triggerNote) { @@ -2119,6 +2126,13 @@ vol *= 2; } param = vol << 4; + + // FT2 compatibility: If there's a portamento and a note delay, execute the portamento, but don't update the parameter + // Test case: PortaDelay.xm + if(IsCompatibleMode(TRK_FASTTRACKER2) && nStartTick != 0) + { + param = 0; + } } TonePortamento(pChn, param); } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-02-05 22:56:02
|
Revision: 3666 http://sourceforge.net/p/modplug/code/3666 Author: saga-games Date: 2014-02-05 22:55:53 +0000 (Wed, 05 Feb 2014) Log Message: ----------- [Fix] Just when you got it right... Volume column slides are apparently executed on the delayed tick if there's no instrument number Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-05 22:15:39 UTC (rev 3665) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-05 22:55:53 UTC (rev 3666) @@ -2100,11 +2100,12 @@ TODO is this done correctly? */ bool doVolumeColumn = m_nTickCount >= nStartTick; - // FT2 compatibility: If there's a note delay, volume column effects are NOT executed on the first tick and on delayed tick. + // FT2 compatibility: If there's a note delay, volume column effects are NOT executed + // on the first tick and, if there's an instrument number, on the delayed tick. // Test case: VolColDelay.xm if(IsCompatibleMode(TRK_FASTTRACKER2) && nStartTick != 0) { - doVolumeColumn = m_nTickCount != 0 && m_nTickCount != nStartTick; + doVolumeColumn = m_nTickCount != 0 && (m_nTickCount != nStartTick || pChn->rowCommand.instr == 0); } if(volcmd > VOLCMD_PANNING && doVolumeColumn) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-02-06 16:55:32
|
Revision: 3668 http://sourceforge.net/p/modplug/code/3668 Author: saga-games Date: 2014-02-06 16:55:24 +0000 (Thu, 06 Feb 2014) Log Message: ----------- [Fix] Also update pre-computed loop-wraparound when executing Invert Loop on samples (http://bugs.openmpt.org/view.php?id=304) [Fix] FT2 compatibility: lowest 3 bits of finetune are ignored (test case: Finetune-Precision.xm) Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-06 14:33:21 UTC (rev 3667) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-06 16:55:24 UTC (rev 3668) @@ -21,6 +21,7 @@ #endif // MODPLUG_TRACKER #include "tuning.h" #include "Tables.h" +#include "modsmp_ctrl.h" // For updating the loop wraparound data with the invert loop effect #if MPT_COMPILER_MSVC #pragma warning(disable:4244) @@ -3782,7 +3783,7 @@ // TRASH IT!!! (Yes, the sample!) uint8 &sample = static_cast<uint8 *>(pModSample->pSample)[pModSample->nLoopStart + pChn->nEFxOffset]; sample = ~sample; - //AdjustSampleLoop(pModSample); + ctrlSmp::PrecomputeLoops(*pModSample, *this, false); } @@ -4706,11 +4707,11 @@ UINT CSoundFile::GetPeriodFromNote(UINT note, int nFineTune, UINT nC5Speed) const //------------------------------------------------------------------------------- { - if ((!note) || (note >= NOTE_MIN_SPECIAL)) return 0; + if (note == NOTE_NONE || (note >= NOTE_MIN_SPECIAL)) return 0; if (GetType() & (MOD_TYPE_IT|MOD_TYPE_MPT|MOD_TYPE_MT2|MOD_TYPE_S3M|MOD_TYPE_STM|MOD_TYPE_MDL|MOD_TYPE_ULT|MOD_TYPE_WAV |MOD_TYPE_FAR|MOD_TYPE_DMF|MOD_TYPE_PTM|MOD_TYPE_AMS|MOD_TYPE_AMS2|MOD_TYPE_DBM|MOD_TYPE_AMF|MOD_TYPE_PSM|MOD_TYPE_J2B|MOD_TYPE_IMF)) { - note--; + note -= NOTE_MIN; if(m_SongFlags[SONG_LINEARSLIDES]) { return (FreqS3MTable[note % 12] << 5) >> (note / 12); @@ -4726,9 +4727,17 @@ { if (note < 13) note = 13; note -= 13; + + // FT2 Compatibility: The lower three bits of the finetune are truncated. + // Test case: Finetune-Precision.xm + if(IsCompatibleMode(TRK_FASTTRACKER2)) + { + nFineTune &= ~7; + } + if(m_SongFlags[SONG_LINEARSLIDES]) { - LONG l = ((NOTE_MAX - note) << 6) - (nFineTune / 2); + int l = ((NOTE_MAX - note) << 6) - (nFineTune / 2); if (l < 1) l = 1; return (UINT)l; } else @@ -4740,7 +4749,7 @@ int i = rnote + rfine + 8; Limit(i , 0, 103); UINT per1 = XMPeriodTable[i]; - if ( finetune < 0 ) + if(finetune < 0) { rfine--; finetune = -finetune; @@ -4758,10 +4767,10 @@ { note--; nFineTune = XM2MODFineTune(nFineTune); - if ((nFineTune) || (note < 36) || (note >= 36+6*12)) - return (ProTrackerTunedPeriods[nFineTune*12 + note % 12] << 5) >> (note / 12); + if ((nFineTune) || (note < 36) || (note >= 36 + 6 * 12)) + return (ProTrackerTunedPeriods[nFineTune * 12 + note % 12] << 5) >> (note / 12); else - return (ProTrackerPeriodTable[note-36] << 2); + return (ProTrackerPeriodTable[note - 36] << 2); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-02-07 18:59:48
|
Revision: 3671 http://sourceforge.net/p/modplug/code/3671 Author: saga-games Date: 2014-02-07 18:59:41 +0000 (Fri, 07 Feb 2014) Log Message: ----------- [Fix] IT compatibility: S5x should reset panbrello phase. Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-07 18:43:19 UTC (rev 3670) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-07 18:59:41 UTC (rev 3671) @@ -3578,9 +3578,13 @@ case 0x50: // IT compatibility: Ignore waveform types > 3 if(IsCompatibleMode(TRK_IMPULSETRACKER)) + { pChn->nPanbrelloType = (param < 0x04) ? param : 0; - else + pChn->nPanbrelloPos = 0; + } else + { pChn->nPanbrelloType = param & 0x07; + } break; // S6x: Pattern Delay for x frames case 0x60: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sag...@us...> - 2014-02-24 21:52:27
|
Revision: 3770 http://sourceforge.net/p/modplug/code/3770 Author: saga-games Date: 2014-02-24 21:52:19 +0000 (Mon, 24 Feb 2014) Log Message: ----------- [Imp] Song length detection: Assume song stops when encountering an F00 command. [Imp] FT2 compatibility: Apparently FT2's frequency conversion table has other values, which finally explain the %29 in that weird frequency calculation hack... Modified Paths: -------------- trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-24 21:22:14 UTC (rev 3769) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2014-02-24 21:52:19 UTC (rev 3770) @@ -535,6 +535,12 @@ nNextPatStartRow = 0; } + // Interpret F00 effect in XM files as "stop song" + if(GetType() == MOD_TYPE_XM && memory.musicSpeed == uint16_max) + { + break; + } + ROWINDEX rowsPerBeat = m_nDefaultRowsPerBeat; if(Patterns[nPattern].GetOverrideSignature()) { @@ -2348,7 +2354,7 @@ if((!pChn->nPeriod || !pChn->nNote) && (pChn->pModInstrument == nullptr || !pChn->pModInstrument->HasValidMIDIChannel()) // Plugin arpeggio && !IsCompatibleMode(TRK_IMPULSETRACKER | TRK_SCREAMTRACKER)) break; - if ((!param) && (!(GetType() & (MOD_TYPE_S3M | MOD_TYPE_IT | MOD_TYPE_MPT)))) break; // Only important when editing MOD/XM files + if (!param && (GetType() & (MOD_TYPE_XM | MOD_TYPE_MOD))) break; // Only important when editing MOD/XM files (000 effects are removed when loading files where this means "no effect") pChn->nCommand = CMD_ARPEGGIO; if (param) pChn->nArpeggio = param; break; @@ -2371,8 +2377,7 @@ RetrigNote(nChn, pChn->nRetrigParam, vol << 3); else RetrigNote(nChn, pChn->nRetrigParam); - } - else + } else { // XM Retrig if (param) pChn->nRetrigParam = (BYTE)(param & 0xFF); else param = pChn->nRetrigParam; @@ -2800,6 +2805,7 @@ } if(GetType() != MOD_TYPE_DBM) { + // DBM only has fine slides, no extra-fine slides. return; } } @@ -2852,6 +2858,7 @@ } if(GetType() != MOD_TYPE_DBM) { + // DBM only has fine slides, no extra-fine slides. return; } } @@ -3318,26 +3325,22 @@ param = (param & 0xF0) >> 2; nPanSlide = - (int)param; } - } else - if (((param & 0xF0) == 0xF0) && (param & 0x0F)) + } else if (((param & 0xF0) == 0xF0) && (param & 0x0F)) { if(m_SongFlags[SONG_FIRSTTICK]) { nPanSlide = (param & 0x0F) << 2; } - } else + } else if(!m_SongFlags[SONG_FIRSTTICK]) { - if(!m_SongFlags[SONG_FIRSTTICK]) + if (param & 0x0F) { - if (param & 0x0F) - { - // IT compatibility: Ignore slide commands with both nibbles set. - if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (param & 0xF0) == 0) - nPanSlide = (int)((param & 0x0F) << 2); - } else - { - nPanSlide = -(int)((param & 0xF0) >> 2); - } + // IT compatibility: Ignore slide commands with both nibbles set. + if(!(GetType() & (MOD_TYPE_IT | MOD_TYPE_MPT)) || (param & 0xF0) == 0) + nPanSlide = (int)((param & 0x0F) << 2); + } else + { + nPanSlide = -(int)((param & 0xF0) >> 2); } } } else @@ -3359,7 +3362,7 @@ if (nPanSlide) { nPanSlide += pChn->nPan; - nPanSlide = CLAMP(nPanSlide, 0, 256); + nPanSlide = Clamp(nPanSlide, 0, 256); pChn->nPan = nPanSlide; pChn->nRestorePanOnNewNote = 0; } @@ -3434,8 +3437,7 @@ if (((param & 0x0F) == 0x0F) && (param & 0xF0)) { if(m_SongFlags[SONG_FIRSTTICK]) nChnSlide = param >> 4; - } else - if (((param & 0xF0) == 0xF0) && (param & 0x0F)) + } else if (((param & 0xF0) == 0xF0) && (param & 0x0F)) { if(m_SongFlags[SONG_FIRSTTICK]) nChnSlide = - (int)(param & 0x0F); } else @@ -3678,7 +3680,7 @@ pChn->nOldHiOffset = param; if (!IsCompatibleMode(TRK_IMPULSETRACKER) && pChn->rowCommand.IsNote()) { - DWORD pos = param << 16; + SmpLength pos = param << 16; if (pos < pChn->nLength) pChn->nPos = pos; } } @@ -4800,18 +4802,22 @@ } if(m_SongFlags[SONG_LINEARSLIDES]) { - uint32 octave = period / 768; + uint32 octave; if(IsCompatibleMode(TRK_FASTTRACKER2)) { // Under normal circumstances, this calculation returns the same values as the non-compatible one. // However, once the 12 octaves are exceeded (through portamento slides), the octave shift goes // crazy in FT2, meaning that the frequency wraps around randomly... + // The entries in FT2's conversion table are four times as big, hence we have to do an additional shift by two bits. // Test case: FreqWraparound.xm // 12 octaves * (12 * 64) LUT entries = 9216, add 767 for rounding uint32 div = ((9216u + 767u - period) / 768); - octave = ((12 - div) & 0x1F) % 29u; + octave = ((14 - div) & 0x1F); + } else + { + octave = (period / 768) + 2; } - return (XMLinearTable[period % 768] << FREQ_FRACBITS) >> octave; + return (XMLinearTable[period % 768] << (FREQ_FRACBITS + 2)) >> octave; } else { if(!period) period = 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |