Lucio Andrés Illanes Albornoz ed4f30
diff -ru SDL-1.2.15.orig/configure.in SDL-1.2.15/configure.in
Lucio Andrés Illanes Albornoz ed4f30
--- SDL-1.2.15.orig/configure.in	2012-01-19 07:30:05.000000000 +0100
Lucio Andrés Illanes Albornoz ed4f30
+++ SDL-1.2.15/configure.in	2019-11-08 11:00:50.134023690 +0100
Lucio Andrés Illanes Albornoz ed4f30
@@ -453,39 +453,6 @@
Lucio Andrés Illanes Albornoz ed4f30
     fi
Lucio Andrés Illanes Albornoz ed4f30
 }
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
-dnl Find the ESD includes and libraries
Lucio Andrés Illanes Albornoz ed4f30
-CheckESD()
Lucio Andrés Illanes Albornoz ed4f30
-{
Lucio Andrés Illanes Albornoz ed4f30
-    AC_ARG_ENABLE(esd,
Lucio Andrés Illanes Albornoz ed4f30
-AC_HELP_STRING([--enable-esd], [support the Enlightened Sound Daemon [[default=yes]]]),
Lucio Andrés Illanes Albornoz ed4f30
-                  , enable_esd=yes)
Lucio Andrés Illanes Albornoz ed4f30
-    if test x$enable_audio = xyes -a x$enable_esd = xyes; then
Lucio Andrés Illanes Albornoz ed4f30
-        AM_PATH_ESD(0.2.8, have_esd=yes, have_esd=no)
Lucio Andrés Illanes Albornoz ed4f30
-        if test x$have_esd = xyes; then
Lucio Andrés Illanes Albornoz ed4f30
-            AC_ARG_ENABLE(esd-shared,
Lucio Andrés Illanes Albornoz ed4f30
-AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
Lucio Andrés Illanes Albornoz ed4f30
-                          , enable_esd_shared=yes)
Lucio Andrés Illanes Albornoz ed4f30
-            esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
Lucio Andrés Illanes Albornoz ed4f30
-
Lucio Andrés Illanes Albornoz ed4f30
-            AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
Lucio Andrés Illanes Albornoz ed4f30
-            SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
Lucio Andrés Illanes Albornoz ed4f30
-            EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
Lucio Andrés Illanes Albornoz ed4f30
-            if test x$have_loadso != xyes && \
Lucio Andrés Illanes Albornoz ed4f30
-               test x$enable_esd_shared = xyes; then
Lucio Andrés Illanes Albornoz ed4f30
-                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic ESD loading])
Lucio Andrés Illanes Albornoz ed4f30
-            fi
Lucio Andrés Illanes Albornoz ed4f30
-            if test x$have_loadso = xyes && \
Lucio Andrés Illanes Albornoz ed4f30
-               test x$enable_esd_shared = xyes && test x$esd_lib != x; then
Lucio Andrés Illanes Albornoz ed4f30
-                echo "-- dynamic libesd -> $esd_lib"
Lucio Andrés Illanes Albornoz ed4f30
-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
Lucio Andrés Illanes Albornoz ed4f30
-            else
Lucio Andrés Illanes Albornoz ed4f30
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
Lucio Andrés Illanes Albornoz ed4f30
-            fi
Lucio Andrés Illanes Albornoz ed4f30
-            have_audio=yes
Lucio Andrés Illanes Albornoz ed4f30
-        fi
Lucio Andrés Illanes Albornoz ed4f30
-    fi
Lucio Andrés Illanes Albornoz ed4f30
-}
Lucio Andrés Illanes Albornoz ed4f30
-
Lucio Andrés Illanes Albornoz ed4f30
 dnl Find PulseAudio
Lucio Andrés Illanes Albornoz ed4f30
 CheckPulseAudio()
