summaryrefslogtreecommitdiffhomepage
path: root/patches
diff options
context:
space:
mode:
Diffstat (limited to 'patches')
-rw-r--r--patches/sdl1-1.2.15_pre.local.patch10
-rw-r--r--patches/sdl1/cdrom.patch191
2 files changed, 200 insertions, 1 deletions
diff --git a/patches/sdl1-1.2.15_pre.local.patch b/patches/sdl1-1.2.15_pre.local.patch
index b6807090..559bb3c2 100644
--- a/patches/sdl1-1.2.15_pre.local.patch
+++ b/patches/sdl1-1.2.15_pre.local.patch
@@ -49,7 +49,7 @@ diff -ru SDL-1.2.15.orig/configure.in SDL-1.2.15/configure.in
CheckPulseAudio
CheckNAS
CheckX11
-@@ -2494,6 +2460,35 @@
+@@ -2494,6 +2460,43 @@
have_timers=yes
fi
;;
@@ -78,6 +78,14 @@ diff -ru SDL-1.2.15.orig/configure.in SDL-1.2.15/configure.in
+ SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
+ have_audio=yes
+ fi
++ # Set up files for the cdrom library
++ if test x$enable_cdrom = xyes; then
++ $as_echo "#define SDL_CDROM_WIN32 1" >>confdefs.h
++
++ SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
++ have_cdrom=yes
++ fi
++
+ # Set up the system libraries we need
+ EXTRA_LDFLAGS="$EXTRA_LDFLAGS -luser32 -lgdi32 -lwinmm -lkernel32"
+
diff --git a/patches/sdl1/cdrom.patch b/patches/sdl1/cdrom.patch
new file mode 100644
index 00000000..9c23cbb9
--- /dev/null
+++ b/patches/sdl1/cdrom.patch
@@ -0,0 +1,191 @@
+diff -ru SDL-1.2.15.orig/src/cdrom/win32/SDL_syscdrom.c SDL-1.2.15/src/cdrom/win32/SDL_syscdrom.c
+--- SDL-1.2.15.orig/src/cdrom/win32/SDL_syscdrom.c 2012-01-19 07:30:06.000000000 +0100
++++ SDL-1.2.15/src/cdrom/win32/SDL_syscdrom.c 2020-09-25 13:17:09.363163539 +0200
+@@ -29,6 +29,187 @@
+ #include <windows.h>
+ #include <mmsystem.h>
+
++/* oh dear */
++typedef UINT MCIDEVICEID;
++
++typedef struct tagMCI_PLAY_PARMS {
++ DWORD_PTR dwCallback;
++ DWORD dwFrom;
++ DWORD dwTo;
++} MCI_PLAY_PARMS,*PMCI_PLAY_PARMS,*LPMCI_PLAY_PARMS;
++
++typedef struct tagMCI_STATUS_PARMS {
++ DWORD_PTR dwCallback;
++ DWORD_PTR dwReturn;
++ DWORD dwItem;
++ DWORD dwTrack;
++} MCI_STATUS_PARMS,*PMCI_STATUS_PARMS,*LPMCI_STATUS_PARMS;
++
++typedef struct tagMCI_SET_PARMS {
++ DWORD_PTR dwCallback;
++ DWORD dwTimeFormat;
++ DWORD dwAudio;
++} MCI_SET_PARMS,*PMCI_SET_PARMS,*LPMCI_SET_PARMS;
++
++typedef struct tagMCI_OPEN_PARMSA {
++ DWORD_PTR dwCallback;
++ MCIDEVICEID wDeviceID;
++ LPCSTR lpstrDeviceType;
++ LPCSTR lpstrElementName;
++ LPCSTR lpstrAlias;
++} MCI_OPEN_PARMSA,*PMCI_OPEN_PARMSA,*LPMCI_OPEN_PARMSA;
++
++#define MCI_OPEN_PARMS MCI_OPEN_PARMSA
++
++__dllimport UINT __stdcall GetDriveTypeA (LPCSTR lpRootPathName);
++#define GetDriveType GetDriveTypeA
++
++__dllimport MCIERROR __stdcall mciSendCommandA(MCIDEVICEID mciId,UINT uMsg,DWORD_PTR dwParam1,DWORD_PTR dwParam2);
++#define mciSendCommand mciSendCommandA
++
++__dllimport BOOL __stdcall mciGetErrorStringA(MCIERROR mcierr,LPSTR pszText,UINT cchText);
++#define mciGetErrorString mciGetErrorStringA
++
++#ifndef MCI_MSF_MINUTE
++#define MCI_MSF_MINUTE(msf) ((BYTE)(msf))
++#endif
++
++#ifndef MCI_MSF_SECOND
++#define MCI_MSF_SECOND(msf) ((BYTE)(((WORD)(msf)) >> 8))
++#endif
++
++#ifndef MCI_MSF_FRAME
++#define MCI_MSF_FRAME(msf) ((BYTE)((msf)>>16))
++#endif
++
++#ifndef MCI_MAKE_MSF
++#define MCI_MAKE_MSF(m,s,f) ((DWORD)(((BYTE)(m) | ((WORD)(s)<<8)) | (((DWORD)(BYTE)(f))<<16)))
++#endif
++
++#ifndef DRIVE_CDROM
++#define DRIVE_CDROM 5
++#endif
++
++#ifndef MCI_DEVTYPE_CD_AUDIO
++#define MCI_DEVTYPE_CD_AUDIO 516
++#endif
++
++#ifndef MCI_OPEN_TYPE
++#define MCI_OPEN_TYPE (uint32_t)0x00002000
++#endif
++
++#ifndef MCI_OPEN_TYPE_ID
++#define MCI_OPEN_TYPE_ID (uint32_t)0x00001000
++#endif
++
++#ifndef MCI_OPEN_SHAREABLE
++#define MCI_OPEN_SHAREABLE (uint32_t)0x00000100
++#endif
++
++#ifndef MCI_OPEN_ELEMENT
++#define MCI_OPEN_ELEMENT (uint32_t)0x00000200
++#endif
++
++#ifndef MCI_OPEN
++#define MCI_OPEN 0x0803
++#endif
++
++#ifndef MCI_CLOSE
++#define MCI_CLOSE 0x0804
++#endif
++
++#ifndef MCI_WAIT
++#define MCI_WAIT (uint32_t)0x00000002
++#endif
++
++#ifndef MCI_SET
++#define MCI_SET 0x080D
++#endif
++
++#ifndef MCI_PLAY
++#define MCI_PLAY 0x0806
++#endif
++
++#ifndef MCI_STOP
++#define MCI_STOP 0x0808
++#endif
++
++#ifndef MCI_STATUS
++#define MCI_STATUS 0x0814
++#endif
++
++#ifndef MCI_PAUSE
++#define MCI_PAUSE 0x0809
++#endif
++
++#ifndef MCI_TO
++#define MCI_TO (uint32_t)0x00000008
++#endif
++
++#ifndef MCI_FROM
++#define MCI_FROM (uint32_t)0x00000004
++#endif
++
++#ifndef MCI_NOTIFY
++#define MCI_NOTIFY (uint32_t)0x00000001
++#endif
++
++#ifndef MCI_STATUS_POSITION
++#define MCI_STATUS_POSITION (uint32_t)0x00000002
++#endif
++
++#ifndef MCI_STATUS_ITEM
++#define MCI_STATUS_ITEM (uint32_t)0x00000100
++#endif
++
++#ifndef MCI_STATUS_MODE
++#define MCI_STATUS_MODE (uint32_t)0x00000004
++#endif
++
++#ifndef MCI_STATUS_LENGTH
++#define MCI_STATUS_LENGTH (uint32_t)0x00000001
++#endif
++
++#ifndef MCI_STATUS_NUMBER_OF_TRACKS
++#define MCI_STATUS_NUMBER_OF_TRACKS (uint32_t)0x00000003
++#endif
++
++#ifndef MCI_TRACK
++#define MCI_TRACK (uint32_t)0x00000010
++#endif
++
++#ifndef MCI_SET_DOOR_OPEN
++#define MCI_SET_DOOR_OPEN (uint32_t)0x00000100
++#endif
++
++#ifndef MCI_MODE_NOT_READY
++#define MCI_MODE_NOT_READY 524
++#endif
++
++#ifndef MCI_MODE_OPEN
++#define MCI_MODE_OPEN 530
++#endif
++
++#ifndef MCI_MODE_STOP
++#define MCI_MODE_STOP 525
++#endif
++
++#ifndef MCI_MODE_PLAY
++#define MCI_MODE_PLAY 526
++#endif
++
++#ifndef MCI_MODE_PAUSE
++#define MCI_MODE_PAUSE 529
++#endif
++
++#ifndef MCI_SET_TIME_FORMAT
++#define MCI_SET_TIME_FORMAT (uint32_t)0x00000400
++#endif
++
++#ifndef MCI_FORMAT_MSF
++#define MCI_FORMAT_MSF 2
++#endif
++
+ #include "SDL_cdrom.h"
+ #include "../SDL_syscdrom.h"
+