Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Removed Windows CE support from SDL 2.0.
Browse files Browse the repository at this point in the history
It's a long-dead platform, and we don't have any way to build for, test, or
maintain it, so there's no sense in doing acrobatics to support it.

If you need Windows CE support, use SDL 1.2. If you need Windows Phone support,
send SDL 2.0 patches for the newer Windows Mobile platform.
  • Loading branch information
icculus committed Sep 15, 2012
1 parent 4dd2897 commit b4a41b6
Show file tree
Hide file tree
Showing 34 changed files with 22 additions and 848 deletions.
56 changes: 5 additions & 51 deletions README.WinCE
@@ -1,55 +1,9 @@

Project files for embedded Visual C++ 3.0, 4.0 and
Visual Studio 2005 can be found in VisualCE.zip
Windows CE is no longer supported by SDL.

SDL supports GAPI and WinDib output for Windows CE.
We have left the CE support in SDL 1.2 for those that must have it, and we
will accept patches that support more modern Windows Mobile platforms for
SDL 2.0.

GAPI driver supports:
--ryan.

- all possible WinCE devices (Pocket PC, Smartphones, HPC)
with different orientations of video memory and resolutions.
- 4, 8 and 16 bpp devices
- special handling of 8bpp on 8bpp devices
- VGA mode, you can even switch between VGA and GAPI in runtime
(between 240x320 and 480x640 for example). On VGA devices you can
use either GAPI or VGA.
- Landscape mode and automatic rotation of buttons and stylus coordinates.
To enable landscape mode make width of video screen bigger than height.
For example:
SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN)
- WM2005
- SDL_ListModes

NOTE:
There are several SDL features not available in the WinCE port of SDL.

- DirectX is not yet available
- Semaphores are not available
- Joystick support is not available
- CD-ROM control is not available

In addition, there are several features that run in "degraded" mode:

Preprocessor Symbol Effect
=================== =================================

SDL_systimer.c:
USE_GETTICKCOUNT Less accurate values for SDL time functions
USE_SETTIMER Use only a single marginally accurate timer

SDL_syswm.c:
DISABLE_ICON_SUPPORT Can't set the runtime window icon

SDL_sysmouse.c:
USE_STATIC_CURSOR Only the arrow cursor is available

SDL_sysevents.c:
NO_GETKEYBOARDSTATE Can't get modifier state on keyboard focus

SDL_dibevents.c:
NO_GETKEYBOARDSTATE Very limited keycode translation

SDL_dibvideo.c:
NO_GETDIBITS Can't distinguish between 15 bpp and 16 bpp
NO_CHANGEDISPLAYSETTINGS No fullscreen support
NO_GAMMA_SUPPORT Gamma correction not available
78 changes: 2 additions & 76 deletions configure.in
Expand Up @@ -1908,6 +1908,8 @@ CheckWINDOWS()
],[
],[
have_wince=yes
AC_MSG_ERROR([
*** Sorry, Windows CE is no longer supported.
])
AC_MSG_RESULT($have_wince)

Expand Down Expand Up @@ -2239,82 +2241,6 @@ case "$host" in
have_timers=yes
fi
;;
*-wince* | *-mingw32ce)
ARCH=win32
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
CheckWINDOWS
if test x$enable_video = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
have_video=yes
AC_ARG_ENABLE(render-d3d,
AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
, enable_render_d3d=yes)
enable_render_d3d=no
if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
fi
fi
# Set up files for the audio library
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
if test x$have_dsound = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
fi
if test x$have_xaudio2 = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
fi
have_audio=yes
fi
# Set up dummy files for the joystick for now
if test x$enable_joystick = xyes; then
AC_DEFINE(SDL_JOYSTICK_DUMMY, 1, [ ])
SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
have_joystick=yes
fi
# Set up files for the thread library
if test x$enable_threads = xyes; then
AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_sysmutex.c"
SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_syssem.c"
SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_systhread.c"
SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
have_threads=yes
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then
AC_DEFINE(SDL_TIMER_WINCE, 1, [ ])
SOURCES="$SOURCES $srcdir/src/timer/wince/*.c"
have_timers=yes
fi
# Set up files for the shared object loading library
if test x$enable_loadso = xyes; then
AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
have_loadso=yes
fi
# Set up the system libraries we need
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl -lmmtimer"

