Author: sagamusix
Date: Sat May 4 00:32:17 2024
New Revision: 20702
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20702
Log:
[Mod] MDL: Command 9 is not Set Envelope Position, it select a different envelope instead. As we only have one envelope per type per instrument, instead do the only thing we can do for now: Assume that the instrument envelope was disabled and enable it.
Modified:
trunk/OpenMPT/soundlib/Load_mdl.cpp
Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp
==============================================================================
--- trunk/OpenMPT/soundlib/Load_mdl.cpp Sat May 4 00:06:21 2024 (r20701)
+++ trunk/OpenMPT/soundlib/Load_mdl.cpp Sat May 4 00:32:17 2024 (r20702)
@@ -168,7 +168,7 @@
/* Either column */
/* 7 */ CMD_TEMPO,
/* 8 */ CMD_PANNING8,
- /* 9 */ CMD_SETENVPOSITION,
+ /* 9 */ CMD_S3MCMDEX,
/* A */ CMD_NONE,
/* B */ CMD_POSITIONJUMP,
/* C */ CMD_GLOBALVOLUME,
@@ -203,6 +203,16 @@
case 0x08: // Panning
param = (param & 0x7F) * 2u;
break;
+ case 0x09: // Set Envelope (we can only have one envelope per type...)
+ if(param < 0x40)
+ param = 0x78; // Enable the one volume envelope we have
+ else if (param < 0x80)
+ param = 0x7A; // Enable the one panning envelope we have
+ else if(param < 0xC0)
+ param = 0x7C; // Enable the one pitch envelope we have
+ else
+ cmd = CMD_NONE;
+ break;
case 0x0C: // Global volume
param = static_cast<uint8>((param + 1) / 2u);
break;
|