diff -Nur SDL-1.2.8_o/src/audio/windib/SDL_dibaudio.c SDL-1.2.8/src/audio/windib/SDL_dibaudio.c --- SDL-1.2.8_o/src/audio/windib/SDL_dibaudio.c 2004-02-18 08:22:00.000000000 +0100 +++ SDL-1.2.8/src/audio/windib/SDL_dibaudio.c 2005-07-28 20:58:41.920875000 +0200 @@ -105,7 +105,7 @@ /* The Win32 callback for filling the WAVE device */ -static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, +static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD dwParam1, DWORD dwParam2) { SDL_AudioDevice *this = (SDL_AudioDevice *)dwInstance; @@ -131,7 +131,7 @@ #endif sprintf(errbuf, "%s: ", function); - len = strlen(errbuf); + len = (int)strlen(errbuf); #ifdef _WIN32_WCE /* UNICODE version */ @@ -272,7 +272,7 @@ /* Open the audio device */ result = waveOutOpen(&sound, WAVE_MAPPER, &waveformat, - (DWORD)FillSound, (DWORD)this, CALLBACK_FUNCTION); + (DWORD_PTR)FillSound, (DWORD_PTR)this, CALLBACK_FUNCTION); if ( result != MMSYSERR_NOERROR ) { SetMMerror("waveOutOpen()", result); return(-1); diff -Nur SDL-1.2.8_o/src/cdrom/win32/SDL_syscdrom.c SDL-1.2.8/src/cdrom/win32/SDL_syscdrom.c --- SDL-1.2.8_o/src/cdrom/win32/SDL_syscdrom.c 2004-12-12 22:54:32.000000000 +0100 +++ SDL-1.2.8/src/cdrom/win32/SDL_syscdrom.c 2005-07-28 19:57:44.217750000 +0200 @@ -114,11 +114,11 @@ } /* General ioctl() CD-ROM command function */ -static int SDL_SYS_CDioctl(int id, UINT msg, DWORD flags, void *arg) +static int SDL_SYS_CDioctl(int id, UINT msg, DWORD_PTR flags, void *arg) { MCIERROR mci_error; - mci_error = mciSendCommand(SDL_mciID[id], msg, flags, (DWORD)arg); + mci_error = mciSendCommand(SDL_mciID[id], msg, flags, (DWORD_PTR)arg); if ( mci_error ) { char error[256]; @@ -176,7 +176,7 @@ mci_status.dwItem = MCI_STATUS_NUMBER_OF_TRACKS; flags = MCI_STATUS_ITEM | MCI_WAIT; if ( SDL_SYS_CDioctl(cdrom->id, MCI_STATUS, flags, &mci_status) == 0 ) { - cdrom->numtracks = mci_status.dwReturn; + cdrom->numtracks = (int)mci_status.dwReturn; if ( cdrom->numtracks > SDL_MAX_TRACKS ) { cdrom->numtracks = SDL_MAX_TRACKS; } @@ -345,7 +345,7 @@ flags = MCI_FROM | MCI_TO | MCI_NOTIFY; mci_play.dwCallback = 0; - mci_play.dwFrom = mci_status.dwReturn; + mci_play.dwFrom = (DWORD)mci_status.dwReturn; mci_play.dwTo = SDL_CD_end_position; if (SDL_SYS_CDioctl(cdrom->id,MCI_PLAY,flags,&mci_play) == 0) { okay = 1; diff -Nur SDL-1.2.8_o/src/cpuinfo/SDL_cpuinfo.c SDL-1.2.8/src/cpuinfo/SDL_cpuinfo.c --- SDL-1.2.8_o/src/cpuinfo/SDL_cpuinfo.c 2004-12-12 22:54:32.000000000 +0100 +++ SDL-1.2.8/src/cpuinfo/SDL_cpuinfo.c 2005-07-28 23:51:06.582625000 +0200 @@ -101,6 +101,8 @@ : : "%rax", "%rcx" ); +#elif defined(_WIN64) + has_CPUID = 1; #elif defined(_MSC_VER) __asm { pushfd ; Get original EFLAGS @@ -140,6 +142,9 @@ : : "%eax", "%ecx", "%edx", "%edi" ); +#elif defined(_WIN64) + // assume resonable AMD64 CPU (RDTSC, MMX, SSE, SSE2) + features = 0x04000000 | 0x00000010 | 0x00800000 | 0x02000000; #elif defined(_MSC_VER) __asm { xor eax, eax ; Set up for CPUID instruction @@ -175,6 +180,8 @@ : : "%eax", "%ecx", "%edx", "%edi" ); +#elif defined(_WIN64) + // assume resonable AMD64 CPU, e.g. do nothing #elif defined(_MSC_VER) __asm { mov eax,80000000h ; Query for extended functions diff -Nur SDL-1.2.8_o/src/file/SDL_rwops.c SDL-1.2.8/src/file/SDL_rwops.c --- SDL-1.2.8_o/src/file/SDL_rwops.c 2004-02-18 08:22:00.000000000 +0100 +++ SDL-1.2.8/src/file/SDL_rwops.c 2005-07-28 23:53:58.520125000 +0200 @@ -55,7 +55,7 @@ if ( nread == 0 && ferror(context->hidden.stdio.fp) ) { SDL_Error(SDL_EFREAD); } - return(nread); + return (int)(nread); } static int stdio_write(SDL_RWops *context, const void *ptr, int size, int num) { @@ -65,7 +65,7 @@ if ( nwrote == 0 && ferror(context->hidden.stdio.fp) ) { SDL_Error(SDL_EFWRITE); } - return(nwrote); + return (int)(nwrote); } static int stdio_close(SDL_RWops *context) { @@ -106,7 +106,7 @@ newpos = context->hidden.mem.stop; } context->hidden.mem.here = newpos; - return(context->hidden.mem.here-context->hidden.mem.base); + return (int)(context->hidden.mem.here-context->hidden.mem.base); } static int mem_read(SDL_RWops *context, void *ptr, int size, int maxnum) { @@ -114,7 +114,7 @@ num = maxnum; if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) { - num = (context->hidden.mem.stop-context->hidden.mem.here)/size; + num = (int)(context->hidden.mem.stop-context->hidden.mem.here)/size; } memcpy(ptr, context->hidden.mem.here, num*size); context->hidden.mem.here += num*size; @@ -123,7 +123,7 @@ static int mem_write(SDL_RWops *context, const void *ptr, int size, int num) { if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) { - num = (context->hidden.mem.stop-context->hidden.mem.here)/size; + num = (int)(context->hidden.mem.stop-context->hidden.mem.here)/size; } memcpy(context->hidden.mem.here, ptr, num*size); context->hidden.mem.here += num*size; diff -Nur SDL-1.2.8_o/src/main/win32/SDL_win32_main.c SDL-1.2.8/src/main/win32/SDL_win32_main.c --- SDL-1.2.8_o/src/main/win32/SDL_win32_main.c 2004-01-04 06:48:44.000000000 +0100 +++ SDL-1.2.8/src/main/win32/SDL_win32_main.c 2005-07-29 00:10:14.738875000 +0200 @@ -190,7 +190,7 @@ /* This is where execution begins [console apps] */ int console_main(int argc, char *argv[]) { - int n; + size_t n; char *bufp, *appname; /* Get the class name from argv[0] */ diff -Nur SDL-1.2.8_o/src/timer/win32/SDL_systimer.c SDL-1.2.8/src/timer/win32/SDL_systimer.c --- SDL-1.2.8_o/src/timer/win32/SDL_systimer.c 2004-02-18 08:22:04.000000000 +0100 +++ SDL-1.2.8/src/timer/win32/SDL_systimer.c 2005-07-28 19:53:01.952125000 +0200 @@ -171,8 +171,8 @@ /* Data to handle a single periodic alarm */ static UINT timerID = 0; -static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD dwUser, - DWORD dw1, DWORD dw2) +static void CALLBACK HandleAlarm(UINT uID, UINT uMsg, DWORD_PTR dwUser, + DWORD_PTR dw1, DWORD_PTR dw2) { SDL_ThreadedTimerCheck(); } diff -Nur SDL-1.2.8_o/src/video/SDL_RLEaccel.c SDL-1.2.8/src/video/SDL_RLEaccel.c --- SDL-1.2.8_o/src/video/SDL_RLEaccel.c 2004-12-12 22:54:34.000000000 +0100 +++ SDL-1.2.8/src/video/SDL_RLEaccel.c 2005-07-28 23:56:18.879500000 +0200 @@ -598,12 +598,12 @@ unsigned n = (length); \ Uint16 *src = (Uint16 *)(from); \ Uint16 *dst = (Uint16 *)(to); \ - if(((unsigned long)src ^ (unsigned long)dst) & 3) { \ + if(((size_t)src ^ (size_t)dst) & 3) { \ /* source and destination not in phase, blit one by one */ \ while(n--) \ BLEND16_50(dst, src, mask); \ } else { \ - if((unsigned long)src & 3) { \ + if((size_t)src & 3) { \ /* first odd pixel */ \ BLEND16_50(dst, src, mask); \ n--; \ @@ -1066,7 +1066,7 @@ } while(ofs < w); \ /* skip padding if necessary */ \ if(sizeof(Ptype) == 2) \ - srcbuf += (unsigned long)srcbuf & 2; \ + srcbuf += (size_t)srcbuf & 2; \ /* blit translucent pixels on the same line */ \ ofs = 0; \ do { \ @@ -1158,7 +1158,7 @@ } while(ofs < w); /* skip padding */ - srcbuf += (unsigned long)srcbuf & 2; + srcbuf += (size_t)srcbuf & 2; /* skip translucent line */ ofs = 0; @@ -1222,7 +1222,7 @@ } while(ofs < w); \ /* skip padding if necessary */ \ if(sizeof(Ptype) == 2) \ - srcbuf += (unsigned long)srcbuf & 2; \ + srcbuf += (size_t)srcbuf & 2; \ /* blit translucent pixels on the same line */ \ ofs = 0; \ do { \ @@ -1558,7 +1558,7 @@ } while(x < w); /* Make sure the next output address is 32-bit aligned */ - dst += (unsigned long)dst & 2; + dst += (size_t)dst & 2; /* Next, encode all translucent pixels of the same scan line */ x = 0; @@ -1884,7 +1884,7 @@ /* skip padding if needed */ if(bpp == 2) - srcbuf += (unsigned long)srcbuf & 2; + srcbuf += (size_t)srcbuf & 2; /* copy translucent pixels */ ofs = 0; diff -Nur SDL-1.2.8_o/src/video/SDL_blit_A.c SDL-1.2.8/src/video/SDL_blit_A.c --- SDL-1.2.8_o/src/video/SDL_blit_A.c 2004-12-12 22:54:34.000000000 +0100 +++ SDL-1.2.8/src/video/SDL_blit_A.c 2005-07-28 21:09:53.342750000 +0200 @@ -677,7 +677,7 @@ int dstskip = info->d_skip >> 1; while(height--) { - if(((unsigned long)srcp ^ (unsigned long)dstp) & 2) { + if(((size_t)srcp ^ (size_t)dstp) & 2) { /* * Source and destination not aligned, pipeline it. * This is mostly a win for big blits but no loss for @@ -687,7 +687,7 @@ int w = width; /* handle odd destination */ - if((unsigned long)dstp & 2) { + if((size_t)dstp & 2) { Uint16 d = *dstp, s = *srcp; *dstp = BLEND16_50(d, s, mask); dstp++; @@ -732,7 +732,7 @@ int w = width; /* first odd pixel? */ - if((unsigned long)srcp & 2) { + if((size_t)srcp & 2) { Uint16 d = *dstp, s = *srcp; *dstp = BLEND16_50(d, s, mask); srcp++; diff -Nur SDL-1.2.8_o/src/video/SDL_stretch.c SDL-1.2.8/src/video/SDL_stretch.c --- SDL-1.2.8_o/src/video/SDL_stretch.c 2004-12-12 22:54:34.000000000 +0100 +++ SDL-1.2.8/src/video/SDL_stretch.c 2005-07-28 19:59:59.077125000 +0200 @@ -39,7 +39,7 @@ into the general blitting mechanism. */ -#if (defined(WIN32) && !defined(_M_ALPHA) && !defined(_WIN32_WCE) && \ +#if (defined(WIN32) && !defined(_M_AMD64) && !defined(_M_ALPHA) && !defined(_WIN32_WCE) && \ !defined(__WATCOMC__) && !defined(__LCC__) && !defined(__FREEBCC__)) || \ (defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)) #define USE_ASM_STRETCH diff -Nur SDL-1.2.8_o/src/video/SDL_surface.c SDL-1.2.8/src/video/SDL_surface.c --- SDL-1.2.8_o/src/video/SDL_surface.c 2004-12-12 22:54:34.000000000 +0100 +++ SDL-1.2.8/src/video/SDL_surface.c 2005-07-28 19:58:41.889625000 +0200 @@ -602,7 +602,7 @@ dstrect->x*dst->format->BytesPerPixel; if ( dst->format->palette || (color == 0) ) { x = dstrect->w*dst->format->BytesPerPixel; - if ( !color && !((long)row&3) && !(x&3) && !(dst->pitch&3) ) { + if ( !color && !((size_t)row&3) && !(x&3) && !(dst->pitch&3) ) { int n = x >> 2; for ( y=dstrect->h; y; --y ) { SDL_memset4(row, 0, n); @@ -688,7 +688,7 @@ Uint16 c = color; Uint32 cc = (Uint32)c << 16 | c; int n = dstrect->w; - if((unsigned long)pixels & 3) { + if((size_t)pixels & 3) { *pixels++ = c; n--; } diff -Nur SDL-1.2.8_o/src/video/wincommon/SDL_lowvideo.h SDL-1.2.8/src/video/wincommon/SDL_lowvideo.h --- SDL-1.2.8_o/src/video/wincommon/SDL_lowvideo.h 2004-02-18 08:22:10.000000000 +0100 +++ SDL-1.2.8/src/video/wincommon/SDL_lowvideo.h 2005-07-28 19:55:36.499000000 +0200 @@ -106,6 +106,6 @@ /* DJM: This is really from SDL_sysevents.c, we need it in GDL_CreateWindow as well */ -LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); #endif /* SDL_lowvideo_h */ diff -Nur SDL-1.2.8_o/src/video/wincommon/SDL_sysevents.c SDL-1.2.8/src/video/wincommon/SDL_sysevents.c --- SDL-1.2.8_o/src/video/wincommon/SDL_sysevents.c 2004-02-18 08:22:10.000000000 +0100 +++ SDL-1.2.8/src/video/wincommon/SDL_sysevents.c 2005-07-28 19:56:07.795875000 +0200 @@ -108,7 +108,7 @@ static BOOL (WINAPI *_TrackMouseEvent)(TRACKMOUSEEVENT *ptme) = NULL; static VOID CALLBACK -TrackMouseTimerProc(HWND hWnd, UINT uMsg, UINT idEvent, DWORD dwTime) +TrackMouseTimerProc(HWND hWnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { RECT rect; POINT pt; @@ -126,7 +126,7 @@ static BOOL WINAPI WIN_TrackMouseEvent(TRACKMOUSEEVENT *ptme) { if ( ptme->dwFlags == TME_LEAVE ) { - return SetTimer(ptme->hwndTrack, ptme->dwFlags, 100, + return (BOOL)SetTimer(ptme->hwndTrack, ptme->dwFlags, 100, (TIMERPROC)TrackMouseTimerProc); } return FALSE; @@ -177,7 +177,7 @@ /* The main Win32 event handler DJM: This is no longer static as (DX5/DIB)_CreateWindow needs it */ -LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { SDL_VideoDevice *this = current_video; static int mouse_pressed = 0; @@ -601,13 +601,13 @@ #ifdef _WIN32_WCE { /* WinCE uses the UNICODE version */ - int nLen = strlen(name)+1; + int nLen = (int)strlen(name)+1; SDL_Appname = malloc(nLen*2); MultiByteToWideChar(CP_ACP, 0, name, -1, SDL_Appname, nLen); } #else { - int nLen = strlen(name)+1; + size_t nLen = strlen(name)+1; SDL_Appname = malloc(nLen); strcpy(SDL_Appname, name); } diff -Nur SDL-1.2.8_o/src/video/wincommon/SDL_sysmouse.c SDL-1.2.8/src/video/wincommon/SDL_sysmouse.c --- SDL-1.2.8_o/src/video/wincommon/SDL_sysmouse.c 2003-08-30 12:13:12.000000000 +0200 +++ SDL-1.2.8/src/video/wincommon/SDL_sysmouse.c 2005-07-28 19:53:37.764625000 +0200 @@ -177,7 +177,11 @@ /* Create the cursor */ cursor->curs = CreateCursor( +#ifdef _WIN64 + (HINSTANCE)GetWindowLongPtr(SDL_Window, GWLP_HINSTANCE), +#else (HINSTANCE)GetWindowLong(SDL_Window, GWL_HINSTANCE), +#endif hot_x, hot_y, allowed_x, allowed_y, cursor->ands, cursor->xors); if ( cursor->curs == NULL ) { diff -Nur SDL-1.2.8_o/src/video/wincommon/SDL_syswm.c SDL-1.2.8/src/video/wincommon/SDL_syswm.c --- SDL-1.2.8_o/src/video/wincommon/SDL_syswm.c 2003-08-30 12:13:12.000000000 +0200 +++ SDL-1.2.8/src/video/wincommon/SDL_syswm.c 2005-07-28 19:51:53.545875000 +0200 @@ -205,7 +205,11 @@ if ( screen_icn == NULL ) { SDL_SetError("Couldn't create Win32 icon handle"); } else { +#ifdef _WIN64 + SetClassLongPtr(SDL_Window, GCLP_HICON, (LONG_PTR)screen_icn); +#else SetClassLong(SDL_Window, GCL_HICON, (LONG)screen_icn); +#endif } #endif /* DISABLE_ICON_SUPPORT */ } diff -Nur SDL-1.2.8_o/src/video/windib/SDL_dibevents.c SDL-1.2.8/src/video/windib/SDL_dibevents.c --- SDL-1.2.8_o/src/video/windib/SDL_dibevents.c 2004-12-12 22:54:36.000000000 +0100 +++ SDL-1.2.8/src/video/windib/SDL_dibevents.c 2005-07-28 23:52:03.363875000 +0200 @@ -60,7 +60,7 @@ static WNDPROC userWindowProc = NULL; /* The main Win32 event handler */ -LONG +LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { extern int posted; @@ -121,7 +121,7 @@ } #endif /* NO_GETKEYBOARDSTATE */ posted = SDL_PrivateKeyboard(SDL_PRESSED, - TranslateKey(wParam,HIWORD(lParam),&keysym,1)); + TranslateKey((UINT)wParam,HIWORD(lParam),&keysym,1)); } return(0); @@ -156,7 +156,7 @@ break; } posted = SDL_PrivateKeyboard(SDL_RELEASED, - TranslateKey(wParam,HIWORD(lParam),&keysym,0)); + TranslateKey((UINT)wParam,HIWORD(lParam),&keysym,0)); } return(0); @@ -367,7 +367,11 @@ #endif SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0); if ( SDL_windowid ) { +#ifdef _WIN64 + SDL_Window = (HWND)_strtoi64(SDL_windowid, NULL, 0); +#else SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0); +#endif if ( SDL_Window == NULL ) { SDL_SetError("Couldn't get user specified window"); return(-1); @@ -376,8 +380,13 @@ /* DJM: we want all event's for the user specified window to be handled by SDL. */ +#ifdef _WIN64 + userWindowProc = (WNDPROC)GetWindowLongPtr(SDL_Window, GWLP_WNDPROC); + SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)WinMessage); +#else userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC); SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); +#endif } else { SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), @@ -394,7 +403,11 @@ void DIB_DestroyWindow(_THIS) { if ( SDL_windowid ) { +#ifdef _WIN64 + SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)userWindowProc); +#else SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)userWindowProc); +#endif } else { DestroyWindow(SDL_Window); } diff -Nur SDL-1.2.8_o/src/video/windx5/SDL_dx5events.c SDL-1.2.8/src/video/windx5/SDL_dx5events.c --- SDL-1.2.8_o/src/video/windx5/SDL_dx5events.c 2004-12-12 22:54:36.000000000 +0100 +++ SDL-1.2.8/src/video/windx5/SDL_dx5events.c 2005-07-28 20:04:23.561500000 +0200 @@ -462,7 +462,7 @@ } /* The main Win32 event handler */ -LONG +LRESULT DX5_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -495,7 +495,7 @@ /* Ack! The display changed size and/or depth! */ SizeX = LOWORD(lParam); SizeY = HIWORD(lParam); - BitsPerPixel = wParam; + BitsPerPixel = (WORD)wParam; /* We cause this message when we go fullscreen */ } break; @@ -848,7 +848,11 @@ #endif SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0); if ( SDL_windowid ) { +#ifdef _WIN64 + SDL_Window = (HWND)_strtoi64(SDL_windowid, NULL, 0); +#else SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0); +#endif if ( SDL_Window == NULL ) { SDL_SetError("Couldn't get user specified window"); return(-1); @@ -857,8 +861,13 @@ /* DJM: we want all event's for the user specified window to be handled by SDL. */ +#ifdef _WIN64 + userWindowProc = (WNDPROC)GetWindowLongPtr(SDL_Window, GWLP_WNDPROC); + SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)WinMessage); +#else userWindowProc = (WNDPROC)GetWindowLong(SDL_Window, GWL_WNDPROC); SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); +#endif } else { SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), @@ -886,7 +895,11 @@ /* Destroy our window */ if ( SDL_windowid ) { +#ifdef _WIN64 + SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)userWindowProc); +#else SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)userWindowProc); +#endif } else { DestroyWindow(SDL_Window); } diff -Nur SDL-1.2.8_o/src/video/windx5/SDL_dx5video.c SDL-1.2.8/src/video/windx5/SDL_dx5video.c --- SDL-1.2.8_o/src/video/windx5/SDL_dx5video.c 2004-12-12 22:54:36.000000000 +0100 +++ SDL-1.2.8/src/video/windx5/SDL_dx5video.c 2005-07-29 00:51:31.395125000 +0200 @@ -76,341 +76,6 @@ }; static struct DX5EnumRect *enumlists[NUM_MODELISTS]; -/* - * Experimentally determined values for c_cfDI* constants used in DirectX 5.0 - */ - -/* Keyboard */ - -static DIOBJECTDATAFORMAT KBD_fmt[] = { - { &GUID_Key, 0, 0x8000000C, 0x00000000 }, - { &GUID_Key, 1, 0x8000010C, 0x00000000 }, - { &GUID_Key, 2, 0x8000020C, 0x00000000 }, - { &GUID_Key, 3, 0x8000030C, 0x00000000 }, - { &GUID_Key, 4, 0x8000040C, 0x00000000 }, - { &GUID_Key, 5, 0x8000050C, 0x00000000 }, - { &GUID_Key, 6, 0x8000060C, 0x00000000 }, - { &GUID_Key, 7, 0x8000070C, 0x00000000 }, - { &GUID_Key, 8, 0x8000080C, 0x00000000 }, - { &GUID_Key, 9, 0x8000090C, 0x00000000 }, - { &GUID_Key, 10, 0x80000A0C, 0x00000000 }, - { &GUID_Key, 11, 0x80000B0C, 0x00000000 }, - { &GUID_Key, 12, 0x80000C0C, 0x00000000 }, - { &GUID_Key, 13, 0x80000D0C, 0x00000000 }, - { &GUID_Key, 14, 0x80000E0C, 0x00000000 }, - { &GUID_Key, 15, 0x80000F0C, 0x00000000 }, - { &GUID_Key, 16, 0x8000100C, 0x00000000 }, - { &GUID_Key, 17, 0x8000110C, 0x00000000 }, - { &GUID_Key, 18, 0x8000120C, 0x00000000 }, - { &GUID_Key, 19, 0x8000130C, 0x00000000 }, - { &GUID_Key, 20, 0x8000140C, 0x00000000 }, - { &GUID_Key, 21, 0x8000150C, 0x00000000 }, - { &GUID_Key, 22, 0x8000160C, 0x00000000 }, - { &GUID_Key, 23, 0x8000170C, 0x00000000 }, - { &GUID_Key, 24, 0x8000180C, 0x00000000 }, - { &GUID_Key, 25, 0x8000190C, 0x00000000 }, - { &GUID_Key, 26, 0x80001A0C, 0x00000000 }, - { &GUID_Key, 27, 0x80001B0C, 0x00000000 }, - { &GUID_Key, 28, 0x80001C0C, 0x00000000 }, - { &GUID_Key, 29, 0x80001D0C, 0x00000000 }, - { &GUID_Key, 30, 0x80001E0C, 0x00000000 }, - { &GUID_Key, 31, 0x80001F0C, 0x00000000 }, - { &GUID_Key, 32, 0x8000200C, 0x00000000 }, - { &GUID_Key, 33, 0x8000210C, 0x00000000 }, - { &GUID_Key, 34, 0x8000220C, 0x00000000 }, - { &GUID_Key, 35, 0x8000230C, 0x00000000 }, - { &GUID_Key, 36, 0x8000240C, 0x00000000 }, - { &GUID_Key, 37, 0x8000250C, 0x00000000 }, - { &GUID_Key, 38, 0x8000260C, 0x00000000 }, - { &GUID_Key, 39, 0x8000270C, 0x00000000 }, - { &GUID_Key, 40, 0x8000280C, 0x00000000 }, - { &GUID_Key, 41, 0x8000290C, 0x00000000 }, - { &GUID_Key, 42, 0x80002A0C, 0x00000000 }, - { &GUID_Key, 43, 0x80002B0C, 0x00000000 }, - { &GUID_Key, 44, 0x80002C0C, 0x00000000 }, - { &GUID_Key, 45, 0x80002D0C, 0x00000000 }, - { &GUID_Key, 46, 0x80002E0C, 0x00000000 }, - { &GUID_Key, 47, 0x80002F0C, 0x00000000 }, - { &GUID_Key, 48, 0x8000300C, 0x00000000 }, - { &GUID_Key, 49, 0x8000310C, 0x00000000 }, - { &GUID_Key, 50, 0x8000320C, 0x00000000 }, - { &GUID_Key, 51, 0x8000330C, 0x00000000 }, - { &GUID_Key, 52, 0x8000340C, 0x00000000 }, - { &GUID_Key, 53, 0x8000350C, 0x00000000 }, - { &GUID_Key, 54, 0x8000360C, 0x00000000 }, - { &GUID_Key, 55, 0x8000370C, 0x00000000 }, - { &GUID_Key, 56, 0x8000380C, 0x00000000 }, - { &GUID_Key, 57, 0x8000390C, 0x00000000 }, - { &GUID_Key, 58, 0x80003A0C, 0x00000000 }, - { &GUID_Key, 59, 0x80003B0C, 0x00000000 }, - { &GUID_Key, 60, 0x80003C0C, 0x00000000 }, - { &GUID_Key, 61, 0x80003D0C, 0x00000000 }, - { &GUID_Key, 62, 0x80003E0C, 0x00000000 }, - { &GUID_Key, 63, 0x80003F0C, 0x00000000 }, - { &GUID_Key, 64, 0x8000400C, 0x00000000 }, - { &GUID_Key, 65, 0x8000410C, 0x00000000 }, - { &GUID_Key, 66, 0x8000420C, 0x00000000 }, - { &GUID_Key, 67, 0x8000430C, 0x00000000 }, - { &GUID_Key, 68, 0x8000440C, 0x00000000 }, - { &GUID_Key, 69, 0x8000450C, 0x00000000 }, - { &GUID_Key, 70, 0x8000460C, 0x00000000 }, - { &GUID_Key, 71, 0x8000470C, 0x00000000 }, - { &GUID_Key, 72, 0x8000480C, 0x00000000 }, - { &GUID_Key, 73, 0x8000490C, 0x00000000 }, - { &GUID_Key, 74, 0x80004A0C, 0x00000000 }, - { &GUID_Key, 75, 0x80004B0C, 0x00000000 }, - { &GUID_Key, 76, 0x80004C0C, 0x00000000 }, - { &GUID_Key, 77, 0x80004D0C, 0x00000000 }, - { &GUID_Key, 78, 0x80004E0C, 0x00000000 }, - { &GUID_Key, 79, 0x80004F0C, 0x00000000 }, - { &GUID_Key, 80, 0x8000500C, 0x00000000 }, - { &GUID_Key, 81, 0x8000510C, 0x00000000 }, - { &GUID_Key, 82, 0x8000520C, 0x00000000 }, - { &GUID_Key, 83, 0x8000530C, 0x00000000 }, - { &GUID_Key, 84, 0x8000540C, 0x00000000 }, - { &GUID_Key, 85, 0x8000550C, 0x00000000 }, - { &GUID_Key, 86, 0x8000560C, 0x00000000 }, - { &GUID_Key, 87, 0x8000570C, 0x00000000 }, - { &GUID_Key, 88, 0x8000580C, 0x00000000 }, - { &GUID_Key, 89, 0x8000590C, 0x00000000 }, - { &GUID_Key, 90, 0x80005A0C, 0x00000000 }, - { &GUID_Key, 91, 0x80005B0C, 0x00000000 }, - { &GUID_Key, 92, 0x80005C0C, 0x00000000 }, - { &GUID_Key, 93, 0x80005D0C, 0x00000000 }, - { &GUID_Key, 94, 0x80005E0C, 0x00000000 }, - { &GUID_Key, 95, 0x80005F0C, 0x00000000 }, - { &GUID_Key, 96, 0x8000600C, 0x00000000 }, - { &GUID_Key, 97, 0x8000610C, 0x00000000 }, - { &GUID_Key, 98, 0x8000620C, 0x00000000 }, - { &GUID_Key, 99, 0x8000630C, 0x00000000 }, - { &GUID_Key, 100, 0x8000640C, 0x00000000 }, - { &GUID_Key, 101, 0x8000650C, 0x00000000 }, - { &GUID_Key, 102, 0x8000660C, 0x00000000 }, - { &GUID_Key, 103, 0x8000670C, 0x00000000 }, - { &GUID_Key, 104, 0x8000680C, 0x00000000 }, - { &GUID_Key, 105, 0x8000690C, 0x00000000 }, - { &GUID_Key, 106, 0x80006A0C, 0x00000000 }, - { &GUID_Key, 107, 0x80006B0C, 0x00000000 }, - { &GUID_Key, 108, 0x80006C0C, 0x00000000 }, - { &GUID_Key, 109, 0x80006D0C, 0x00000000 }, - { &GUID_Key, 110, 0x80006E0C, 0x00000000 }, - { &GUID_Key, 111, 0x80006F0C, 0x00000000 }, - { &GUID_Key, 112, 0x8000700C, 0x00000000 }, - { &GUID_Key, 113, 0x8000710C, 0x00000000 }, - { &GUID_Key, 114, 0x8000720C, 0x00000000 }, - { &GUID_Key, 115, 0x8000730C, 0x00000000 }, - { &GUID_Key, 116, 0x8000740C, 0x00000000 }, - { &GUID_Key, 117, 0x8000750C, 0x00000000 }, - { &GUID_Key, 118, 0x8000760C, 0x00000000 }, - { &GUID_Key, 119, 0x8000770C, 0x00000000 }, - { &GUID_Key, 120, 0x8000780C, 0x00000000 }, - { &GUID_Key, 121, 0x8000790C, 0x00000000 }, - { &GUID_Key, 122, 0x80007A0C, 0x00000000 }, - { &GUID_Key, 123, 0x80007B0C, 0x00000000 }, - { &GUID_Key, 124, 0x80007C0C, 0x00000000 }, - { &GUID_Key, 125, 0x80007D0C, 0x00000000 }, - { &GUID_Key, 126, 0x80007E0C, 0x00000000 }, - { &GUID_Key, 127, 0x80007F0C, 0x00000000 }, - { &GUID_Key, 128, 0x8000800C, 0x00000000 }, - { &GUID_Key, 129, 0x8000810C, 0x00000000 }, - { &GUID_Key, 130, 0x8000820C, 0x00000000 }, - { &GUID_Key, 131, 0x8000830C, 0x00000000 }, - { &GUID_Key, 132, 0x8000840C, 0x00000000 }, - { &GUID_Key, 133, 0x8000850C, 0x00000000 }, - { &GUID_Key, 134, 0x8000860C, 0x00000000 }, - { &GUID_Key, 135, 0x8000870C, 0x00000000 }, - { &GUID_Key, 136, 0x8000880C, 0x00000000 }, - { &GUID_Key, 137, 0x8000890C, 0x00000000 }, - { &GUID_Key, 138, 0x80008A0C, 0x00000000 }, - { &GUID_Key, 139, 0x80008B0C, 0x00000000 }, - { &GUID_Key, 140, 0x80008C0C, 0x00000000 }, - { &GUID_Key, 141, 0x80008D0C, 0x00000000 }, - { &GUID_Key, 142, 0x80008E0C, 0x00000000 }, - { &GUID_Key, 143, 0x80008F0C, 0x00000000 }, - { &GUID_Key, 144, 0x8000900C, 0x00000000 }, - { &GUID_Key, 145, 0x8000910C, 0x00000000 }, - { &GUID_Key, 146, 0x8000920C, 0x00000000 }, - { &GUID_Key, 147, 0x8000930C, 0x00000000 }, - { &GUID_Key, 148, 0x8000940C, 0x00000000 }, - { &GUID_Key, 149, 0x8000950C, 0x00000000 }, - { &GUID_Key, 150, 0x8000960C, 0x00000000 }, - { &GUID_Key, 151, 0x8000970C, 0x00000000 }, - { &GUID_Key, 152, 0x8000980C, 0x00000000 }, - { &GUID_Key, 153, 0x8000990C, 0x00000000 }, - { &GUID_Key, 154, 0x80009A0C, 0x00000000 }, - { &GUID_Key, 155, 0x80009B0C, 0x00000000 }, - { &GUID_Key, 156, 0x80009C0C, 0x00000000 }, - { &GUID_Key, 157, 0x80009D0C, 0x00000000 }, - { &GUID_Key, 158, 0x80009E0C, 0x00000000 }, - { &GUID_Key, 159, 0x80009F0C, 0x00000000 }, - { &GUID_Key, 160, 0x8000A00C, 0x00000000 }, - { &GUID_Key, 161, 0x8000A10C, 0x00000000 }, - { &GUID_Key, 162, 0x8000A20C, 0x00000000 }, - { &GUID_Key, 163, 0x8000A30C, 0x00000000 }, - { &GUID_Key, 164, 0x8000A40C, 0x00000000 }, - { &GUID_Key, 165, 0x8000A50C, 0x00000000 }, - { &GUID_Key, 166, 0x8000A60C, 0x00000000 }, - { &GUID_Key, 167, 0x8000A70C, 0x00000000 }, - { &GUID_Key, 168, 0x8000A80C, 0x00000000 }, - { &GUID_Key, 169, 0x8000A90C, 0x00000000 }, - { &GUID_Key, 170, 0x8000AA0C, 0x00000000 }, - { &GUID_Key, 171, 0x8000AB0C, 0x00000000 }, - { &GUID_Key, 172, 0x8000AC0C, 0x00000000 }, - { &GUID_Key, 173, 0x8000AD0C, 0x00000000 }, - { &GUID_Key, 174, 0x8000AE0C, 0x00000000 }, - { &GUID_Key, 175, 0x8000AF0C, 0x00000000 }, - { &GUID_Key, 176, 0x8000B00C, 0x00000000 }, - { &GUID_Key, 177, 0x8000B10C, 0x00000000 }, - { &GUID_Key, 178, 0x8000B20C, 0x00000000 }, - { &GUID_Key, 179, 0x8000B30C, 0x00000000 }, - { &GUID_Key, 180, 0x8000B40C, 0x00000000 }, - { &GUID_Key, 181, 0x8000B50C, 0x00000000 }, - { &GUID_Key, 182, 0x8000B60C, 0x00000000 }, - { &GUID_Key, 183, 0x8000B70C, 0x00000000 }, - { &GUID_Key, 184, 0x8000B80C, 0x00000000 }, - { &GUID_Key, 185, 0x8000B90C, 0x00000000 }, - { &GUID_Key, 186, 0x8000BA0C, 0x00000000 }, - { &GUID_Key, 187, 0x8000BB0C, 0x00000000 }, - { &GUID_Key, 188, 0x8000BC0C, 0x00000000 }, - { &GUID_Key, 189, 0x8000BD0C, 0x00000000 }, - { &GUID_Key, 190, 0x8000BE0C, 0x00000000 }, - { &GUID_Key, 191, 0x8000BF0C, 0x00000000 }, - { &GUID_Key, 192, 0x8000C00C, 0x00000000 }, - { &GUID_Key, 193, 0x8000C10C, 0x00000000 }, - { &GUID_Key, 194, 0x8000C20C, 0x00000000 }, - { &GUID_Key, 195, 0x8000C30C, 0x00000000 }, - { &GUID_Key, 196, 0x8000C40C, 0x00000000 }, - { &GUID_Key, 197, 0x8000C50C, 0x00000000 }, - { &GUID_Key, 198, 0x8000C60C, 0x00000000 }, - { &GUID_Key, 199, 0x8000C70C, 0x00000000 }, - { &GUID_Key, 200, 0x8000C80C, 0x00000000 }, - { &GUID_Key, 201, 0x8000C90C, 0x00000000 }, - { &GUID_Key, 202, 0x8000CA0C, 0x00000000 }, - { &GUID_Key, 203, 0x8000CB0C, 0x00000000 }, - { &GUID_Key, 204, 0x8000CC0C, 0x00000000 }, - { &GUID_Key, 205, 0x8000CD0C, 0x00000000 }, - { &GUID_Key, 206, 0x8000CE0C, 0x00000000 }, - { &GUID_Key, 207, 0x8000CF0C, 0x00000000 }, - { &GUID_Key, 208, 0x8000D00C, 0x00000000 }, - { &GUID_Key, 209, 0x8000D10C, 0x00000000 }, - { &GUID_Key, 210, 0x8000D20C, 0x00000000 }, - { &GUID_Key, 211, 0x8000D30C, 0x00000000 }, - { &GUID_Key, 212, 0x8000D40C, 0x00000000 }, - { &GUID_Key, 213, 0x8000D50C, 0x00000000 }, - { &GUID_Key, 214, 0x8000D60C, 0x00000000 }, - { &GUID_Key, 215, 0x8000D70C, 0x00000000 }, - { &GUID_Key, 216, 0x8000D80C, 0x00000000 }, - { &GUID_Key, 217, 0x8000D90C, 0x00000000 }, - { &GUID_Key, 218, 0x8000DA0C, 0x00000000 }, - { &GUID_Key, 219, 0x8000DB0C, 0x00000000 }, - { &GUID_Key, 220, 0x8000DC0C, 0x00000000 }, - { &GUID_Key, 221, 0x8000DD0C, 0x00000000 }, - { &GUID_Key, 222, 0x8000DE0C, 0x00000000 }, - { &GUID_Key, 223, 0x8000DF0C, 0x00000000 }, - { &GUID_Key, 224, 0x8000E00C, 0x00000000 }, - { &GUID_Key, 225, 0x8000E10C, 0x00000000 }, - { &GUID_Key, 226, 0x8000E20C, 0x00000000 }, - { &GUID_Key, 227, 0x8000E30C, 0x00000000 }, - { &GUID_Key, 228, 0x8000E40C, 0x00000000 }, - { &GUID_Key, 229, 0x8000E50C, 0x00000000 }, - { &GUID_Key, 230, 0x8000E60C, 0x00000000 }, - { &GUID_Key, 231, 0x8000E70C, 0x00000000 }, - { &GUID_Key, 232, 0x8000E80C, 0x00000000 }, - { &GUID_Key, 233, 0x8000E90C, 0x00000000 }, - { &GUID_Key, 234, 0x8000EA0C, 0x00000000 }, - { &GUID_Key, 235, 0x8000EB0C, 0x00000000 }, - { &GUID_Key, 236, 0x8000EC0C, 0x00000000 }, - { &GUID_Key, 237, 0x8000ED0C, 0x00000000 }, - { &GUID_Key, 238, 0x8000EE0C, 0x00000000 }, - { &GUID_Key, 239, 0x8000EF0C, 0x00000000 }, - { &GUID_Key, 240, 0x8000F00C, 0x00000000 }, - { &GUID_Key, 241, 0x8000F10C, 0x00000000 }, - { &GUID_Key, 242, 0x8000F20C, 0x00000000 }, - { &GUID_Key, 243, 0x8000F30C, 0x00000000 }, - { &GUID_Key, 244, 0x8000F40C, 0x00000000 }, - { &GUID_Key, 245, 0x8000F50C, 0x00000000 }, - { &GUID_Key, 246, 0x8000F60C, 0x00000000 }, - { &GUID_Key, 247, 0x8000F70C, 0x00000000 }, - { &GUID_Key, 248, 0x8000F80C, 0x00000000 }, - { &GUID_Key, 249, 0x8000F90C, 0x00000000 }, - { &GUID_Key, 250, 0x8000FA0C, 0x00000000 }, - { &GUID_Key, 251, 0x8000FB0C, 0x00000000 }, - { &GUID_Key, 252, 0x8000FC0C, 0x00000000 }, - { &GUID_Key, 253, 0x8000FD0C, 0x00000000 }, - { &GUID_Key, 254, 0x8000FE0C, 0x00000000 }, - { &GUID_Key, 255, 0x8000FF0C, 0x00000000 }, -}; - -const DIDATAFORMAT c_dfDIKeyboard = { 24, 16, 0x00000002, 256, 256, KBD_fmt }; - - -/* Mouse */ - -static DIOBJECTDATAFORMAT PTR_fmt[] = { - { &GUID_XAxis, 0, 0x00FFFF03, 0x00000000 }, - { &GUID_YAxis, 4, 0x00FFFF03, 0x00000000 }, - { &GUID_ZAxis, 8, 0x80FFFF03, 0x00000000 }, - { NULL, 12, 0x00FFFF0C, 0x00000000 }, - { NULL, 13, 0x00FFFF0C, 0x00000000 }, - { NULL, 14, 0x80FFFF0C, 0x00000000 }, - { NULL, 15, 0x80FFFF0C, 0x00000000 }, -}; - -const DIDATAFORMAT c_dfDIMouse = { 24, 16, 0x00000002, 16, 7, PTR_fmt }; - - -/* Joystick */ - -static DIOBJECTDATAFORMAT JOY_fmt[] = { - { &GUID_XAxis, 0, 0x80FFFF03, 0x00000100 }, - { &GUID_YAxis, 4, 0x80FFFF03, 0x00000100 }, - { &GUID_ZAxis, 8, 0x80FFFF03, 0x00000100 }, - { &GUID_RxAxis, 12, 0x80FFFF03, 0x00000100 }, - { &GUID_RyAxis, 16, 0x80FFFF03, 0x00000100 }, - { &GUID_RzAxis, 20, 0x80FFFF03, 0x00000100 }, - { &GUID_Slider, 24, 0x80FFFF03, 0x00000100 }, - { &GUID_Slider, 28, 0x80FFFF03, 0x00000100 }, - { &GUID_POV, 32, 0x80FFFF10, 0x00000000 }, - { &GUID_POV, 36, 0x80FFFF10, 0x00000000 }, - { &GUID_POV, 40, 0x80FFFF10, 0x00000000 }, - { &GUID_POV, 44, 0x80FFFF10, 0x00000000 }, - { NULL, 48, 0x80FFFF0C, 0x00000000 }, - { NULL, 49, 0x80FFFF0C, 0x00000000 }, - { NULL, 50, 0x80FFFF0C, 0x00000000 }, - { NULL, 51, 0x80FFFF0C, 0x00000000 }, - { NULL, 52, 0x80FFFF0C, 0x00000000 }, - { NULL, 53, 0x80FFFF0C, 0x00000000 }, - { NULL, 54, 0x80FFFF0C, 0x00000000 }, - { NULL, 55, 0x80FFFF0C, 0x00000000 }, - { NULL, 56, 0x80FFFF0C, 0x00000000 }, - { NULL, 57, 0x80FFFF0C, 0x00000000 }, - { NULL, 58, 0x80FFFF0C, 0x00000000 }, - { NULL, 59, 0x80FFFF0C, 0x00000000 }, - { NULL, 60, 0x80FFFF0C, 0x00000000 }, - { NULL, 61, 0x80FFFF0C, 0x00000000 }, - { NULL, 62, 0x80FFFF0C, 0x00000000 }, - { NULL, 63, 0x80FFFF0C, 0x00000000 }, - { NULL, 64, 0x80FFFF0C, 0x00000000 }, - { NULL, 65, 0x80FFFF0C, 0x00000000 }, - { NULL, 66, 0x80FFFF0C, 0x00000000 }, - { NULL, 67, 0x80FFFF0C, 0x00000000 }, - { NULL, 68, 0x80FFFF0C, 0x00000000 }, - { NULL, 69, 0x80FFFF0C, 0x00000000 }, - { NULL, 70, 0x80FFFF0C, 0x00000000 }, - { NULL, 71, 0x80FFFF0C, 0x00000000 }, - { NULL, 72, 0x80FFFF0C, 0x00000000 }, - { NULL, 73, 0x80FFFF0C, 0x00000000 }, - { NULL, 74, 0x80FFFF0C, 0x00000000 }, - { NULL, 75, 0x80FFFF0C, 0x00000000 }, - { NULL, 76, 0x80FFFF0C, 0x00000000 }, - { NULL, 77, 0x80FFFF0C, 0x00000000 }, - { NULL, 78, 0x80FFFF0C, 0x00000000 }, - { NULL, 79, 0x80FFFF0C, 0x00000000 }, -}; - -const DIDATAFORMAT c_dfDIJoystick = { 24, 16, 0x00000001, 80, 44, JOY_fmt }; - - /* Initialization/Query functions */ static int DX5_VideoInit(_THIS, SDL_PixelFormat *vformat); static SDL_Rect **DX5_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);