# mingw32ce library
case "$host" in
*-mingw32ce)
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmingwex"
;;
*)
;;
esac

# The Windows platform requires special setup
SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
EXTRA_LDFLAGS="-lSDL2main $EXTRA_LDFLAGS"
;;
*-*-cygwin* | *-*-mingw32*)
ARCH=win32
if test "$build" != "$host"; then # cross-compiling
Expand Down
4 changes: 2 additions & 2 deletions include/SDL_assert.h
Expand Up @@ -49,9 +49,9 @@ on the assertion line and not in some random guts of SDL, and so each
assert can have unique static variables associated with it.
*/

#if defined(_MSC_VER) && !defined(_WIN32_WCE)
#if defined(_MSC_VER)
/* Don't include intrin.h here because it contains C++ code */
extern void __cdecl __debugbreak(void);
extern void __cdecl __debugbreak(void);
#define SDL_TriggerBreakpoint() __debugbreak()
#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_atomic.h
Expand Up @@ -65,7 +65,7 @@

/* Need to do this here because intrin.h has C++ code in it */
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(_WIN32_WCE)
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
#include <intrin.h>
#define HAVE_MSC_ATOMICS 1
#endif
Expand Down
1 change: 0 additions & 1 deletion include/SDL_config.h.in
Expand Up @@ -242,7 +242,6 @@
#undef SDL_TIMER_NDS
#undef SDL_TIMER_UNIX
#undef SDL_TIMER_WINDOWS
#undef SDL_TIMER_WINCE

/* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_BWINDOW
Expand Down
17 changes: 0 additions & 17 deletions include/SDL_config_windows.h
Expand Up @@ -85,9 +85,7 @@ typedef unsigned int uintptr_t;
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
#define HAVE_MATH_H 1
#ifndef _WIN32_WCE
#define HAVE_SIGNAL_H 1
#endif

/* C library functions */
#define HAVE_MALLOC 1
Expand Down Expand Up @@ -143,22 +141,15 @@ typedef unsigned int uintptr_t;
#endif

/* Enable various audio drivers */
#ifndef _WIN32_WCE
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_XAUDIO2 1
#endif
#define SDL_AUDIO_DRIVER_WINMM 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1

/* Enable various input drivers */
#ifdef _WIN32_WCE
#define SDL_JOYSTICK_DISABLED 1
#define SDL_HAPTIC_DUMMY 1
#else
#define SDL_JOYSTICK_DINPUT 1
#define SDL_HAPTIC_DINPUT 1
#endif

/* Enable various shared object loading systems */
#define SDL_LOADSO_WINDOWS 1
Expand All @@ -167,24 +158,17 @@ typedef unsigned int uintptr_t;
#define SDL_THREAD_WINDOWS 1

/* Enable various timer systems */
#ifdef _WIN32_WCE
#define SDL_TIMER_WINCE 1
#else
#define SDL_TIMER_WINDOWS 1
#endif

/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_WINDOWS 1

#ifndef _WIN32_WCE
#ifndef SDL_VIDEO_RENDER_D3D
#define SDL_VIDEO_RENDER_D3D 1
#endif
#endif

/* Enable OpenGL support */
#ifndef _WIN32_WCE
#ifndef SDL_VIDEO_OPENGL
#define SDL_VIDEO_OPENGL 1
#endif
Expand All @@ -194,7 +178,6 @@ typedef unsigned int uintptr_t;
#ifndef SDL_VIDEO_RENDER_OGL
#define SDL_VIDEO_RENDER_OGL 1
#endif
#endif

/* Enable system power support */
#define SDL_POWER_WINDOWS 1
Expand Down
2 changes: 1 addition & 1 deletion include/SDL_cpuinfo.h
Expand Up @@ -32,7 +32,7 @@