Lucio Andrés Illanes Albornoz ed4f30
 {
Lucio Andrés Illanes Albornoz ed4f30
@@ -2357,7 +2324,6 @@
Lucio Andrés Illanes Albornoz ed4f30
         CheckMME
Lucio Andrés Illanes Albornoz ed4f30
         CheckALSA
Lucio Andrés Illanes Albornoz ed4f30
         CheckARTSC
Lucio Andrés Illanes Albornoz ed4f30
-        CheckESD
Lucio Andrés Illanes Albornoz ed4f30
         CheckPulseAudio
Lucio Andrés Illanes Albornoz ed4f30
         CheckNAS
Lucio Andrés Illanes Albornoz ed4f30
         CheckX11
Lucio Andrés Illanes Albornoz ed4f30
@@ -2494,6 +2460,35 @@
Lucio Andrés Illanes Albornoz ed4f30
             have_timers=yes
Lucio Andrés Illanes Albornoz ed4f30
         fi
Lucio Andrés Illanes Albornoz ed4f30
         ;;
Lucio Andrés Illanes Albornoz ed4f30
+    *-*-midipix*)
Lucio Andrés Illanes Albornoz ed4f30
+        ARCH=midipix
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+        # Set up files for the timer library
Lucio Andrés Illanes Albornoz ed4f30
+        if test x$enable_timers = xyes; then
Lucio Andrés Illanes Albornoz ed4f30
+            AC_DEFINE(SDL_TIMER_UNIX)
Lucio Andrés Illanes Albornoz ed4f30
+            SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
Lucio Andrés Illanes Albornoz ed4f30
+            have_timers=yes
Lucio Andrés Illanes Albornoz ed4f30
+        fi
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+        CheckDummyVideo
Lucio Andrés Illanes Albornoz ed4f30
+        CheckDiskAudio
Lucio Andrés Illanes Albornoz ed4f30
+        CheckWIN32
Lucio Andrés Illanes Albornoz ed4f30
+        #CheckWIN32GL
Lucio Andrés Illanes Albornoz ed4f30
+        CheckNASM
Lucio Andrés Illanes Albornoz ed4f30
+        CheckPTHREAD
Lucio Andrés Illanes Albornoz ed4f30
+        CheckClockGettime
Lucio Andrés Illanes Albornoz ed4f30
+        CheckVisibilityHidden
Lucio Andrés Illanes Albornoz ed4f30
+        CheckDLOPEN
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+        if test x$enable_audio = xyes; then
Lucio Andrés Illanes Albornoz ed4f30
+            AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
Lucio Andrés Illanes Albornoz ed4f30
+            SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
Lucio Andrés Illanes Albornoz ed4f30
+            have_audio=yes
Lucio Andrés Illanes Albornoz ed4f30
+        fi
Lucio Andrés Illanes Albornoz ed4f30
+        # Set up the system libraries we need
Lucio Andrés Illanes Albornoz ed4f30
+        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -lkernel32"
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+        ;;
Lucio Andrés Illanes Albornoz ed4f30
     *-*-cygwin* | *-*-mingw32*)
Lucio Andrés Illanes Albornoz ed4f30
         ARCH=win32
Lucio Andrés Illanes Albornoz ed4f30
         if test "$build" != "$host"; then # cross-compiling
Lucio Andrés Illanes Albornoz ed4f30
diff -ru SDL-1.2.15.orig/src/audio/windib/SDL_dibaudio.c SDL-1.2.15/src/audio/windib/SDL_dibaudio.c
Lucio Andrés Illanes Albornoz ed4f30
--- SDL-1.2.15.orig/src/audio/windib/SDL_dibaudio.c	2012-01-19 07:30:06.000000000 +0100
Lucio Andrés Illanes Albornoz ed4f30
+++ SDL-1.2.15/src/audio/windib/SDL_dibaudio.c	2019-11-08 12:49:20.451023616 +0100
Lucio Andrés Illanes Albornoz ed4f30
@@ -35,6 +35,35 @@
Lucio Andrés Illanes Albornoz ed4f30
 #include "win_ce_semaphore.h"
Lucio Andrés Illanes Albornoz ed4f30
 #endif
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
+/* FIXME: temporary */
Lucio Andrés Illanes Albornoz ed4f30
+#ifndef WOM_DONE
Lucio Andrés Illanes Albornoz ed4f30
+#define WOM_DONE 0x3BD
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+#ifndef MAXERRORLENGTH
Lucio Andrés Illanes Albornoz ed4f30
+#define MAXERRORLENGTH 256
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+#ifndef THREAD_PRIORITY_HIGHEST
Lucio Andrés Illanes Albornoz ed4f30
+#define THREAD_PRIORITY_HIGHEST 2
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+#ifndef INFINITE
Lucio Andrés Illanes Albornoz ed4f30
+#define INFINITE 0xffffffff
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+#ifndef WAVE_FORMAT_PCM
Lucio Andrés Illanes Albornoz ed4f30
+#define WAVE_FORMAT_PCM 1
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+#ifndef WAVE_MAPPER
Lucio Andrés Illanes Albornoz ed4f30
+#define WAVE_MAPPER ((UINT)-1)
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+#ifndef CALLBACK_FUNCTION
Lucio Andrés Illanes Albornoz ed4f30
+#define CALLBACK_FUNCTION (int32_t)(0x00030000)
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 /* Audio driver functions */
Lucio Andrés Illanes Albornoz ed4f30
 static int DIB_OpenAudio(_THIS, SDL_AudioSpec *spec);
