From: <sv...@op...> - 2024-11-18 18:11:06
|
Author: sagamusix Date: Mon Nov 18 19:10:59 2024 New Revision: 22219 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22219 Log: Merged revision(s) 22217-22218 from trunk/OpenMPT: [Fix] MED: Avoid importing effect memory for some commands (https://www.un4seen.com/forum/?topic=15448.msg144131#msg144131). ........ [Fix] MOD: In PT mode, retriggered notes should keep using the 9xx offset. [Fix] MED: OctaMED also uses the previous offset for retriggered notes (like MOD), but doesn't have the ProTracker offset adding bug (so more like S3M). Fixes Kris Hadalot.med (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/soundlib/Load_med.cpp branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.31/soundlib/Load_med.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Load_med.cpp Mon Nov 18 19:06:35 2024 (r22218) +++ branches/OpenMPT-1.31/soundlib/Load_med.cpp Mon Nov 18 19:10:59 2024 (r22219) @@ -415,9 +415,29 @@ const uint8 nibbleLo = std::min(param, uint8(0x0F)); switch(command) { + case 0x01: // Portamento Up (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_PORTAMENTOUP, param); + break; + case 0x02: // Portamento Down (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_PORTAMENTODOWN, param); + break; case 0x04: // Vibrato (twice as deep as in ProTracker) m.SetEffectCommand(CMD_VIBRATO, (param & 0xF0) | std::min<uint8>((param & 0x0F) * 2, 0x0F)); break; + case 0x05: // Tone Porta + Volume Slide (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_TONEPORTAVOL, param); + else + m.SetEffectCommand(CMD_TONEPORTAMENTO, 0); + break; + case 0x06: // Vibrato + Volume Slide (avoid effect memory when importing as XM) + if(param) + m.SetEffectCommand(CMD_VIBRATOVOL, param); + else + m.SetEffectCommand(CMD_VIBRATO, 0); + break; case 0x08: // Hold and decay break; case 0x09: // Set secondary speed @@ -433,7 +453,8 @@ m.SetEffectCommand(CMD_VOLUME, static_cast<ModCommand::PARAM>(((param & 0x7F) + 1) / 2)); break; case 0x0D: - m.SetEffectCommand(CMD_VOLUMESLIDE, param); + if(param) + m.SetEffectCommand(CMD_VOLUMESLIDE, param); break; case 0x0E: // Synth jump m.command = CMD_NONE; @@ -1283,6 +1304,7 @@ // For MED, this affects both volume and pitch slides m_SongFlags.set(SONG_FASTVOLSLIDES, !(songHeader.flags & MMDSong::FLAG_STSLIDE)); + m_playBehaviour.set(kST3OffsetWithoutInstrument); if(expData.songNameOffset && file.Seek(expData.songNameOffset)) { Modified: branches/OpenMPT-1.31/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Mon Nov 18 19:06:35 2024 (r22218) +++ branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Mon Nov 18 19:10:59 2024 (r22219) @@ -1958,7 +1958,7 @@ chn.nLoopEnd = pSmp->nLength; chn.nLoopStart = 0; chn.position.Set(0); - if((m_SongFlags[SONG_PT_MODE] || m_playBehaviour[kST3OffsetWithoutInstrument]) && !chn.rowCommand.instr) + if((m_SongFlags[SONG_PT_MODE] || m_playBehaviour[kST3OffsetWithoutInstrument] || GetType() == MOD_TYPE_MED) && !chn.rowCommand.instr) { chn.position.SetInt(std::min(chn.prevNoteOffset, chn.nLength - SmpLength(1))); } else @@ -5438,7 +5438,7 @@ { // ST3 compatibility: Instrument-less note recalls previous note's offset // Test case: OxxMemory.s3m - if(m_playBehaviour[kST3OffsetWithoutInstrument]) + if(m_playBehaviour[kST3OffsetWithoutInstrument] || GetType() == MOD_TYPE_MED) chn.prevNoteOffset = 0; chn.prevNoteOffset += param; @@ -5717,7 +5717,10 @@ const bool fading = chn.dwFlags[CHN_NOTEFADE]; const auto oldPrevNoteOffset = chn.prevNoteOffset; - chn.prevNoteOffset = 0; // Retriggered notes should not use previous offset (test case: OxxMemoryWithRetrig.s3m) + // Retriggered notes should not use previous offset in S3M + // Test cases: OxxMemoryWithRetrig.s3m, PTOffsetRetrigger.mod + if(GetType() == MOD_TYPE_S3M) + chn.prevNoteOffset = 0; // IT compatibility: Really weird combination of envelopes and retrigger (see Storlek's q.it testcase) // Test cases: retrig.it, RetrigSlide.s3m const bool itS3Mstyle = m_playBehaviour[kITRetrigger] || (GetType() == MOD_TYPE_S3M && chn.nLength && !oplRealRetrig); |