Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ft2-clone for openSUSE:Factory checked in at 2024-04-15 20:17:07 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ft2-clone (Old) and /work/SRC/openSUSE:Factory/.ft2-clone.new.26366 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ft2-clone" Mon Apr 15 20:17:07 2024 rev:15 rq:1167615 version:1.82 Changes: -------- --- /work/SRC/openSUSE:Factory/ft2-clone/ft2-clone.changes 2024-04-10 17:50:56.989708886 +0200 +++ /work/SRC/openSUSE:Factory/.ft2-clone.new.26366/ft2-clone.changes 2024-04-15 20:23:26.915644195 +0200 @@ -1,0 +2,7 @@ +Fri Apr 12 18:14:27 UTC 2024 - Martin Hauke <[email protected]> + +- Update to version 1.82 + * Fixed: MIDI was actually not working in v1.81. + * Fixed: Possible crash on startup or on exit (related to MIDI). + +------------------------------------------------------------------- Old: ---- ft2-clone-1.81.tar.gz New: ---- ft2-clone-1.82.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ft2-clone.spec ++++++ --- /var/tmp/diff_new_pack.Ox5RCu/_old 2024-04-15 20:23:27.435663340 +0200 +++ /var/tmp/diff_new_pack.Ox5RCu/_new 2024-04-15 20:23:27.435663340 +0200 @@ -17,7 +17,7 @@ Name: ft2-clone -Version: 1.81 +Version: 1.82 Release: 0 Summary: Fasttracker II clone License: BSD-3-Clause AND CC-BY-NC-SA-4.0 ++++++ ft2-clone-1.81.tar.gz -> ft2-clone-1.82.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/src/ft2_config.c new/ft2-clone-1.82/src/ft2_config.c --- old/ft2-clone-1.81/src/ft2_config.c 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/src/ft2_config.c 2024-04-12 14:37:25.000000000 +0200 @@ -44,7 +44,7 @@ static void xorConfigBuffer(uint8_t *ptr8) { for (int32_t i = 0; i < CONFIG_FILE_SIZE; i++) - ptr8[i] ^= i*7; + ptr8[i] ^= (uint8_t)(i*7); } static int32_t calcChecksum(const uint8_t *p, uint16_t len) // for Nibbles highscore data @@ -290,7 +290,7 @@ audio.currInputDevice = getAudioInputDeviceFromConfig(); #ifdef HAS_MIDI - if (midi.supported && midi.initThreadDone) + if (midi.initThreadDone) { setMidiInputDeviceFromConfig(); if (ui.configScreenShown && editor.currConfigScreen == CONFIG_SCREEN_MIDI_INPUT) @@ -390,8 +390,7 @@ saveAudioDevicesToConfig(audio.currOutputDevice, audio.currInputDevice); #ifdef HAS_MIDI - if (midi.supported) - saveMidiInputDeviceToConfig(); + saveMidiInputDeviceToConfig(); #endif FILE *f = UNICHAR_FOPEN(editor.configFileLocationU, "wb"); @@ -470,6 +469,7 @@ return filePathU; } +#ifdef HAS_MIDI static UNICHAR *getFullMidiDevConfigPathU(void) // kinda hackish { int32_t mididevDotIniStrLen, ft2DotCfgStrLen; @@ -501,6 +501,7 @@ return filePathU; } +#endif static void setConfigFileLocation(void) // kinda hackish { @@ -523,8 +524,7 @@ return; } - oldPathU[0] = 0; - tmpPathU[0] = 0; + oldPathU[0] = tmpPathU[0] = (UNICHAR)0; if (GetCurrentDirectoryW(PATH_MAX - ft2DotCfgStrLen - 1, oldPathU) == 0) { @@ -674,9 +674,9 @@ strcat(editor.configFileLocationU, "/FT2.CFG"); #endif - if (midi.supported) - editor.midiConfigFileLocationU = getFullMidiDevConfigPathU(); - +#ifdef HAS_MIDI + editor.midiConfigFileLocationU = getFullMidiDevConfigPathU(); +#endif editor.audioDevConfigFileLocationU = getFullAudDevConfigPathU(); } @@ -800,14 +800,6 @@ radioButtons[tmpID].state = RADIOBUTTON_CHECKED; showRadioButtonGroup(RB_GROUP_CONFIG_SELECT); - - // hide MIDI radio button if MIDI is not supported (hackish) - if (!midi.supported) - { - radioButton_t *t = &radioButtons[RB_CONFIG_MIDI_INPUT]; - hideRadioButton(RB_CONFIG_MIDI_INPUT); - fillRect(t->x, t->y, RADIOBUTTON_W, RADIOBUTTON_H, PAL_DESKTOP); - } } void setConfigAudioRadioButtonStates(void) // accessed by other .c files @@ -1031,10 +1023,7 @@ checkBoxes[CB_CONF_CHANGE_PATTLEN_INS_DEL].checked = config.recTrueInsert; checkBoxes[CB_CONF_MIDI_ALLOW_PC].checked = config.recMIDIAllowPC; #ifdef HAS_MIDI - if (midi.supported) - checkBoxes[CB_CONF_MIDI_ENABLE].checked = midi.enable; - else - checkBoxes[CB_CONF_MIDI_ENABLE].checked = false; + checkBoxes[CB_CONF_MIDI_ENABLE].checked = midi.enable; #else checkBoxes[CB_CONF_MIDI_ENABLE].checked = false; #endif @@ -1125,8 +1114,7 @@ textOutShadow(21, 35, PAL_FORGRND, PAL_DSKTOP2, "Layout"); textOutShadow(21, 51, PAL_FORGRND, PAL_DSKTOP2, "Miscellaneous"); #ifdef HAS_MIDI - if (midi.supported) - textOutShadow(21, 67, PAL_FORGRND, PAL_DSKTOP2, "MIDI input"); + textOutShadow(21, 67, PAL_FORGRND, PAL_DSKTOP2, "MIDI input"); #endif textOutShadow(20, 93, PAL_FORGRND, PAL_DSKTOP2, "Auto save"); @@ -2089,17 +2077,7 @@ void cbMIDIEnable(void) { #ifdef HAS_MIDI - if (midi.supported) - { - midi.enable ^= 1; - } - else - { - checkBoxes[CB_CONF_MIDI_ENABLE].checked = false; - drawCheckBox(CB_CONF_MIDI_ENABLE); - - okBox(0, "System message", "MIDI support is disabled for Windows XP as it is buggy!", NULL); - } + midi.enable ^= 1; #else checkBoxes[CB_CONF_MIDI_ENABLE].checked = false; drawCheckBox(CB_CONF_MIDI_ENABLE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/src/ft2_header.h new/ft2-clone-1.82/src/ft2_header.h --- old/ft2-clone-1.81/src/ft2_header.h 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/src/ft2_header.h 2024-04-12 14:37:25.000000000 +0200 @@ -12,7 +12,7 @@ #endif #include "ft2_replayer.h" -#define PROG_VER_STR "1.81" +#define PROG_VER_STR "1.82" // do NOT change these! It will only mess things up... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/src/ft2_keyboard.c new/ft2-clone-1.82/src/ft2_keyboard.c --- old/ft2-clone-1.81/src/ft2_keyboard.c 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/src/ft2_keyboard.c 2024-04-12 14:37:25.000000000 +0200 @@ -1284,12 +1284,9 @@ else if (keyb.leftCtrlPressed) { #ifdef HAS_MIDI - if (midi.supported) - { - editor.currConfigScreen = 3; - showConfigScreen(); - checkRadioButton(RB_CONFIG_MIDI_INPUT); - } + editor.currConfigScreen = 3; + showConfigScreen(); + checkRadioButton(RB_CONFIG_MIDI_INPUT); #endif return true; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/src/ft2_main.c new/ft2-clone-1.82/src/ft2_main.c --- old/ft2-clone-1.81/src/ft2_main.c 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/src/ft2_main.c 2024-04-12 14:37:25.000000000 +0200 @@ -9,7 +9,6 @@ #ifdef _WIN32 #define WIN32_MEAN_AND_LEAN #include <windows.h> -#include <versionhelpers.h> #include <SDL2/SDL_syswm.h> #else #include <unistd.h> // chdir() @@ -96,10 +95,6 @@ #endif #ifdef _WIN32 - // disable MIDI support if using Windows XP, as it is unstable - if (!IsWindowsVistaOrGreater()) - midi.supported = false; - #ifndef _MSC_VER SetProcessDPIAware(); #endif @@ -151,19 +146,14 @@ #ifdef __APPLE__ osxSetDirToProgramDirFromArgs(argv); #endif - if (!setupExecutablePath() || !loadBMPs()) + if (!setupExecutablePath() || !loadBMPs() || !calcCubicSplineTable() || !calcWindowedSincTables()) { cleanUpAndExit(); return 1; } - if (!calcCubicSplineTable() || !calcWindowedSincTables()) // must be called before config is loaded - { - cleanUpAndExit(); - return false; - } + loadConfigOrSetDefaults(); // config must be loaded at this exact point - loadConfigOrSetDefaults(); if (!setupWindow() || !setupRenderer()) { // error message was shown in the functions above @@ -231,17 +221,18 @@ } #ifdef HAS_MIDI - // set up MIDI input (in a thread because it can take quite a while on f.ex. macOS) - if (midi.supported) +#ifdef __APPLE__ + // MIDI init can take several seconds on Mac, use thread + midi.initMidiThread = SDL_CreateThread(initMidiFunc, NULL, NULL); + if (midi.initMidiThread == NULL) { - midi.initMidiThread = SDL_CreateThread(initMidiFunc, NULL, NULL); - if (midi.initMidiThread == NULL) - { - showErrorMsgBox("Couldn't create MIDI initialization thread!"); - cleanUpAndExit(); - return 1; - } + showErrorMsgBox("Couldn't create MIDI initialization thread!"); + cleanUpAndExit(); + return 1; } +#else + initMidiFunc(NULL); +#endif #endif hpc_ResetCounters(&video.vblankHpc); // quirk: this is needed for potential okBox() calls in handleModuleLoadFromArg() @@ -276,7 +267,6 @@ // clear common structs #ifdef HAS_MIDI memset(&midi, 0, sizeof (midi)); - midi.supported = true; #endif memset(&video, 0, sizeof (video)); memset(&keyb, 0, sizeof (keyb)); @@ -338,26 +328,31 @@ static void cleanUpAndExit(void) // never call this inside the main loop! { #ifdef HAS_MIDI - if (midi.supported) +#ifdef __APPLE__ + // on Mac we used a thread to init MIDI (as it could take several seconds) + if (midi.initMidiThread != NULL) { - if (midi.initMidiThread != NULL) - { - SDL_WaitThread(midi.initMidiThread, NULL); - midi.initMidiThread = NULL; - } + SDL_WaitThread(midi.initMidiThread, NULL); + midi.initMidiThread = NULL; + } +#endif + midi.enable = false; // stop MIDI callback from doing things + while (midi.callbackBusy) SDL_Delay(1); // wait for MIDI callback to finish - midi.enable = false; // stop MIDI callback from doing things - while (midi.callbackBusy) SDL_Delay(1); // wait for MIDI callback to finish + closeMidiInDevice(); + freeMidiIn(); + freeMidiInputDeviceList(); - closeMidiInDevice(); - freeMidiIn(); - freeMidiInputDeviceList(); + if (midi.inputDeviceName != NULL) + { + free(midi.inputDeviceName); + midi.inputDeviceName = NULL; + } - if (midi.inputDeviceName != NULL) - { - free(midi.inputDeviceName); - midi.inputDeviceName = NULL; - } + if (editor.midiConfigFileLocationU != NULL) + { + free(editor.midiConfigFileLocationU); + editor.midiConfigFileLocationU = NULL; } #endif @@ -385,12 +380,6 @@ editor.configFileLocationU = NULL; } - if (editor.midiConfigFileLocationU != NULL) - { - free(editor.midiConfigFileLocationU); - editor.midiConfigFileLocationU = NULL; - } - if (editor.binaryPathU != NULL) { free(editor.binaryPathU); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/src/ft2_midi.c new/ft2-clone-1.82/src/ft2_midi.c --- old/ft2-clone-1.81/src/ft2_midi.c 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/src/ft2_midi.c 2024-04-12 14:37:25.000000000 +0200 @@ -29,7 +29,7 @@ static volatile bool midiDeviceOpened; static bool recMIDIValidChn = true; -static RtMidiPtr midiInDev; +static volatile RtMidiPtr midiInDev; static inline void midiInSetChannel(uint8_t status) { @@ -180,6 +180,7 @@ if (!midiInDev->ok) { rtmidi_in_free(midiInDev); + midiInDev = NULL; return false; } @@ -188,10 +189,7 @@ bool openMidiInDevice(uint32_t deviceID) { - if (midiDeviceOpened) - return false; - - if (midiInDev == NULL || getNumMidiInDevices() == 0) + if (midiDeviceOpened || midiInDev == NULL || midi.numInputDevices == 0) return false; rtmidi_open_port(midiInDev, deviceID, "FT2 Clone MIDI Port"); @@ -281,9 +279,7 @@ { uint32_t i; - // XXX: Something in here is corrupting! - - if (editor.midiConfigFileLocationU == NULL) + if (midiInDev == NULL || editor.midiConfigFileLocationU == NULL) goto setDefMidiInputDev; const uint32_t numDevices = getNumMidiInDevices(); @@ -353,7 +349,7 @@ } midi.inputDevice = 0; - midi.inputDeviceName = strdup("RtMidi"); + midi.inputDeviceName = strdup("Error configuring MIDI..."); midi.numInputDevices = 1; return false; @@ -497,16 +493,15 @@ return true; } -int32_t SDLCALL initMidiFunc(void *ptr) +int32_t initMidiFunc(void *ptr) { - midi.initThreadDone = false; initMidiIn(); setMidiInputDeviceFromConfig(); openMidiInDevice(midi.inputDevice); midi.rescanDevicesFlag = true; midi.initThreadDone = true; - return true; + return true; (void)ptr; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/src/ft2_midi.h new/ft2-clone-1.82/src/ft2_midi.h --- old/ft2-clone-1.81/src/ft2_midi.h 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/src/ft2_midi.h 2024-04-12 14:37:25.000000000 +0200 @@ -12,11 +12,13 @@ typedef struct midi_t { char *inputDeviceName, *inputDeviceNames[MAX_MIDI_DEVICES]; - volatile bool supported, initThreadDone, callbackBusy, enable; + volatile bool initThreadDone, callbackBusy, enable; bool rescanDevicesFlag; uint32_t inputDevice, numInputDevices; int16_t currMIDIVibDepth, currMIDIPitch; +#ifdef __APPLE__ SDL_Thread *initMidiThread; +#endif } midi_t; extern midi_t midi; // ft2_midi.c @@ -35,6 +37,6 @@ void scrollMidiInputDevListDown(void); void sbMidiInputSetPos(uint32_t pos); bool testMidiInputDeviceListMouseDown(void); -int32_t SDLCALL initMidiFunc(void *ptr); +int32_t initMidiFunc(void *ptr); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/src/ft2_structs.h new/ft2-clone-1.82/src/ft2_structs.h --- old/ft2-clone-1.81/src/ft2_structs.h 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/src/ft2_structs.h 2024-04-12 14:37:25.000000000 +0200 @@ -12,7 +12,10 @@ typedef struct editor_t { UNICHAR *binaryPathU, *tmpFilenameU, *tmpInstrFilenameU; // used by saving/loading threads - UNICHAR *configFileLocationU, *audioDevConfigFileLocationU, *midiConfigFileLocationU; + UNICHAR *configFileLocationU, *audioDevConfigFileLocationU; +#ifdef HAS_MIDI + UNICHAR *midiConfigFileLocationU; +#endif volatile bool mainLoopOngoing; volatile bool busy, scopeThreadBusy, programRunning, wavIsRendering, wavReachedEndFlag; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ft2-clone-1.81/vs2019_project/ft2-clone/ft2-clone.vcxproj new/ft2-clone-1.82/vs2019_project/ft2-clone/ft2-clone.vcxproj --- old/ft2-clone-1.81/vs2019_project/ft2-clone/ft2-clone.vcxproj 2024-04-09 19:31:47.000000000 +0200 +++ new/ft2-clone-1.82/vs2019_project/ft2-clone/ft2-clone.vcxproj 2024-04-12 14:37:25.000000000 +0200 @@ -126,6 +126,7 @@ <SetChecksum>true</SetChecksum> <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers> <FixedBaseAddress>false</FixedBaseAddress> + <AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'";%(AdditionalManifestDependencies)</AdditionalManifestDependencies> </Link> <PostBuildEvent /> <Manifest /> @@ -177,6 +178,7 @@ <SetChecksum>true</SetChecksum> <FixedBaseAddress>false</FixedBaseAddress> <AdditionalDependencies>SDL2main.lib;SDL2.lib;shlwapi.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> + <AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'";%(AdditionalManifestDependencies)</AdditionalManifestDependencies> </Link> <PostBuildEvent> <Message> @@ -220,6 +222,7 @@ <LargeAddressAware>true</LargeAddressAware> <ImageHasSafeExceptionHandlers> </ImageHasSafeExceptionHandlers> + <AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'";%(AdditionalManifestDependencies)</AdditionalManifestDependencies> </Link> <Manifest /> <ProjectReference /> @@ -264,6 +267,7 @@ <LargeAddressAware>true</LargeAddressAware> <ImageHasSafeExceptionHandlers> </ImageHasSafeExceptionHandlers> + <AdditionalManifestDependencies>"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'";%(AdditionalManifestDependencies)</AdditionalManifestDependencies> </Link> <Manifest /> <ProjectReference />
