From: <sv...@op...> - 2025-02-07 22:21:30
|
Author: sagamusix Date: Fri Feb 7 23:21:23 2025 New Revision: 22866 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22866 Log: Merged revision(s) 22864 from trunk/OpenMPT: [Fix] Don't execute sample cues when a channel is actually an Adlib channel. Sample cues share memory with the OPL patch data. ........ Modified: branches/OpenMPT-1.30/ (props changed) branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.30/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Fri Feb 7 23:21:03 2025 (r22865) +++ branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Fri Feb 7 23:21:23 2025 (r22866) @@ -1005,7 +1005,7 @@ startTick = playState.m_nMusicSpeed - 1; } else if(m.volcmd == VOLCMD_OFFSET) { - if(chn.pModSample != nullptr && m.vol <= std::size(chn.pModSample->cues)) + if(chn.pModSample != nullptr && !chn.pModSample->uFlags[CHN_ADLIB] && m.vol <= std::size(chn.pModSample->cues)) { SmpLength offset; if(m.vol == 0) @@ -3045,7 +3045,7 @@ break; case VOLCMD_OFFSET: - if(triggerNote && chn.pModSample && vol <= std::size(chn.pModSample->cues)) + if(triggerNote && chn.pModSample && !chn.pModSample->uFlags[CHN_ADLIB] && vol <= std::size(chn.pModSample->cues)) { SmpLength offset; if(vol == 0) @@ -5285,7 +5285,7 @@ { if(m.vol == 0) offset = Util::muldivr_unsigned(chn.nLength, offset, 256u << (8u * std::max(uint32(1), extendedRows))); // o00 + Oxx = Percentage Offset - else if(m.vol <= std::size(ModSample().cues) && chn.pModSample != nullptr) + else if(m.vol <= std::size(ModSample().cues) && chn.pModSample != nullptr && !chn.pModSample->uFlags[CHN_ADLIB]) offset += chn.pModSample->cues[m.vol - 1]; // Offset relative to cue point chn.oldOffset = offset; } @@ -5599,7 +5599,7 @@ chn.position.Set(0); offset--; - if(chn.pModSample != nullptr && offset >= 0 && offset <= static_cast<int>(std::size(chn.pModSample->cues))) + if(chn.pModSample != nullptr && !chn.pModSample->uFlags[CHN_ADLIB] && offset >= 0 && offset <= static_cast<int>(std::size(chn.pModSample->cues))) { if(offset == 0) offset = chn.oldOffset; |