Author: sagamusix
Date: Sat Jun 29 00:52:12 2024
New Revision: 21099
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21099
Log:
Merged revision(s) 21076-21082 from trunk/OpenMPT:
[Imp] When combining two identical pattern commands, don't try to keep both commands. The first command is preferred to be kept (fixes DBM.143_gnoj, https://www.un4seen.com/forum/?topic=15448.msg143155#msg143155)
........
[Fix] Compiler warnings.
........
[Fix] DBM: Like in XM, offset with portamento ignores the offset command.
........
[Imp] DBM: Disable a few more IT-specific playback compatibility flags. Fixes "Are You Flying with Me?" by Jazzcat.
........
Modified:
branches/OpenMPT-1.30/ (props changed)
branches/OpenMPT-1.30/soundlib/Load_dbm.cpp
branches/OpenMPT-1.30/soundlib/Snd_fx.cpp
branches/OpenMPT-1.30/soundlib/modcommand.cpp
Modified: branches/OpenMPT-1.30/soundlib/Load_dbm.cpp
==============================================================================
--- branches/OpenMPT-1.30/soundlib/Load_dbm.cpp Sat Jun 29 00:27:51 2024 (r21098)
+++ branches/OpenMPT-1.30/soundlib/Load_dbm.cpp Sat Jun 29 00:52:12 2024 (r21099)
@@ -353,6 +353,8 @@
m_playBehaviour.set(kSlidesAtSpeed1);
m_playBehaviour.reset(kITVibratoTremoloPanbrello);
m_playBehaviour.reset(kITArpeggio);
+ m_playBehaviour.reset(kITInstrWithNoteOff);
+ m_playBehaviour.reset(kITInstrWithNoteOffOldEffects);
m_modFormat.formatName = U_("DigiBooster Pro");
m_modFormat.type = U_("dbm");
@@ -535,6 +537,14 @@
{
std::swap(cmd1, cmd2);
std::swap(param1, param2);
+ } else if(cmd1 == CMD_TONEPORTAMENTO && cmd2 == CMD_OFFSET && param2 == 0)
+ {
+ // Offset + Portmaneto: Ignore portamento. If the offset command has a non-zero parameter, keep it for effect memory.
+ cmd2 = CMD_NONE;
+ } else if(cmd2 == CMD_TONEPORTAMENTO && cmd1 == CMD_OFFSET && param1 == 0)
+ {
+ // Ditto
+ cmd1 = CMD_NONE;
}
const auto lostCommand = ModCommand::TwoRegularCommandsToMPT(cmd1, param1, cmd2, param2);
Modified: branches/OpenMPT-1.30/soundlib/Snd_fx.cpp
==============================================================================
--- branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Sat Jun 29 00:27:51 2024 (r21098)
+++ branches/OpenMPT-1.30/soundlib/Snd_fx.cpp Sat Jun 29 00:52:12 2024 (r21099)
@@ -987,7 +987,8 @@
{
if(m.command == CMD_OFFSET)
{
- ProcessSampleOffset(chn, nChn, playState);
+ if(!porta || !(GetType() & (MOD_TYPE_XM | MOD_TYPE_DBM)))
+ ProcessSampleOffset(chn, nChn, playState);
} else if(m.command == CMD_OFFSETPERCENTAGE)
{
SampleOffset(chn, Util::muldiv_unsigned(chn.nLength, m.param, 256));
@@ -3140,7 +3141,7 @@
{
// FT2 compatibility: Portamento + Offset = Ignore offset
// Test case: porta-offset.xm
- if(bPorta && GetType() == MOD_TYPE_XM)
+ if(bPorta && (GetType() & (MOD_TYPE_XM | MOD_TYPE_DBM)))
break;
ProcessSampleOffset(chn, nChn, m_PlayState);
Modified: branches/OpenMPT-1.30/soundlib/modcommand.cpp
==============================================================================
--- branches/OpenMPT-1.30/soundlib/modcommand.cpp Sat Jun 29 00:27:51 2024 (r21098)
+++ branches/OpenMPT-1.30/soundlib/modcommand.cpp Sat Jun 29 00:52:12 2024 (r21099)
@@ -1261,6 +1261,40 @@
std::pair<EffectCommand, ModCommand::PARAM> ModCommand::TwoRegularCommandsToMPT(uint8 &effect1, uint8 ¶m1, uint8 &effect2, uint8 ¶m2)
{
+ if(effect1 == effect2)
+ {
+ // For non-sliding, absolute effects, it doesn't make sense to keep both commands
+ switch(effect1)
+ {
+ case CMD_ARPEGGIO:
+ case CMD_PANNING8:
+ case CMD_OFFSET:
+ case CMD_POSITIONJUMP:
+ case CMD_VOLUME:
+ case CMD_PATTERNBREAK:
+ case CMD_SPEED:
+ case CMD_TEMPO:
+ case CMD_CHANNELVOLUME:
+ case CMD_GLOBALVOLUME:
+ case CMD_KEYOFF:
+ case CMD_SETENVPOSITION:
+ case CMD_MIDI:
+ case CMD_SMOOTHMIDI:
+ case CMD_DELAYCUT:
+ case CMD_FINETUNE:
+ case CMD_FINETUNE_SMOOTH:
+ case CMD_DUMMY:
+ case CMD_REVERSEOFFSET:
+ case CMD_DBMECHO:
+ case CMD_OFFSETPERCENTAGE:
+ case CMD_DIGIREVERSESAMPLE:
+ effect2 = CMD_NONE;
+ break;
+ default:
+ break;
+ }
+ }
+
for(uint8 n = 0; n < 4; n++)
{
if(ModCommand::ConvertVolEffect(effect1, param1, (n > 1)))
|