Lucio Andrés Illanes Albornoz ed4f30
@@ -132,7 +161,7 @@
Lucio Andrés Illanes Albornoz ed4f30
 	waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH-len);
Lucio Andrés Illanes Albornoz ed4f30
 	WideCharToMultiByte(CP_ACP,0,werrbuf,-1,errbuf+len,MAXERRORLENGTH-len,NULL,NULL);
Lucio Andrés Illanes Albornoz ed4f30
 #else
Lucio Andrés Illanes Albornoz ed4f30
-	waveOutGetErrorText(code, errbuf+len, (UINT)(MAXERRORLENGTH-len));
Lucio Andrés Illanes Albornoz ed4f30
+	waveOutGetErrorTextA(code, errbuf+len, (UINT)(MAXERRORLENGTH-len));
Lucio Andrés Illanes Albornoz ed4f30
 #endif
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 	SDL_SetError("%s",errbuf);
Lucio Andrés Illanes Albornoz ed4f30
@@ -290,7 +319,7 @@
Lucio Andrés Illanes Albornoz ed4f30
 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
Lucio Andrés Illanes Albornoz ed4f30
 	audio_sem = CreateSemaphoreCE(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL);
Lucio Andrés Illanes Albornoz ed4f30
 #else
Lucio Andrés Illanes Albornoz ed4f30
-	audio_sem = CreateSemaphore(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL);
Lucio Andrés Illanes Albornoz ed4f30
+	audio_sem = CreateSemaphoreA(NULL, NUM_BUFFERS-1, NUM_BUFFERS, NULL);
Lucio Andrés Illanes Albornoz ed4f30
 #endif
