From: <sv...@op...> - 2024-12-01 14:23:45
|
Author: sagamusix Date: Sun Dec 1 15:23:38 2024 New Revision: 22424 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=22424 Log: [Fix] MIDI Macros: An unfinished byte right before a "s" SysEx checksum macro letter was not considered in the checksum. Modified: trunk/OpenMPT/soundlib/MIDIMacroParser.cpp Modified: trunk/OpenMPT/soundlib/MIDIMacroParser.cpp ============================================================================== --- trunk/OpenMPT/soundlib/MIDIMacroParser.cpp Sun Dec 1 14:12:39 2024 (r22423) +++ trunk/OpenMPT/soundlib/MIDIMacroParser.cpp Sun Dec 1 15:23:38 2024 (r22424) @@ -233,6 +233,12 @@ } else if(macro[pos] == 's') { // SysEx Checksum (not an original Impulse Tracker macro variable, but added for convenience) + if(!firstNibble) // From MIDI.TXT: '9n' is exactly the same as '09 n' or '9 n' -- so finish current byte first + { + outPos++; + firstNibble = true; + } + auto startPos = outPos; while(startPos > 0 && out[--startPos] != 0xF0) ; |