From: <sv...@op...> - 2024-11-18 18:06:42
|
Author: sagamusix Date: Mon Nov 18 19:06:35 2024 New Revision: 22218 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22218 Log: [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). [Fix] MED: Execute the initial sequence speed setter immediately. Fixes Kris Hadalot.med (https://www.un4seen.com/forum/?topic=15448.msg144130#msg144130). Modified: trunk/OpenMPT/soundlib/Load_med.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp Modified: trunk/OpenMPT/soundlib/Load_med.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Load_med.cpp Sun Nov 17 23:43:57 2024 (r22217) +++ trunk/OpenMPT/soundlib/Load_med.cpp Mon Nov 18 19:06:35 2024 (r22218) @@ -688,7 +688,7 @@ static void TranslateMEDSynthScript(std::array<uint8, 128> &arr, size_t numEntries, uint8 speed, uint8 hold, uint8 decay, InstrumentSynth::Events &events, bool isVolume) { - events.push_back(InstrumentSynth::Event::SetStepSpeed(speed, false)); + events.push_back(InstrumentSynth::Event::SetStepSpeed(speed, true)); if(hold && isVolume) events.push_back(InstrumentSynth::Event::MED_HoldDecay(hold, decay)); @@ -1494,6 +1494,7 @@ m_SongFlags.set(SONG_FASTVOLSLIDES, !(songHeader.flags & MMDSong::FLAG_STSLIDE)); m_SongFlags.set(SONG_FASTPORTAS, !(songHeader.flags& MMDSong::FLAG_STSLIDE)); + m_playBehaviour.set(kST3OffsetWithoutInstrument); if(expData.songNameOffset && file.Seek(expData.songNameOffset)) { Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp ============================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp Sun Nov 17 23:43:57 2024 (r22217) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp Mon Nov 18 19:06:35 2024 (r22218) @@ -2050,7 +2050,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 @@ -5878,7 +5878,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; @@ -6160,7 +6160,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); |