Lucio Andrés Illanes Albornoz ed4f30
 	if ( audio_sem == NULL ) {
Lucio Andrés Illanes Albornoz ed4f30
 		SDL_SetError("Couldn't create semaphore");
Lucio Andrés Illanes Albornoz ed4f30
diff -ru SDL-1.2.15.orig/src/video/wincommon/SDL_lowvideo.h SDL-1.2.15/src/video/wincommon/SDL_lowvideo.h
Lucio Andrés Illanes Albornoz ed4f30
--- SDL-1.2.15.orig/src/video/wincommon/SDL_lowvideo.h	2012-01-19 07:30:06.000000000 +0100
Lucio Andrés Illanes Albornoz ed4f30
+++ SDL-1.2.15/src/video/wincommon/SDL_lowvideo.h	2019-11-08 11:58:43.821344665 +0100
Lucio Andrés Illanes Albornoz ed4f30
@@ -140,7 +140,7 @@
Lucio Andrés Illanes Albornoz ed4f30
    GDL_CreateWindow as well */
Lucio Andrés Illanes Albornoz ed4f30
 LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
-#ifdef _WIN64
Lucio Andrés Illanes Albornoz ed4f30
+#if defined(_WIN64) || defined(__midipix__)
Lucio Andrés Illanes Albornoz ed4f30
 #define SDL_ToUnicode  ToUnicode
Lucio Andrés Illanes Albornoz ed4f30
 #else
Lucio Andrés Illanes Albornoz ed4f30
 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
Lucio Andrés Illanes Albornoz ed4f30
diff -ru SDL-1.2.15.orig/src/video/wincommon/SDL_sysevents.c SDL-1.2.15/src/video/wincommon/SDL_sysevents.c
Lucio Andrés Illanes Albornoz ed4f30
--- SDL-1.2.15.orig/src/video/wincommon/SDL_sysevents.c	2012-01-19 07:30:06.000000000 +0100
Lucio Andrés Illanes Albornoz ed4f30
+++ SDL-1.2.15/src/video/wincommon/SDL_sysevents.c	2019-11-08 11:14:47.506238807 +0100
Lucio Andrés Illanes Albornoz ed4f30
@@ -95,7 +95,7 @@
Lucio Andrés Illanes Albornoz ed4f30
 extern void DIB_SwapGamma(_THIS);
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 #ifndef NO_GETKEYBOARDSTATE
Lucio Andrés Illanes Albornoz ed4f30
-#ifndef _WIN64
Lucio Andrés Illanes Albornoz ed4f30
+#if !defined(_WIN64) && !defined(__midipix__)
Lucio Andrés Illanes Albornoz ed4f30
 /* Variables and support functions for SDL_ToUnicode() */
Lucio Andrés Illanes Albornoz ed4f30
 static int codepage;
Lucio Andrés Illanes Albornoz ed4f30
 static int Is9xME();
Lucio Andrés Illanes Albornoz ed4f30
@@ -669,7 +669,7 @@
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 #ifndef NO_GETKEYBOARDSTATE
Lucio Andrés Illanes Albornoz ed4f30
 		case WM_INPUTLANGCHANGE:
Lucio Andrés Illanes Albornoz ed4f30
-#ifndef _WIN64
Lucio Andrés Illanes Albornoz ed4f30
+#if !defined(_WIN64) && !defined(__midipix__)
Lucio Andrés Illanes Albornoz ed4f30
 			codepage = GetCodePage();
Lucio Andrés Illanes Albornoz ed4f30
 #endif
Lucio Andrés Illanes Albornoz ed4f30
 		return(TRUE);
Lucio Andrés Illanes Albornoz ed4f30
@@ -779,7 +779,7 @@
Lucio Andrés Illanes Albornoz ed4f30
 #endif /* WM_MOUSELEAVE */
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 #ifndef NO_GETKEYBOARDSTATE
Lucio Andrés Illanes Albornoz ed4f30
-#ifndef _WIN64
Lucio Andrés Illanes Albornoz ed4f30
+#if !defined(_WIN64) && !defined(__midipix__)
Lucio Andrés Illanes Albornoz ed4f30
 	/* Initialise variables for SDL_ToUnicode() */
Lucio Andrés Illanes Albornoz ed4f30
 	codepage = GetCodePage();
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
@@ -814,7 +814,7 @@
Lucio Andrés Illanes Albornoz ed4f30
 }
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 #ifndef NO_GETKEYBOARDSTATE
Lucio Andrés Illanes Albornoz ed4f30
-#ifndef _WIN64
Lucio Andrés Illanes Albornoz ed4f30
+#if !defined(_WIN64) && !defined(__midipix__)
Lucio Andrés Illanes Albornoz ed4f30
 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 static int Is9xME()
Lucio Andrés Illanes Albornoz ed4f30
diff -ru SDL-1.2.15.orig/src/video/windib/SDL_dibvideo.c SDL-1.2.15/src/video/windib/SDL_dibvideo.c
Lucio Andrés Illanes Albornoz ed4f30
--- SDL-1.2.15.orig/src/video/windib/SDL_dibvideo.c	2012-01-19 07:30:06.000000000 +0100
Lucio Andrés Illanes Albornoz ed4f30
+++ SDL-1.2.15/src/video/windib/SDL_dibvideo.c	2019-11-08 11:17:09.328149984 +0100
Lucio Andrés Illanes Albornoz ed4f30
@@ -822,9 +822,15 @@
Lucio Andrés Illanes Albornoz ed4f30
 				video->flags |= SDL_RESIZABLE;
Lucio Andrés Illanes Albornoz ed4f30
 			}
Lucio Andrés Illanes Albornoz ed4f30
 		}
Lucio Andrés Illanes Albornoz ed4f30
+
Lucio Andrés Illanes Albornoz ed4f30
+/* FIXME: the heck? */
Lucio Andrés Illanes Albornoz ed4f30
+#ifdef __midipix__
Lucio Andrés Illanes Albornoz ed4f30
+		if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
Lucio Andrés Illanes Albornoz ed4f30
+#else
Lucio Andrés Illanes Albornoz ed4f30
 #if WS_MAXIMIZE && !defined(_WIN32_WCE)
Lucio Andrés Illanes Albornoz ed4f30
 		if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
Lucio Andrés Illanes Albornoz ed4f30
 #endif
Lucio Andrés Illanes Albornoz ed4f30
+#endif
Lucio Andrés Illanes Albornoz ed4f30
 	}
Lucio Andrés Illanes Albornoz ed4f30
 
Lucio Andrés Illanes Albornoz ed4f30
 	/* DJM: Don't piss of anyone who has setup his own window */
Lucio Andrés Illanes Albornoz ed4f30