/* Need to do this here because intrin.h has C++ code in it */
/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
#if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(_WIN32_WCE)
#if defined(_MSC_VER) && (_MSC_VER >= 1500)
#include <intrin.h>
#ifndef _WIN64
#define __MMX__
Expand Down
12 changes: 0 additions & 12 deletions include/SDL_thread.h
Expand Up @@ -86,9 +86,7 @@ typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
* library!
*/
#define SDL_PASSED_BEGINTHREAD_ENDTHREAD
#ifndef _WIN32_WCE
#include <process.h> /* This has _beginthread() and _endthread() defined! */
#endif

typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
unsigned (__stdcall *
Expand All @@ -106,21 +104,11 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
pfnSDL_CurrentBeginThread pfnBeginThread,
pfnSDL_CurrentEndThread pfnEndThread);

#if defined(_WIN32_WCE)

/**
* Create a thread.
*/
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, NULL, NULL)

#else

/**
* Create a thread.
*/
#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, _beginthreadex, _endthreadex)

#endif
#else

/**
Expand Down
4 changes: 0 additions & 4 deletions src/SDL.c
Expand Up @@ -288,11 +288,7 @@ SDL_GetPlatform()
#elif __SOLARIS__
return "Solaris";
#elif __WIN32__
#ifdef _WIN32_WCE
return "Windows CE";
#else
return "Windows";
#endif
#elif __IPHONEOS__
return "iPhone OS";
#else
Expand Down
2 changes: 1 addition & 1 deletion src/audio/SDL_audio.c
Expand Up @@ -1028,7 +1028,7 @@ open_audio_device(const char *devname, int iscapture,
char name[64];
SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) (id + 1));
/* !!! FIXME: this is nasty. */
#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
#if defined(__WIN32__) && !defined(HAVE_LIBC)
#undef SDL_CreateThread
device->thread = SDL_CreateThread(SDL_RunAudio, name, device, NULL, NULL);
#else
Expand Down
23 changes: 0 additions & 23 deletions src/audio/winmm/SDL_winmm.c
Expand Up @@ -31,9 +31,6 @@
#include "SDL_audio.h"
#include "../SDL_audio_c.h"
#include "SDL_winmm.h"
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
#include "win_ce_semaphore.h"
#endif

#define DETECT_DEV_IMPL(typ, capstyp) \
static void DetectWave##typ##Devs(SDL_AddAudioDevice addfn) { \
Expand Down Expand Up @@ -75,11 +72,7 @@ CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance,
return;

/* Signal that we have a new buffer of data */
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
ReleaseSemaphoreCE(this->hidden->audio_sem, 1, NULL);
#else
ReleaseSemaphore(this->hidden->audio_sem, 1, NULL);
#endif
}


Expand All @@ -95,11 +88,7 @@ FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
return;

/* Signal that we are done playing a buffer */
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
ReleaseSemaphoreCE(this->hidden->audio_sem, 1, NULL);
#else
ReleaseSemaphore(this->hidden->audio_sem, 1, NULL);
#endif
}

static void
Expand All @@ -123,11 +112,7 @@ static void
WINMM_WaitDevice(_THIS)
{
/* Wait for an audio chunk to finish */
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
WaitForSemaphoreCE(this->hidden->audio_sem, INFINITE);
#else
WaitForSingleObject(this->hidden->audio_sem, INFINITE);
#endif
}

static Uint8 *
Expand Down Expand Up @@ -173,11 +158,7 @@ WINMM_CloseDevice(_THIS)
int i;

if (this->hidden->audio_sem) {
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
CloseSynchHandle(this->hidden->audio_sem);
#else
CloseHandle(this->hidden->audio_sem);
#endif
this->hidden->audio_sem = 0;
}

Expand Down Expand Up @@ -349,11 +330,7 @@ WINMM_OpenDevice(_THIS, const char *devname, int iscapture)

/* Create the audio buffer semaphore */
this->hidden->audio_sem =
#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
CreateSemaphoreCE(NULL, NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
#else
CreateSemaphore(NULL, NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
#endif
if (this->hidden->audio_sem == NULL) {
WINMM_CloseDevice(this);
SDL_SetError("Couldn't create semaphore");
Expand Down

0 comments on commit b4a41b6

Please sign in to comment.