Blame patches/sdl1/cdrom.patch

fa8b36
diff -ru SDL-1.2.15.orig/src/cdrom/win32/SDL_syscdrom.c SDL-1.2.15/src/cdrom/win32/SDL_syscdrom.c
fa8b36
--- SDL-1.2.15.orig/src/cdrom/win32/SDL_syscdrom.c	2012-01-19 07:30:06.000000000 +0100
fa8b36
+++ SDL-1.2.15/src/cdrom/win32/SDL_syscdrom.c	2020-09-25 13:17:09.363163539 +0200
fa8b36
@@ -29,6 +29,187 @@
fa8b36
 #include <windows.h>
fa8b36
 #include <mmsystem.h>
fa8b36
 
fa8b36
+/* oh dear */
fa8b36
+typedef UINT MCIDEVICEID;
fa8b36
+
fa8b36
+typedef struct tagMCI_PLAY_PARMS {
fa8b36
+    DWORD_PTR dwCallback;
fa8b36
+    DWORD dwFrom;
fa8b36
+    DWORD dwTo;
fa8b36
+} MCI_PLAY_PARMS,*PMCI_PLAY_PARMS,*LPMCI_PLAY_PARMS;
fa8b36
+
fa8b36
+typedef struct tagMCI_STATUS_PARMS {
fa8b36
+    DWORD_PTR dwCallback;
fa8b36
+    DWORD_PTR dwReturn;
fa8b36
+    DWORD dwItem;
fa8b36
+    DWORD dwTrack;
fa8b36
+} MCI_STATUS_PARMS,*PMCI_STATUS_PARMS,*LPMCI_STATUS_PARMS;
fa8b36
+
fa8b36
+typedef struct tagMCI_SET_PARMS {
fa8b36
+    DWORD_PTR dwCallback;
fa8b36
+    DWORD dwTimeFormat;
fa8b36
+    DWORD dwAudio;
fa8b36
+} MCI_SET_PARMS,*PMCI_SET_PARMS,*LPMCI_SET_PARMS;
fa8b36
+
fa8b36
+typedef struct tagMCI_OPEN_PARMSA {
fa8b36
+    DWORD_PTR dwCallback;
fa8b36
+    MCIDEVICEID wDeviceID;
fa8b36
+    LPCSTR lpstrDeviceType;
fa8b36
+    LPCSTR lpstrElementName;
fa8b36
+    LPCSTR lpstrAlias;
fa8b36
+} MCI_OPEN_PARMSA,*PMCI_OPEN_PARMSA,*LPMCI_OPEN_PARMSA;
fa8b36
+
fa8b36
+#define MCI_OPEN_PARMS MCI_OPEN_PARMSA
fa8b36
+
fa8b36
+__dllimport UINT __stdcall GetDriveTypeA (LPCSTR lpRootPathName);
fa8b36
+#define GetDriveType GetDriveTypeA
fa8b36
+
fa8b36
+__dllimport MCIERROR __stdcall mciSendCommandA(MCIDEVICEID mciId,UINT uMsg,DWORD_PTR dwParam1,DWORD_PTR dwParam2);
fa8b36
+#define mciSendCommand mciSendCommandA
fa8b36
+
fa8b36
+__dllimport BOOL __stdcall mciGetErrorStringA(MCIERROR mcierr,LPSTR pszText,UINT cchText);
fa8b36
+#define mciGetErrorString mciGetErrorStringA
fa8b36
+
fa8b36
+#ifndef MCI_MSF_MINUTE
fa8b36
+#define MCI_MSF_MINUTE(msf) ((BYTE)(msf))
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MSF_SECOND
fa8b36
+#define MCI_MSF_SECOND(msf) ((BYTE)(((WORD)(msf)) >> 8))
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MSF_FRAME
fa8b36
+#define MCI_MSF_FRAME(msf) ((BYTE)((msf)>>16))
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MAKE_MSF
fa8b36
+#define MCI_MAKE_MSF(m,s,f) ((DWORD)(((BYTE)(m) | ((WORD)(s)<<8)) | (((DWORD)(BYTE)(f))<<16)))
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef DRIVE_CDROM
fa8b36
+#define DRIVE_CDROM 5
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_DEVTYPE_CD_AUDIO
fa8b36
+#define MCI_DEVTYPE_CD_AUDIO 516
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_OPEN_TYPE
fa8b36
+#define MCI_OPEN_TYPE (uint32_t)0x00002000
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_OPEN_TYPE_ID
fa8b36
+#define MCI_OPEN_TYPE_ID (uint32_t)0x00001000
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_OPEN_SHAREABLE
fa8b36
+#define MCI_OPEN_SHAREABLE (uint32_t)0x00000100
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_OPEN_ELEMENT
fa8b36
+#define MCI_OPEN_ELEMENT (uint32_t)0x00000200
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_OPEN
fa8b36
+#define MCI_OPEN 0x0803
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_CLOSE
fa8b36
+#define MCI_CLOSE 0x0804
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_WAIT
fa8b36
+#define MCI_WAIT (uint32_t)0x00000002
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_SET
fa8b36
+#define MCI_SET 0x080D
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_PLAY
fa8b36
+#define MCI_PLAY 0x0806
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_STOP
fa8b36
+#define MCI_STOP 0x0808
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_STATUS
fa8b36
+#define MCI_STATUS 0x0814
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_PAUSE
fa8b36
+#define MCI_PAUSE 0x0809
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_TO
fa8b36
+#define MCI_TO (uint32_t)0x00000008
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_FROM
fa8b36
+#define MCI_FROM (uint32_t)0x00000004
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_NOTIFY
fa8b36
+#define MCI_NOTIFY (uint32_t)0x00000001
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_STATUS_POSITION
fa8b36
+#define MCI_STATUS_POSITION (uint32_t)0x00000002
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_STATUS_ITEM
fa8b36
+#define MCI_STATUS_ITEM (uint32_t)0x00000100
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_STATUS_MODE
fa8b36
+#define MCI_STATUS_MODE (uint32_t)0x00000004
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_STATUS_LENGTH
fa8b36
+#define MCI_STATUS_LENGTH (uint32_t)0x00000001
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_STATUS_NUMBER_OF_TRACKS
fa8b36
+#define MCI_STATUS_NUMBER_OF_TRACKS (uint32_t)0x00000003
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_TRACK
fa8b36
+#define MCI_TRACK (uint32_t)0x00000010
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_SET_DOOR_OPEN
fa8b36
+#define MCI_SET_DOOR_OPEN (uint32_t)0x00000100
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MODE_NOT_READY
fa8b36
+#define MCI_MODE_NOT_READY 524
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MODE_OPEN
fa8b36
+#define MCI_MODE_OPEN 530
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MODE_STOP
fa8b36
+#define MCI_MODE_STOP 525
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MODE_PLAY
fa8b36
+#define MCI_MODE_PLAY 526
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_MODE_PAUSE
fa8b36
+#define MCI_MODE_PAUSE 529
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_SET_TIME_FORMAT
fa8b36
+#define MCI_SET_TIME_FORMAT (uint32_t)0x00000400
fa8b36
+#endif
fa8b36
+
fa8b36
+#ifndef MCI_FORMAT_MSF
fa8b36
+#define MCI_FORMAT_MSF 2
fa8b36
+#endif
fa8b36
+
fa8b36
 #include "SDL_cdrom.h"
fa8b36
 #include "../SDL_syscdrom.h"
fa8b36