Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
authorRyan C. Gordon <icculus@icculus.org>
Thu, 29 Sep 2005 09:43:00 +0000
changeset 115251a8702d8ecd
parent 1151 be9c9c8f6d53
child 1153 5bc98ce985c2
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
activekitten.com.
VisualCE.zip
src/SDL_fatal.c
src/SDL_loadso.c
src/cdrom/dummy/SDL_syscdrom.c
src/cpuinfo/SDL_cpuinfo.c
src/events/SDL_quit.c
src/joystick/dummy/SDL_sysjoystick.c
src/video/wincommon/SDL_sysevents.c
src/video/wincommon/SDL_syswm.c
src/video/windib/SDL_dibevents.c
src/video/windib/SDL_dibvideo.c
test/testalpha.c
test/testwin.c
     1.1 Binary file VisualCE.zip has changed
     2.1 --- a/src/SDL_fatal.c	Wed Sep 28 11:36:20 2005 +0000
     2.2 +++ b/src/SDL_fatal.c	Thu Sep 29 09:43:00 2005 +0000
     2.3 @@ -25,6 +25,10 @@
     2.4   "@(#) $Id$";
     2.5  #endif
     2.6  
     2.7 +#ifdef _WIN32_WCE
     2.8 +#define NO_SIGNAL_H
     2.9 +#endif
    2.10 + 
    2.11  /* General fatal signal handling code for SDL */
    2.12  
    2.13  #ifdef NO_SIGNAL_H
     3.1 --- a/src/SDL_loadso.c	Wed Sep 28 11:36:20 2005 +0000
     3.2 +++ b/src/SDL_loadso.c	Thu Sep 29 09:43:00 2005 +0000
     3.3 @@ -31,7 +31,7 @@
     3.4  #include <stdio.h>
     3.5  #if defined(USE_DLOPEN)
     3.6  # include <dlfcn.h>
     3.7 -#elif defined(WIN32)
     3.8 +#elif defined(WIN32) || defined(_WIN32_WCE)
     3.9  # include <windows.h>
    3.10  #elif defined(__BEOS__)
    3.11  # include <be/kernel/image.h>
    3.12 @@ -60,6 +60,30 @@
    3.13  /* * */
    3.14  	handle = dlopen(sofile, RTLD_NOW);
    3.15  	loaderror = (char *)dlerror();
    3.16 +#elif defined(_WIN32_WCE)
    3.17 +/* * */
    3.18 +	char errbuf[512];
    3.19 +
    3.20 +	wchar_t *errbuf_t = malloc(512 * sizeof(wchar_t));
    3.21 +	wchar_t *sofile_t = malloc((MAX_PATH+1) * sizeof(wchar_t));
    3.22 +
    3.23 +	MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, sofile, -1, sofile_t, MAX_PATH);
    3.24 +	handle = (void *)LoadLibrary(sofile_t);
    3.25 +
    3.26 +	/* Generate an error message if all loads failed */
    3.27 +	if ( handle == NULL ) {
    3.28 +		FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
    3.29 +					FORMAT_MESSAGE_FROM_SYSTEM),
    3.30 +				NULL, GetLastError(), 
    3.31 +				MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    3.32 +				errbuf_t, SDL_TABLESIZE(errbuf), NULL);
    3.33 +		WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
    3.34 +		loaderror = errbuf;
    3.35 +	}
    3.36 +
    3.37 +	free(sofile_t);
    3.38 +	free(errbuf_t);
    3.39 +
    3.40  #elif defined(WIN32)
    3.41  /* * */
    3.42  	char errbuf[512];
    3.43 @@ -139,6 +163,30 @@
    3.44  	if ( symbol == NULL ) {
    3.45  		loaderror = (char *)dlerror();
    3.46  	}
    3.47 +#elif defined(_WIN32_WCE)
    3.48 +/* * */
    3.49 +	char errbuf[512];
    3.50 +	int length = strlen(name);
    3.51 +
    3.52 +	wchar_t *name_t = malloc((length + 1) * sizeof(wchar_t));
    3.53 +	wchar_t *errbuf_t = malloc(512 * sizeof(wchar_t));
    3.54 +
    3.55 +	MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length);
    3.56 +
    3.57 +	symbol = (void *)GetProcAddress((HMODULE)handle, name_t);
    3.58 +	if ( symbol == NULL ) {
    3.59 +		FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
    3.60 +					FORMAT_MESSAGE_FROM_SYSTEM),
    3.61 +				NULL, GetLastError(), 
    3.62 +				MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    3.63 +				errbuf_t, SDL_TABLESIZE(errbuf), NULL);
    3.64 +		WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
    3.65 +		loaderror = errbuf;
    3.66 +	}
    3.67 +
    3.68 +	free(name_t);
    3.69 +	free(errbuf_t);
    3.70 +
    3.71  #elif defined(WIN32)
    3.72  /* * */
    3.73  	char errbuf[512];
     4.1 --- a/src/cdrom/dummy/SDL_syscdrom.c	Wed Sep 28 11:36:20 2005 +0000
     4.2 +++ b/src/cdrom/dummy/SDL_syscdrom.c	Thu Sep 29 09:43:00 2005 +0000
     4.3 @@ -40,3 +40,7 @@
     4.4  	return;
     4.5  }
     4.6  
     4.7 +int SDL_CDROMInit(void)
     4.8 +{
     4.9 +	return 0;
    4.10 +}
    4.11 \ No newline at end of file
     5.1 --- a/src/cpuinfo/SDL_cpuinfo.c	Wed Sep 28 11:36:20 2005 +0000
     5.2 +++ b/src/cpuinfo/SDL_cpuinfo.c	Thu Sep 29 09:43:00 2005 +0000
     5.3 @@ -101,7 +101,7 @@
     5.4  	:
     5.5  	: "%rax", "%rcx"
     5.6  	);
     5.7 -#elif defined(_MSC_VER)
     5.8 +#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_X86_))
     5.9  	__asm {
    5.10          pushfd                      ; Get original EFLAGS
    5.11          pop     eax
    5.12 @@ -140,7 +140,7 @@
    5.13  	:
    5.14  	: "%eax", "%ecx", "%edx", "%edi"
    5.15  	);
    5.16 -#elif defined(_MSC_VER)
    5.17 +#elif defined(_MSC_VER)  && (defined(_M_IX86) || defined(_X86_))
    5.18  	__asm {
    5.19          xor     eax, eax            ; Set up for CPUID instruction
    5.20          cpuid                       ; Get and save vendor ID
    5.21 @@ -175,7 +175,7 @@
    5.22  	:
    5.23  	: "%eax", "%ecx", "%edx", "%edi"
    5.24  	);
    5.25 -#elif defined(_MSC_VER)
    5.26 +#elif defined(_MSC_VER)  && (defined(_M_IX86) || defined(_X86_))
    5.27  	__asm {
    5.28          mov     eax,80000000h       ; Query for extended functions
    5.29          cpuid                       ; Get extended function limit
     6.1 --- a/src/events/SDL_quit.c	Wed Sep 28 11:36:20 2005 +0000
     6.2 +++ b/src/events/SDL_quit.c	Thu Sep 29 09:43:00 2005 +0000
     6.3 @@ -27,6 +27,10 @@
     6.4  
     6.5  /* General quit handling code for SDL */
     6.6  
     6.7 +#if defined (_WIN32_WCE)
     6.8 +#define NO_SIGNAL_H
     6.9 +#endif
    6.10 +
    6.11  #include <stdio.h>
    6.12  #ifndef NO_SIGNAL_H
    6.13  #include <signal.h>
     7.1 --- a/src/joystick/dummy/SDL_sysjoystick.c	Wed Sep 28 11:36:20 2005 +0000
     7.2 +++ b/src/joystick/dummy/SDL_sysjoystick.c	Thu Sep 29 09:43:00 2005 +0000
     7.3 @@ -34,6 +34,8 @@
     7.4  #include "SDL_sysjoystick.h"
     7.5  #include "SDL_joystick_c.h"
     7.6  
     7.7 +Uint8 SDL_numjoysticks = 0;
     7.8 +
     7.9  /* Function to scan the system for joysticks.
    7.10   * This function should set SDL_numjoysticks to the number of available
    7.11   * joysticks.  Joystick 0 should be the system default joystick.
     8.1 --- a/src/video/wincommon/SDL_sysevents.c	Wed Sep 28 11:36:20 2005 +0000
     8.2 +++ b/src/video/wincommon/SDL_sysevents.c	Thu Sep 29 09:43:00 2005 +0000
     8.3 @@ -40,6 +40,7 @@
     8.4  #include "SDL_lowvideo.h"
     8.5  #include "SDL_syswm_c.h"
     8.6  #include "SDL_main.h"
     8.7 +#include "SDL_loadso.h"
     8.8  
     8.9  #ifdef WMMSG_DEBUG
    8.10  #include "wmmsg.h"
    8.11 @@ -71,13 +72,37 @@
    8.12  
    8.13  
    8.14  /* Functions called by the message processing function */
    8.15 -LONG
    8.16 -(*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL;
    8.17 +LONG (*HandleMessage)(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)=NULL;
    8.18  void (*WIN_RealizePalette)(_THIS);
    8.19  void (*WIN_PaletteChanged)(_THIS, HWND window);
    8.20  void (*WIN_WinPAINT)(_THIS, HDC hdc);
    8.21  extern void DIB_SwapGamma(_THIS);
    8.22  
    8.23 +#if defined(_WIN32_WCE)
    8.24 +
    8.25 +// dynamically load aygshell dll because we want SDL to work on HPC and be300
    8.26 +HINSTANCE aygshell = NULL;
    8.27 +BOOL (WINAPI *SHFullScreen)(HWND hwndRequester, DWORD dwState) = 0;
    8.28 +
    8.29 +#define SHFS_SHOWTASKBAR            0x0001
    8.30 +#define SHFS_HIDETASKBAR            0x0002
    8.31 +#define SHFS_SHOWSIPBUTTON          0x0004
    8.32 +#define SHFS_HIDESIPBUTTON          0x0008
    8.33 +#define SHFS_SHOWSTARTICON          0x0010
    8.34 +#define SHFS_HIDESTARTICON          0x0020
    8.35 +
    8.36 +static void LoadAygshell(void)
    8.37 +{
    8.38 +	if( !aygshell )
    8.39 +		 aygshell = SDL_LoadObject("aygshell.dll");
    8.40 +	if( aygshell )
    8.41 +	{
    8.42 +		SHFullScreen = (int (WINAPI *)(struct HWND__ *,unsigned long)) SDL_LoadFunction(aygshell, "SHFullScreen");
    8.43 +	}
    8.44 +}
    8.45 +
    8.46 +#endif
    8.47 +
    8.48  static void SDL_RestoreGameMode(void)
    8.49  {
    8.50  #ifndef NO_CHANGEDISPLAYSETTINGS
    8.51 @@ -213,6 +238,18 @@
    8.52  						SDL_RestoreGameMode();
    8.53  					}
    8.54  				}
    8.55 +#if defined(_WIN32_WCE)
    8.56 +			if ( WINDIB_FULLSCREEN() )
    8.57 +			{
    8.58 +						LoadAygshell();
    8.59 +						if( aygshell ) 
    8.60 +							SHFullScreen(SDL_Window, SHFS_HIDESTARTICON|SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON);
    8.61 +						else
    8.62 +							ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE);
    8.63 +
    8.64 +			}
    8.65 +#endif
    8.66 +
    8.67  				posted = SDL_PrivateAppActive(1, appstate);
    8.68  				WIN_GetKeyboardState();
    8.69  			} else {
    8.70 @@ -230,6 +267,14 @@
    8.71  					}
    8.72  					if ( WINDIB_FULLSCREEN() ) {
    8.73  						SDL_RestoreDesktopMode();
    8.74 +#if defined(_WIN32_WCE)
    8.75 +						LoadAygshell();
    8.76 +						if( aygshell ) 
    8.77 +							SHFullScreen(SDL_Window, SHFS_SHOWSTARTICON|SHFS_SHOWTASKBAR|SHFS_SHOWSIPBUTTON);
    8.78 +						else
    8.79 +							ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOW);
    8.80 +
    8.81 +#endif
    8.82  					}
    8.83  				}
    8.84  				posted = SDL_PrivateAppActive(0, appstate);
     9.1 --- a/src/video/wincommon/SDL_syswm.c	Wed Sep 28 11:36:20 2005 +0000
     9.2 +++ b/src/video/wincommon/SDL_syswm.c	Thu Sep 29 09:43:00 2005 +0000
     9.3 @@ -36,6 +36,8 @@
     9.4  #include "SDL_syswm_c.h"
     9.5  #include "SDL_wingl_c.h"
     9.6  #include "SDL_pixels_c.h"
     9.7 +#include "SDL_loadso.h"
     9.8 +
     9.9  
    9.10  #ifdef _WIN32_WCE
    9.11  #define DISABLE_ICON_SUPPORT
    9.12 @@ -48,6 +50,25 @@
    9.13  /* The screen icon -- needs to be freed on SDL_VideoQuit() */
    9.14  HICON   screen_icn = NULL;
    9.15  
    9.16 +#ifdef _WIN32_WCE
    9.17 +
    9.18 +BOOL (WINAPI *CoreCatchInput)(int flag) = NULL;
    9.19 +int input_catched = 0;
    9.20 +HINSTANCE coredll = NULL;
    9.21 +
    9.22 +// the same API call that gx.dll does to catch the input
    9.23 +void LoadInputCatchFunc()
    9.24 +{
    9.25 +	coredll = SDL_LoadObject("coredll.dll");
    9.26 +	if( coredll )
    9.27 +	{
    9.28 +		CoreCatchInput = (int (WINAPI *)(int)) GetProcAddress(coredll, (const unsigned short *) 1453);
    9.29 +	}
    9.30 +}
    9.31 +
    9.32 +#endif
    9.33 +
    9.34 +
    9.35  /* Win32 icon mask semantics are different from those of SDL:
    9.36       SDL applies the mask to the icon and copies result to desktop.
    9.37       Win32 applies the mask to the desktop and XORs the icon on.
    9.38 @@ -245,6 +266,15 @@
    9.39  			ClientToScreen(SDL_Window, &pt);
    9.40  			SetCursorPos(pt.x,pt.y);
    9.41  		}
    9.42 +#ifdef _WIN32_WCE
    9.43 +		if( input_catched )
    9.44 +		{
    9.45 +			if( !CoreCatchInput ) LoadInputCatchFunc();
    9.46 +
    9.47 +			if( CoreCatchInput )
    9.48 +				CoreCatchInput(0);
    9.49 +		}
    9.50 +#endif
    9.51  	} else {
    9.52  		ClipCursor(&SDL_bounds);
    9.53  		if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
    9.54 @@ -257,6 +287,15 @@
    9.55  			ClientToScreen(SDL_Window, &pt);
    9.56  			SetCursorPos(pt.x, pt.y);
    9.57  		}
    9.58 +#ifdef _WIN32_WCE
    9.59 +		if( !input_catched )
    9.60 +		{
    9.61 +			if( !CoreCatchInput ) LoadInputCatchFunc();
    9.62 +
    9.63 +			if( CoreCatchInput )
    9.64 +				CoreCatchInput(1);
    9.65 +		}
    9.66 +#endif
    9.67  	}
    9.68  	return(mode);
    9.69  }
    10.1 --- a/src/video/windib/SDL_dibevents.c	Wed Sep 28 11:36:20 2005 +0000
    10.2 +++ b/src/video/windib/SDL_dibevents.c	Thu Sep 29 09:43:00 2005 +0000
    10.3 @@ -360,12 +360,25 @@
    10.4  
    10.5  int DIB_CreateWindow(_THIS)
    10.6  {
    10.7 +#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
    10.8 +	wchar_t *SDL_windowid_t;
    10.9 +#endif
   10.10 +
   10.11  #ifndef CS_BYTEALIGNCLIENT
   10.12  #define CS_BYTEALIGNCLIENT	0
   10.13  #endif
   10.14  	SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0);
   10.15  	if ( SDL_windowid ) {
   10.16 +
   10.17 +// wince 2.1 does not have strtol
   10.18 +#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
   10.19 +		SDL_windowid_t = malloc((strlen(SDL_windowid) + 1) * sizeof(wchar_t));
   10.20 +		MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, SDL_windowid, -1, SDL_windowid_t, strlen(SDL_windowid) + 1);
   10.21 +		SDL_Window = (HWND)wcstol(SDL_windowid_t, NULL, 0);
   10.22 +		free(SDL_windowid_t);
   10.23 +#else
   10.24  		SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
   10.25 +#endif
   10.26  		if ( SDL_Window == NULL ) {
   10.27  			SDL_SetError("Couldn't get user specified window");
   10.28  			return(-1);
    11.1 --- a/src/video/windib/SDL_dibvideo.c	Wed Sep 28 11:36:20 2005 +0000
    11.2 +++ b/src/video/windib/SDL_dibvideo.c	Thu Sep 29 09:43:00 2005 +0000
    11.3 @@ -29,9 +29,13 @@
    11.4  #include <stdlib.h>
    11.5  #include <malloc.h>
    11.6  #include <windows.h>
    11.7 -#if defined(WIN32_PLATFORM_PSPC)
    11.8 -#include <aygshell.h>                      // Add Pocket PC includes
    11.9 -#pragma comment( lib, "aygshell" )         // Link Pocket PC library
   11.10 +
   11.11 +
   11.12 +#if defined(_WIN32_WCE)
   11.13 +
   11.14 +// defined and used in SDL_sysevents.c
   11.15 +extern HINSTANCE aygshell;
   11.16 +
   11.17  #endif
   11.18  
   11.19  /* Not yet in the mingw32 cross-compile headers */
   11.20 @@ -191,7 +195,7 @@
   11.21  }
   11.22  
   11.23  VideoBootStrap WINDIB_bootstrap = {
   11.24 -	"windib", "Win95/98/NT/2000 GDI",
   11.25 +	"windib", "Win95/98/NT/2000/CE GDI",
   11.26  	DIB_Available, DIB_CreateDevice
   11.27  };
   11.28  
   11.29 @@ -389,12 +393,6 @@
   11.30  	hdc = GetDC(SDL_Window);
   11.31  	depth = GetDeviceCaps(hdc, PLANES) * GetDeviceCaps(hdc, BITSPIXEL);
   11.32  	ReleaseDC(SDL_Window, hdc);
   11.33 -#ifndef _WIN32_WCE
   11.34 -	// AFAIK 16 bit CE devices have indeed RGB 565
   11.35 -	if ( depth == 16 ) {
   11.36 -		depth = 15;	/* GDI defined as RGB 555 */
   11.37 -	}
   11.38 -#endif
   11.39  	return(depth);
   11.40  #else
   11.41      int dib_size;
   11.42 @@ -518,23 +516,18 @@
   11.43  	video->h = height;
   11.44  	video->pitch = SDL_CalculatePitch(video);
   11.45  
   11.46 -#ifdef WIN32_PLATFORM_PSPC
   11.47 -	 /* Stuff to hide that $#!^%#$ WinCE taskbar in fullscreen... */
   11.48 -	if ( flags & SDL_FULLSCREEN ) {
   11.49 -		if ( !(prev_flags & SDL_FULLSCREEN) ) {
   11.50 -			SHFullScreen(SDL_Window, SHFS_HIDETASKBAR);
   11.51 -			SHFullScreen(SDL_Window, SHFS_HIDESIPBUTTON);
   11.52 -			ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_HIDE);
   11.53 -		}
   11.54 +	/* Small fix for WinCE/Win32 - when activating window
   11.55 +	   SDL_VideoSurface is equal to zero, so activating code
   11.56 +	   is not called properly for fullscreen windows because
   11.57 +	   macros WINDIB_FULLSCREEN uses SDL_VideoSurface
   11.58 +	*/
   11.59 +	SDL_VideoSurface = video;
   11.60 +
   11.61 +#if defined(_WIN32_WCE)
   11.62 +	if ( flags & SDL_FULLSCREEN )
   11.63  		video->flags |= SDL_FULLSCREEN;
   11.64 -	} else {
   11.65 -		if ( prev_flags & SDL_FULLSCREEN ) {
   11.66 -			SHFullScreen(SDL_Window, SHFS_SHOWTASKBAR);
   11.67 -			SHFullScreen(SDL_Window, SHFS_SHOWSIPBUTTON);
   11.68 -			ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOWNORMAL);
   11.69 -		}
   11.70 -	}
   11.71  #endif
   11.72 +
   11.73  #ifndef NO_CHANGEDISPLAYSETTINGS
   11.74  	/* Set fullscreen mode if appropriate */
   11.75  	if ( (flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) {
   11.76 @@ -942,14 +935,6 @@
   11.77  	if ( SDL_Window ) {
   11.78  		/* Delete the screen bitmap (also frees screen->pixels) */
   11.79  		if ( this->screen ) {
   11.80 -#ifdef WIN32_PLATFORM_PSPC
   11.81 -			if ( this->screen->flags & SDL_FULLSCREEN ) {
   11.82 -				/* Unhide taskbar, etc. */
   11.83 -				SHFullScreen(SDL_Window, SHFS_SHOWTASKBAR);
   11.84 -				SHFullScreen(SDL_Window, SHFS_SHOWSIPBUTTON);
   11.85 -				ShowWindow(FindWindow(TEXT("HHTaskBar"),NULL),SW_SHOWNORMAL);
   11.86 -			}
   11.87 -#endif
   11.88  #ifndef NO_CHANGEDISPLAYSETTINGS
   11.89  			if ( this->screen->flags & SDL_FULLSCREEN ) {
   11.90  				ChangeDisplaySettings(NULL, 0);
   11.91 @@ -975,6 +960,17 @@
   11.92  		FlushMessageQueue();
   11.93  
   11.94  		SDL_Window = NULL;
   11.95 +
   11.96 +#if defined(_WIN32_WCE)
   11.97 +
   11.98 +// Unload wince aygshell library to prevent leak
   11.99 +		if( aygshell ) 
  11.100 +		{
  11.101 +			FreeLibrary(aygshell);
  11.102 +			aygshell = NULL;
  11.103 +		}
  11.104 +#endif
  11.105 +
  11.106  	}
  11.107  }
  11.108  
    12.1 --- a/test/testalpha.c	Wed Sep 28 11:36:20 2005 +0000
    12.2 +++ b/test/testalpha.c	Thu Sep 29 09:43:00 2005 +0000
    12.3 @@ -339,12 +339,20 @@
    12.4  	}
    12.5  
    12.6  	/* Set 640x480 video mode */
    12.7 +#ifndef _WIN32_WCE
    12.8  	if ( (screen=SDL_SetVideoMode(640,480,video_bpp,videoflags)) == NULL ) {
    12.9  		fprintf(stderr, "Couldn't set 640x480x%d video mode: %s\n",
   12.10  						video_bpp, SDL_GetError());
   12.11  		quit(2);
   12.12  	}
   12.13 -
   12.14 +#else
   12.15 +	/* Pocket PC */
   12.16 +	if ( (screen=SDL_SetVideoMode(240,320,video_bpp,SDL_FULLSCREEN)) == NULL ) {
   12.17 +		fprintf(stderr, "Couldn't set 240x320x%d video mode: %s\n",
   12.18 +						video_bpp, SDL_GetError());
   12.19 +		quit(2);
   12.20 +	}
   12.21 +#endif
   12.22  	/* Set the surface pixels and refresh! */
   12.23  	if ( SDL_LockSurface(screen) < 0 ) {
   12.24  		fprintf(stderr, "Couldn't lock the display surface: %s\n",
    13.1 --- a/test/testwin.c	Wed Sep 28 11:36:20 2005 +0000
    13.2 +++ b/test/testwin.c	Thu Sep 29 09:43:00 2005 +0000
    13.3 @@ -248,11 +248,18 @@
    13.4  	flip = 0;
    13.5  	nofade = 0;
    13.6  	delay = 1;
    13.7 +
    13.8 +#ifdef _WIN32_WCE
    13.9 +	w = 640;
   13.10 +	h = 320;
   13.11 +	desired_bpp = 0;
   13.12 +	video_flags = SDL_FULLSCREEN;
   13.13 +#else
   13.14  	w = 640;
   13.15  	h = 480;
   13.16  	desired_bpp = 0;
   13.17  	video_flags = 0;
   13.18 -
   13.19 +#endif
   13.20  	if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
   13.21  		fprintf(stderr,
   13.22  			"Couldn't initialize SDL: %s\n", SDL_GetError());