From: <sv...@op...> - 2025-02-07 22:21:14
|
Author: sagamusix Date: Fri Feb 7 23:21:03 2025 New Revision: 22865 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22865 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.31/ (props changed) branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Modified: branches/OpenMPT-1.31/soundlib/Snd_fx.cpp ============================================================================== --- branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Fri Feb 7 23:20:33 2025 (r22864) +++ branches/OpenMPT-1.31/soundlib/Snd_fx.cpp Fri Feb 7 23:21:03 2025 (r22865) @@ -1082,7 +1082,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) @@ -3132,7 +3132,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) @@ -5452,7 +5452,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; } @@ -5774,7 +5774,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; |