diff --git a/cmake/FindRTMIDI.cmake b/cmake/FindRTMIDI.cmake index 8933faed..a408c9f8 100644 --- a/cmake/FindRTMIDI.cmake +++ b/cmake/FindRTMIDI.cmake @@ -46,14 +46,10 @@ find_library( if(PC_RTMIDI_VERSION) set(RTMIDI_VERSION_STRING ${PC_RTMIDI_VERSION}) elseif(RTMIDI_INCLUDE_DIR AND EXISTS "${RTMIDI_INCLUDE_DIR}/RtMidi.h") - file( - STRINGS "${RTMIDI_INCLUDE_DIR}/RtMidi.h" RTMIDI_VERSION_LINE - REGEX "^// RtMidi: Version .*$" - ) - string( - REGEX REPLACE "^.*Version (.*)$" "\\1" RTMIDI_VERSION_STRING - ${RTMIDI_VERSION_LINE} - ) + file(STRINGS "${RTMIDI_INCLUDE_DIR}/RtMidi.h" RTMIDI_VERSION_LINE + REGEX "^#define RTMIDI_VERSION \".*\".*$") + string(REGEX REPLACE "^#define RTMIDI_VERSION \"(.*)\".*$" "\\1" RTMIDI_VERSION_STRING + ${RTMIDI_VERSION_LINE}) unset(RTMIDI_VERSION_LINE) endif() diff --git a/confup b/confup deleted file mode 100755 index 7057654a..00000000 --- a/confup +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -SDL_CONFIG=/opt/m68k-amigaos/bin/sdl-config CPPFLAGS="-g -D__AMIGA__ -fpermissive -noixemul -m68020 -I/opt/m68k-amigaos/include/SDL -I/opt/m68k-amigaos/include -L/opt/m68k-amigaos/lib -L/opt/m68k-amigaos/m68k-amigaos/lib -fomit-frame-pointer -lSDL -ldebug -ljpeg -lSDLstub -lSDL_image -Xlinker --allow-multiple-definition" CXXFLAGS="-g -D__AMIGA__ -fpermissive -noixemul -m68020 -I/opt/m68k-amigaos/include/SDL -I/opt/m68k-amigaos/include -L/opt/m68k-amigaos/lib -L/opt/m68k-amigaos/m68k-amigaos/lib -fomit-frame-pointer -lSDL -ldebug -ljpeg -lSDLstub -lSDL_image -Xlinker --allow-multiple-definition" CFLAGS="-g -D__AMIGA__ -fpermissive -noixemul -m68020 -I/opt/m68k-amigaos/include/SDL -I/opt/m68k-amigaos/include -L/opt/m68k-amigaos/lib -L/opt/m68k-amigaos/m68k-amigaos/lib -fomit-frame-pointer -lSDL -ldebug -ljpeg -lSDLstub -lSDL_image -Xlinker --allow-multiple-definition" ./configure --build x86_64 --host m68k-amigaos diff --git a/src/milkyplay/ExporterXM.cpp b/src/milkyplay/ExporterXM.cpp index e7d342dc..4cb743f5 100644 --- a/src/milkyplay/ExporterXM.cpp +++ b/src/milkyplay/ExporterXM.cpp @@ -2123,6 +2123,8 @@ mp_sint32 XModule::saveProtrackerModule(const SYSCHAR* fileName) #ifdef MILKYTRACKER bool TXMPattern::saveExtendedPattern(const SYSCHAR* fileName) const { + // Note: For FT2 compatibility, .XP files are fixed at 32 channels. + // TODO: Create a version 2 format for variable channel counts TWorkBuffers workBuffers; // ------ start --------------------------------- @@ -2134,13 +2136,13 @@ bool TXMPattern::saveExtendedPattern(const SYSCHAR* fileName) const f.writeWord(0x1); f.writeWord(rows); - mp_sint32 len = rows * channum * 5; + mp_sint32 len = rows * 32 * 5; mp_ubyte* srcPattern = new mp_ubyte[len]; memset(srcPattern, 0, len); - convertPattern(NULL, this, srcPattern, channum, workBuffers, false); + convertPattern(NULL, this, srcPattern, 32, workBuffers, false); f.write(srcPattern, 1, len); @@ -2165,14 +2167,12 @@ bool TXMPattern::saveExtendedTrack(const SYSCHAR* fileName, mp_uint32 channel) c f.writeWord(0x1); f.writeWord(rows); - mp_sint32 len = rows * channum * 5; + mp_sint32 len = rows * 5; - mp_ubyte* srcPattern = new mp_ubyte[len]; + mp_ubyte* srcPattern = new mp_ubyte[rows * channum * 5]; mp_ubyte* dstPattern = new mp_ubyte[len]; - memset(srcPattern, 0, len); - - convertPattern(NULL, this, srcPattern, channum, workBuffers, false); + convertPattern(NULL, this, srcPattern, channum, workBuffers, false); for (mp_sint32 r = 0; r < rows; r++) {