Skip to content

Commit

Permalink
Merged revision(s) 20702 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[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.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.30@20773 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
sagamusix committed May 11, 2024
1 parent 3afd5a5 commit d1f3096
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion soundlib/Load_mdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static constexpr ModCommand::COMMAND MDLEffTrans[] =
/* Either column */
/* 7 */ CMD_TEMPO,
/* 8 */ CMD_PANNING8,
/* 9 */ CMD_SETENVPOSITION,
/* 9 */ CMD_S3MCMDEX,
/* A */ CMD_NONE,
/* B */ CMD_POSITIONJUMP,
/* C */ CMD_GLOBALVOLUME,
Expand Down Expand Up @@ -205,6 +205,16 @@ static void ConvertMDLCommand(uint8 &cmd, uint8 &param)
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 = (param + 1) / 2u;
break;
Expand Down

0 comments on commit d1f3096

Please sign in to comment.