merged: might need to check main.c in the iOS template to make sure no changes were abandoned.
authorEric Wing <ewing . public |-at-| gmail . com>
Tue, 01 Feb 2011 00:37:02 -0800
changeset 5279 2c500f37abcf
parent 5278 067973aec4d8 (current diff)
parent 5128 f2c2f0ecba5f (diff)
child 5280 b1b0811a1ccc
merged: might need to check main.c in the iOS template to make sure no changes were abandoned.
README.RISCOS
Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj
src/SDL_android.cpp
src/SDL_android.h
src/joystick/riscos/SDL_sysjoystick.c
src/thread/riscos/SDL_syscond.c
src/thread/riscos/SDL_sysmutex.c
src/thread/riscos/SDL_sysmutex_c.h
src/thread/riscos/SDL_syssem.c
src/thread/riscos/SDL_systhread.c
src/thread/riscos/SDL_systhread_c.h
src/timer/SDL_systimer.h
src/timer/riscos/SDL_systimer.c
src/video/riscos/SDL_riscosASM.S
src/video/riscos/SDL_riscosFullScreenVideo.c
src/video/riscos/SDL_riscosevents.c
src/video/riscos/SDL_riscosevents_c.h
src/video/riscos/SDL_riscosmouse.c
src/video/riscos/SDL_riscosmouse_c.h
src/video/riscos/SDL_riscossprite.c
src/video/riscos/SDL_riscostask.c
src/video/riscos/SDL_riscostask.h
src/video/riscos/SDL_riscosvideo.c
src/video/riscos/SDL_riscosvideo.h
src/video/riscos/SDL_wimppoll.c
src/video/riscos/SDL_wimpvideo.c
--- a/Android.mk	Mon Jan 31 07:36:12 2011 -0800
+++ b/Android.mk	Tue Feb 01 00:37:02 2011 -0800
@@ -12,30 +12,31 @@
 
 LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
 
-LOCAL_SRC_FILES := src/SDL_android.cpp \
+LOCAL_SRC_FILES := \
 	$(subst $(LOCAL_PATH)/,, \
 	$(wildcard $(LOCAL_PATH)/src/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/audio/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
 	$(LOCAL_PATH)/src/atomic/SDL_atomic.c \
 	$(LOCAL_PATH)/src/atomic/SDL_spinlock.c.arm \
+	$(wildcard $(LOCAL_PATH)/src/core/android/*.cpp) \
 	$(wildcard $(LOCAL_PATH)/src/cpuinfo/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/events/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/file/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/joystick/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/haptic/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/power/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/stdlib/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/thread/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/timer/*.c) \
+	$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
 	$(wildcard $(LOCAL_PATH)/src/video/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/power/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/audio/android/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/audio/dummy/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/video/android/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/joystick/android/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/haptic/dummy/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/thread/pthread/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/timer/unix/*.c) \
-	$(wildcard $(LOCAL_PATH)/src/loadso/dlopen/*.c))
+	$(wildcard $(LOCAL_PATH)/src/video/android/*.c))
 
 LOCAL_LDLIBS := -ldl -lGLESv1_CM -llog
 
--- a/README	Mon Jan 31 07:36:12 2011 -0800
+++ b/README	Tue Feb 01 00:37:02 2011 -0800
@@ -3,7 +3,7 @@
 
                                   (SDL)
 
-                                Version 1.2
+                                Version 1.3
 
 ---
 http://www.libsdl.org/
@@ -12,10 +12,9 @@
 level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
 and 2D framebuffer across multiple platforms.
 
-The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
-Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
-The code contains support for AIX, OSF/Tru64, RISC OS, and SymbianOS,
-but these are not officially supported.
+The current version supports Windows, Windows CE, Mac OS X, Linux, FreeBSD,
+NetBSD, OpenBSD, BSD/OS, Solaris, QNX, iOS, and Android. The code contains
+support for other operating systems but those are not officially supported.
 
 SDL is written in C, but works with C++ natively, and has bindings to
 several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README.Platforms	Tue Feb 01 00:37:02 2011 -0800
@@ -0,0 +1,34 @@
+
+This is a list of the platforms SDL supports, and who maintains them.
+
+Officially supported platforms
+==============================
+(code compiles, and thoroughly tested for release)
+==============================
+Windows XP
+Windows Vista
+Windows 7
+Mac OS X 10.4+
+Linux 2.6+
+iOS 3.2+
+Android 1.6+
+
+Unofficially supported platforms
+================================
+(code compiles, but not thoroughly tested)
+================================
+Windows CE
+FreeBSD
+NetBSD
+OpenBSD
+Solaris
+
+Platforms supported by volunteers
+=================================
+Pandora - maintained by Scott Smith <pickle136@sbcglobal.net>
+
+Platforms that need maintainers
+===============================
+Nintendo DS
+QNX
+Haiku
--- a/README.RISCOS	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,129 +0,0 @@
-Readme for RISC OS port of SDL
-==============================
-
-This document last updated on 2nd Februrary 2006
-
-This is a RISC OS port of the Simple Direct Media Layer (SDL) by Alan Buckley with contributions from Peter Naulls.
-
-Details of the SDL can be found at http://www.libsdl.org.
-
-The source code including the RISC OS version can be obtained from:
-
-http://www.libsdl.org.
-
-Pre built libraries and many games and applications compiled for RISC OS using this library can be downloaded from The Unix Porting Project at http://www.riscos.info/unix/.
-
-This is released under the LGPL see the file COPYING for details.
-
-
-Compiling applications under RISC OS
-====================================
-
-Add -ISDL: for the C compiler flags if you include the files in the SDL directory. e.g. #include "SDL/SDL.h"
-Add -ISDL:SDL for the C compiler flags if you include the files directly. e.g. #include "SDL/SDL.h"
-
-Add -LSDL: -lSDL to the link stage of compilation.
-
-For example, to compile the testbitmap.c sample you could use:
-
-gcc -ISDL:SDL -LSDL: -lSDL testbitmap.c -otestbitmap
-
-
-RISC OS port of SDL runtime information
-=======================================
-
-Runtime requirements
---------------------
-
-This library currently needs a minimum of RISC OS 3.6. The source code for the library (and a lot of the programs built with it) also need long file names.
-
-To use the audio you also need 16 bit sound and to have installed the DigitalRender module by Andreas Dehmel version 0.51 available from his
-web site: http://home.t-online.de/~zarquon
-This is loaded when needed by UnixLib.
-
-Note: As most programs ported from other OSes use high resolution graphics and a memory back buffer a machine with a StrongARM processor and 1 or 2MB of VRAM (or a better machine) is recomended.
-
-
-RISC OS runtime parameters
---------------------------
-
-Several environmental variables have been defined to make porting programs easier (i.e. By setting these variable you do not need to have source code differences between OSes).
-
-They are all defined on an application basis.
-
-The <appname> used below is found as follows:
-1. Use the name of the program unless it is !RunImage
-2. Check the folder specification for the folder !RunImage is run from. If it is a folder name use that name, otherwise if it is an environmental variable of the form <XXX$Dir> use the value of XXX.
-
-The variables are:
-
-SDL$<appname>$TaskName
-
-The name of the task for RISC OS. If omitted then <appname> is used for the task name,
-
-SDL$<appname>$BackBuffer
-
-Set to 1 to use a system memory back buffer for the screen in full screen mode. Some programs on other systems assume their is always a back buffer even though the SDL specification specifies this is not the case. The current RISC OS implementation uses direct writes to the screen if a hardware fullscreen is requested.
-
-Set to 2 to use an ARM code full word copy. This is faster than the standard back buffer, but uses aligned words only so it is possible (but unlikely) for it to corrupt the screen for 8bpp and 16bpp modes.
-
-Set to 3 to use a RISC OS sprite as the back buffer. This is usually the slowest for most SDL applications, however it may be useful in the future as Sprite acceleration is added to various hardware that runs RISC OS.
-
-SDL$<appname>$CloseAction - set the action for the close icon. Again as programs don't match the specification you can set this to 0 to remove the close icon from the main window for applications where this does not affect the program.
-
-
-RISC OS SDL port API notes
-==========================
-
-Current level of implementation
--------------------------------
-
-The following list is an overview of how much of the SDL is implemented. The areas match the main areas of the SDL.
-
-video - Mostly done. Doesn't cover gamma, YUV-overlay or OpenGL.
-Window Manager - Mostly done. SetIcon/IconifyWindow not implemented.
-Events - Mostly done. Resize and some joystick events missing.
-Joystick - Currently assumes a single joystick with 4 buttons.
-Audio - Done
-Threads - Done
-Timers - Done
-
-Thread support can be removed by defining DISABLE_THREADS and recompiling the library.
-
-SDL API notes
--------------
-
-This section contains additional notes on some specific commands.
-
-SDL_SetVideoMode
-  On RISC OS a fullscreen mode directly accesses the screen. This can be modified by the environmental variable (SDL$<appname>$BackBuffer) or by using the SDL_SWSURFACE flag to write to an offscreen buffer that is updated using SDL_UpdateRects.
-  Open GL is not supported so SDL_OPENGL and SDL_OPENGLBLIT flags fail.
-  SDL_RESIZEABLE and SDL_NOFRAME flags are not supported.
-
-SDL_SetColors
-  In a wimp mode the screen colours are not changed for a hardware palette instead the RISC OS sprite colour mapping is used to get the best matching colours.
-
-SDL_CreateCursor
-   Inverted colour is not supported.
-
-SDL_WM_ToggleFullScreen
-   Currently this won't work if the application starts up in Fullscreen mode.
-   Toggling to fullscreen will only work if the monitor is set up to support the exact screen size requested.
-
-SDL_EnableUNICODE
-   Unicode translation used here is only really accurate for 7 bit characters.
-
-SDL_NumJoysticks/JoystickName etc.
-   Hardcoded to expect only 1 joystick with 4 buttons if the Joystick module is loaded.
-
-SDL_GetTicks
-   Timer used has only a centisecond accuracy. This applies to other time related functions.
-   
-SDL_Delay
-   Modified to poll keyboard/mouse during the delay on the event thread.
-
-
-Notes on current implementation
--------------------------------
-
-Keyboard and mouse are polled so if too long a time is spent between a call to SDL_PumpEvents, functions that use it, or SDL_Delay events can be missed.
--- a/VisualC/SDL/SDL_VS2005.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualC/SDL/SDL_VS2005.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -29,7 +29,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -207,7 +207,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -648,10 +648,6 @@
 			>
 		</File>
 		<File
-			RelativePath="..\..\src\atomic\SDL_spinlock.c"
-			>
-		</File>
-		<File
 			RelativePath="..\..\src\audio\SDL_audio.c"
 			>
 		</File>
@@ -1048,6 +1044,10 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\atomic\SDL_spinlock.c"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\stdlib\SDL_stdlib.c"
 			>
 		</File>
@@ -1164,6 +1164,22 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\events\SDL_windowevents.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_windowevents_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\core\windows\SDL_windows.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\core\windows\SDL_windows.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\windows\SDL_windowsclipboard.c"
 			>
 		</File>
@@ -1244,14 +1260,6 @@
 			>
 		</File>
 		<File
-			RelativePath="..\..\src\events\SDL_windowevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_windowevents_c.h"
-			>
-		</File>
-		<File
 			RelativePath="..\..\src\video\SDL_yuv_mmx.c"
 			>
 		</File>
--- a/VisualC/SDL/SDL_VS2008.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualC/SDL/SDL_VS2008.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -30,7 +30,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadfood&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -201,7 +201,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadfood&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -1151,6 +1151,22 @@
 			>
 		</File>
 		<File
+			RelativePath="..\..\src\events\SDL_windowevents.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\events\SDL_windowevents_c.h"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\core\windows\SDL_windows.c"
+			>
+		</File>
+		<File
+			RelativePath="..\..\src\core\windows\SDL_windows.h"
+			>
+		</File>
+		<File
 			RelativePath="..\..\src\video\windows\SDL_windowsclipboard.c"
 			>
 		</File>
@@ -1231,14 +1247,6 @@
 			>
 		</File>
 		<File
-			RelativePath="..\..\src\events\SDL_windowevents.c"
-			>
-		</File>
-		<File
-			RelativePath="..\..\src\events\SDL_windowevents_c.h"
-			>
-		</File>
-		<File
 			RelativePath="..\..\src\video\SDL_yuv_mmx.c"
 			>
 		</File>
--- a/VisualC/SDL/SDL_VS2010.vcxproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualC/SDL/SDL_VS2010.vcxproj	Tue Feb 01 00:37:02 2011 -0800
@@ -74,14 +74,12 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <PreBuildEvent>
       <Message>Making sure basic SDL headers are in place...</Message>
-      <Command>if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
-echo Copying SDL_config_windows.h to SDL_config.h...
-copy "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
-:SDLCONFIGOKAY
+      <Command>echo Copying SDL_config_windows.h to SDL_config.h...
+copy /Y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
 
 if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
 echo Creating stub SDL_revision.h file...
-echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
+echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
 :SDLREVISIONOKAY
 </Command>
     </PreBuildEvent>
@@ -154,14 +152,12 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <PreBuildEvent>
       <Message>Making sure basic SDL headers are in place...</Message>
-      <Command>if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
-echo Copying SDL_config_windows.h to SDL_config.h...
-copy "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
-:SDLCONFIGOKAY
+      <Command>echo Copying SDL_config_windows.h to SDL_config.h...
+copy /Y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
 
 if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
 echo Creating stub SDL_revision.h file...
-echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
+echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
 :SDLREVISIONOKAY
 </Command>
     </PreBuildEvent>
@@ -272,6 +268,7 @@
     <ClInclude Include="..\..\include\SDL_types.h" />
     <ClInclude Include="..\..\include\SDL_version.h" />
     <ClInclude Include="..\..\include\SDL_video.h" />
+    <ClInclude Include="..\..\src\core\windows\SDL_windows.h" />
     <ClInclude Include="..\..\src\events\blank_cursor.h" />
     <ClInclude Include="..\..\src\events\default_cursor.h" />
     <ClInclude Include="..\..\src\audio\windx5\directx.h" />
@@ -345,6 +342,7 @@
     <ClInclude Include="..\..\src\video\windows\wmmsg.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\src\core\windows\SDL_windows.c" />
     <ClCompile Include="..\..\src\events\SDL_clipboardevents.c" />
     <ClCompile Include="..\..\src\events\SDL_gesture.c" />
     <ClCompile Include="..\..\src\events\SDL_touch.c" />
--- a/VisualC/SDLmain/SDLmain_VS2005.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualC/SDLmain/SDLmain_VS2005.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -29,7 +29,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -164,7 +164,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -299,7 +299,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
--- a/VisualC/SDLmain/SDLmain_VS2008.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualC/SDLmain/SDLmain_VS2008.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -30,7 +30,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -165,7 +165,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -300,7 +300,7 @@
 			<Tool
 				Name="VCPreBuildEventTool"
 				Description="Making sure basic SDL headers are in place..."
-				CommandLine="if exist &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot; goto SDLCONFIGOKAY&#x0D;&#x0A;echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;:SDLCONFIGOKAY&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION 0 &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
+				CommandLine="echo Copying SDL_config_windows.h to SDL_config.h...&#x0D;&#x0A;copy /Y &quot;$(ProjectDir)\..\..\include\SDL_config_windows.h&quot; &quot;$(ProjectDir)\..\..\include\SDL_config.h&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot; goto SDLREVISIONOKAY&#x0D;&#x0A;echo Creating stub SDL_revision.h file...&#x0D;&#x0A;echo #define SDL_REVISION &quot;hg-0:baadf00d&quot; &gt;&quot;$(ProjectDir)\..\..\include\SDL_revision.h&quot;&#x0D;&#x0A;:SDLREVISIONOKAY&#x0D;&#x0A;"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
--- a/VisualC/SDLmain/SDLmain_VS2010.vcxproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualC/SDLmain/SDLmain_VS2010.vcxproj	Tue Feb 01 00:37:02 2011 -0800
@@ -101,14 +101,12 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <PreBuildEvent>
       <Message>Making sure basic SDL headers are in place...</Message>
-      <Command>if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
-echo Copying SDL_config_windows.h to SDL_config.h...
-copy "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
-:SDLCONFIGOKAY
+      <Command>echo Copying SDL_config_windows.h to SDL_config.h...
+copy /Y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
 
 if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
 echo Creating stub SDL_revision.h file...
-echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
+echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
 :SDLREVISIONOKAY</Command>
     </PreBuildEvent>
     <ClCompile>
@@ -154,14 +152,12 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_NoSTDIO|Win32'">
     <PreBuildEvent>
       <Message>Making sure basic SDL headers are in place...</Message>
-      <Command>if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
-echo Copying SDL_config_windows.h to SDL_config.h...
-copy "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
-:SDLCONFIGOKAY
+      <Command>echo Copying SDL_config_windows.h to SDL_config.h...
+copy /Y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
 
 if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
 echo Creating stub SDL_revision.h file...
-echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
+echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
 :SDLREVISIONOKAY</Command>
     </PreBuildEvent>
     <ClCompile>
@@ -207,14 +203,12 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <PreBuildEvent>
       <Message>Making sure basic SDL headers are in place...</Message>
-      <Command>if exist "$(ProjectDir)\..\..\include\SDL_config.h" goto SDLCONFIGOKAY
-echo Copying SDL_config_windows.h to SDL_config.h...
-copy "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
-:SDLCONFIGOKAY
+      <Command>echo Copying SDL_config_windows.h to SDL_config.h...
+copy /Y "$(ProjectDir)\..\..\include\SDL_config_windows.h" "$(ProjectDir)\..\..\include\SDL_config.h"
 
 if exist "$(ProjectDir)\..\..\include\SDL_revision.h" goto SDLREVISIONOKAY
 echo Creating stub SDL_revision.h file...
-echo #define SDL_REVISION 0 &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
+echo #define SDL_REVISION "hg-0:baadf00d" &gt;"$(ProjectDir)\..\..\include\SDL_revision.h"
 :SDLREVISIONOKAY</Command>
     </PreBuildEvent>
     <ClCompile>
@@ -261,4 +255,4 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
+</Project>
--- a/VisualCE/SDL.sln	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualCE/SDL.sln	Tue Feb 01 00:37:02 2011 -0800
@@ -1,6 +1,6 @@
 
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDL", "SDL\SDL.vcproj", "{C598024D-8030-4F9C-AB76-69BF4CA0645F}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SDLmain", "SDLmain\SDLmain.vcproj", "{5AC88B84-5EAA-4C1E-948D-332DA34227F6}"
--- a/VisualCE/SDL/SDL.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualCE/SDL/SDL.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="8,00"
+	Version="9.00"
 	Name="SDL"
 	ProjectGUID="{C598024D-8030-4F9C-AB76-69BF4CA0645F}"
 	RootNamespace="SDL"
+	TargetFrameworkVersion="131072"
 	>
 	<Platforms>
 		<Platform
@@ -93,6 +94,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="_DllMainCRTStartup"
 				BaseAddress="0x00100000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 				ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
 			/>
 			<Tool
@@ -107,6 +110,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -195,6 +201,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="_DllMainCRTStartup"
 				BaseAddress="0x00100000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 				ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
 			/>
 			<Tool
@@ -209,6 +217,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -296,6 +307,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="_DllMainCRTStartup"
 				BaseAddress="0x00100000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 				ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
 			/>
 			<Tool
@@ -310,6 +323,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -396,6 +412,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="_DllMainCRTStartup"
 				BaseAddress="0x00100000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 				ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
 			/>
 			<Tool
@@ -410,6 +428,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -500,6 +521,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="_DllMainCRTStartup"
 				BaseAddress="0x00100000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 				ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
 			/>
 			<Tool
@@ -514,6 +537,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -606,6 +632,8 @@
 				LinkTimeCodeGeneration="1"
 				EntryPointSymbol="_DllMainCRTStartup"
 				BaseAddress="0x00100000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 				ImportLibrary="$(PlatformName)\$(ConfigurationName)/SDL.lib"
 			/>
 			<Tool
@@ -620,6 +648,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDL.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -643,1294 +674,238 @@
 			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
 			>
 			<File
+				RelativePath="..\..\src\libm\e_atan2.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\e_log.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\e_pow.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\e_rem_pio2.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\e_sqrt.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\k_cos.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\k_rem_pio2.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\k_sin.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\s_atan.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\s_copysign.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\s_cos.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\s_fabs.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\s_floor.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\s_scalbn.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\libm\s_sin.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\SDL.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_alphamult.c"
+				>
 			</File>
 			<File
-				RelativePath="..\..\src\events\SDL_active.c"
+				RelativePath="..\..\src\SDL_assert.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\atomic\SDL_atomic.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\audio\SDL_audio.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\audio\SDL_audiocvt.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\audio\SDL_audiodev.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\audio\SDL_audiotypecvt.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_blendfillrect.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_blendline.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_blendpoint.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_blendrect.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_blit.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_blit_0.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_blit_1.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_blit_A.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_blit_auto.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_blit_copy.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_blit_N.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_blit_slow.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_bmp.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_ceddrawrender.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_clipboard.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\events\SDL_clipboardevents.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\SDL_compat.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\cpuinfo\SDL_cpuinfo.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\..\src\video\SDL_cursor.c"
+				RelativePath="..\..\src\video\windows\SDL_d3drender.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\audio\windib\SDL_dibaudio.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\video\windib\SDL_dibevents.c"
-				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\video\windib\SDL_dibvideo.c"
-				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\audio\disk\SDL_diskaudio.c"
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\video\SDL_drawline.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_drawpoint.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_drawrect.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\audio\dummy\SDL_dummyaudio.c"
 				>
 			</File>
 			<File
 				RelativePath="..\..\src\SDL_error.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\events\SDL_events.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\events\SDL_expose.c"
-				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\SDL_fatal.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_fillrect.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_gamma.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_gapirender.c"
+				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\gapi\sdl_gapivideo.c"
+				RelativePath="..\..\src\video\windows\SDL_gdirender.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\events\SDL_gesture.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\stdlib\SDL_getenv.c"
 				>
 			</File>
 			<File
+				RelativePath="..\..\src\haptic\SDL_haptic.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\src\stdlib\SDL_iconv.c"
 				>
 			</File>
@@ -1941,60 +916,6 @@
 			<File
 				RelativePath="..\..\src\events\SDL_keyboard.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\stdlib\SDL_malloc.c"
@@ -2003,183 +924,17 @@
 			<File
 				RelativePath="..\..\src\audio\SDL_mixer.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.c"
-				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\events\SDL_mouse.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\video\dummy\SDL_nullevents.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\dummy\SDL_nullmouse.c"
+				RelativePath="..\..\src\video\dummy\SDL_nullrender.c"
 				>
 			</File>
 			<File
@@ -2189,60 +944,10 @@
 			<File
 				RelativePath="..\..\src\video\SDL_pixels.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\power\SDL_power.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\stdlib\SDL_qsort.c"
@@ -2251,292 +956,38 @@
 			<File
 				RelativePath="..\..\src\events\SDL_quit.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\..\src\events\SDL_resize.c"
+				RelativePath="..\..\src\video\SDL_rect.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_renderer_sw.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_RLEaccel.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\file\SDL_rwops.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_shape.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\atomic\SDL_spinlock.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\stdlib\SDL_stdlib.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_stretch.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\stdlib\SDL_string.c"
@@ -2545,1000 +996,118 @@
 			<File
 				RelativePath="..\..\src\video\SDL_surface.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\..\src\thread\generic\SDL_syscond.c"
+				RelativePath="..\..\src\haptic\dummy\SDL_syshaptic.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\video\wincommon\SDL_sysevents.c"
-				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\joystick\dummy\SDL_sysjoystick.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\..\src\loadso\win32\SDL_sysloadso.c"
+				RelativePath="..\..\src\loadso\windows\SDL_sysloadso.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\thread\windows\SDL_sysmutex.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\wincommon\SDL_sysmouse.c"
+				RelativePath="..\..\src\power\windows\SDL_syspower.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\..\src\thread\win32\SDL_sysmutex.c"
+				RelativePath="..\..\src\thread\windows\SDL_syssem.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\..\src\thread\win32\SDL_syssem.c"
+				RelativePath="..\..\src\thread\windows\SDL_systhread.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
-				RelativePath="..\..\src\thread\win32\SDL_systhread.c"
-				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\timer\wince\SDL_systimer.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\wincommon\SDL_syswm.c"
-				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
 				RelativePath="..\..\src\thread\SDL_thread.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\timer\SDL_timer.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\events\SDL_touch.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_video.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\audio\SDL_wave.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\events\SDL_windowevents.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\core\windows\SDL_windows.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsclipboard.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsevents.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsgamma.c"
+				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\wincommon\SDL_wingl.c"
+				RelativePath="..\..\src\video\windows\SDL_windowskeyboard.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsmodes.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsmouse.c"
+				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\SDL_yuv.c"
+				RelativePath="..\..\src\video\windows\SDL_windowsopengl.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsshape.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsvideo.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowswindow.c"
+				>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_yuv_mmx.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
 				RelativePath="..\..\src\video\SDL_yuv_sw.c"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\thread\win32\win_ce_semaphore.c"
+				RelativePath="..\..\src\thread\windows\win_ce_semaphore.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 		</Filter>
 		<Filter
@@ -3546,27 +1115,19 @@
 			Filter="h;hpp;hxx;hm;inl"
 			>
 			<File
-				RelativePath="..\..\include\begin_code.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\video\blank_cursor.h"
+				RelativePath="..\..\src\events\blank_cursor.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\close_code.h"
+				RelativePath="..\..\src\events\default_cursor.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\default_cursor.h"
+				RelativePath="..\..\src\libm\math.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\hermes\HeadMMX.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\hermes\HeadX86.h"
+				RelativePath="..\..\src\libm\math_private.h"
 				>
 			</File>
 			<File
@@ -3574,15 +1135,27 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL.h"
+				RelativePath="..\..\src\events\scancodes_darwin.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\events\scancodes_linux.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_active.h"
+				RelativePath="..\..\src\events\scancodes_windows.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_audio.h"
+				RelativePath="..\..\src\events\scancodes_xfree86.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_alphamult.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\SDL_assert_c.h"
 				>
 			</File>
 			<File
@@ -3602,27 +1175,27 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_byteorder.h"
+				RelativePath="..\..\src\video\SDL_blit_auto.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_config.h"
+				RelativePath="..\..\src\video\SDL_blit_copy.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_config_wince.h"
+				RelativePath="..\..\src\video\SDL_blit_slow.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_copying.h"
+				RelativePath="..\..\src\video\windows\SDL_ceddrawrender.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_cpuinfo.h"
+				RelativePath="..\..\src\events\SDL_clipboardevents_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\SDL_cursor_c.h"
+				RelativePath="..\..\src\video\windows\SDL_d3drender.h"
 				>
 			</File>
 			<File
@@ -3630,15 +1203,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\windib\SDL_dibevents_c.h"
+				RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\windib\SDL_dibvideo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\audio\disk\SDL_diskaudio.h"
+				RelativePath="..\..\src\video\SDL_draw.h"
 				>
 			</File>
 			<File
@@ -3646,22 +1215,10 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_endian.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_error.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\SDL_error_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_events.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\events\SDL_events_c.h"
 				>
 			</File>
@@ -3670,11 +1227,23 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\gapi\sdl_gapivideo.h"
+				RelativePath="..\..\src\video\windows\SDL_gapirender.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_gapirender_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_getenv.h"
+				RelativePath="..\..\src\video\windows\SDL_gdirender.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\events\SDL_gesture_c.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\SDL_glesfuncs.h"
 				>
 			</File>
 			<File
@@ -3682,7 +1251,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_joystick.h"
+				RelativePath="..\..\src\haptic\SDL_haptic_c.h"
 				>
 			</File>
 			<File
@@ -3690,11 +1259,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_keyboard.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_keysym.h"
+				RelativePath="..\..\src\events\SDL_keyboard_c.h"
 				>
 			</File>
 			<File
@@ -3702,39 +1267,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_loadso.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\video\wincommon\SDL_lowvideo.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_main.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\video\SDL_memops.h"
+				RelativePath="..\..\src\events\SDL_mouse_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\audio\SDL_mixer_MMX.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\audio\SDL_mixer_MMX_VC.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_mouse.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_mutex.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_name.h"
+				RelativePath="..\..\src\video\windows\SDL_msctf.h"
 				>
 			</File>
 			<File
@@ -3742,7 +1279,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\dummy\SDL_nullmouse_c.h"
+				RelativePath="..\..\src\video\dummy\SDL_nullrender_c.h"
 				>
 			</File>
 			<File
@@ -3750,19 +1287,15 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_opengl.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\video\SDL_pixels_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_platform.h"
+				RelativePath="..\..\src\video\SDL_rect_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_quit.h"
+				RelativePath="..\..\src\video\SDL_renderer_sw.h"
 				>
 			</File>
 			<File
@@ -3770,11 +1303,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_rwops.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\video\SDL_stretch_c.h"
+				RelativePath="..\..\src\video\SDL_shape_internals.h"
 				>
 			</File>
 			<File
@@ -3782,27 +1311,15 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\thread\generic\SDL_syscond_c.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\events\SDL_sysevents.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
+				RelativePath="..\..\src\haptic\SDL_syshaptic.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\wincommon\SDL_sysmouse_c.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\thread\generic\SDL_sysmutex_c.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\thread\generic\SDL_syssem_c.h"
+				RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
 				>
 			</File>
 			<File
@@ -3810,11 +1327,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\thread\generic\SDL_systhread_c.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\thread\win32\SDL_systhread_c.h"
+				RelativePath="..\..\src\thread\windows\SDL_systhread_c.h"
 				>
 			</File>
 			<File
@@ -3826,43 +1339,19 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_syswm.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\video\wincommon\SDL_syswm_c.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_thread.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\thread\SDL_thread_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_timer.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\src\timer\SDL_timer_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_types.h"
+				RelativePath="..\..\src\events\SDL_touch_c.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\include\SDL_version.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\include\SDL_video.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\video\windib\SDL_vkeys.h"
+				RelativePath="..\..\src\video\windows\SDL_vkeys.h"
 				>
 			</File>
 			<File
@@ -3870,7 +1359,51 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\wincommon\SDL_wingl_c.h"
+				RelativePath="..\..\src\events\SDL_windowevents_c.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\core\windows\SDL_windows.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsclipboard.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsevents.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsgamma.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowskeyboard.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsmodes.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsmouse.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsopengl.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsshape.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowsvideo.h"
+				>
+			</File>
+			<File
+				RelativePath="..\..\src\video\windows\SDL_windowswindow.h"
 				>
 			</File>
 			<File
@@ -3878,15 +1411,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\video\SDL_yuvfuncs.h"
+				RelativePath="..\..\src\thread\windows\win_ce_semaphore.h"
 				>
 			</File>
 			<File
-				RelativePath="..\..\src\thread\win32\win_ce_semaphore.h"
-				>
-			</File>
-			<File
-				RelativePath="..\..\src\video\wincommon\wmmsg.h"
+				RelativePath="..\..\src\video\windows\wmmsg.h"
 				>
 			</File>
 		</Filter>
--- a/VisualCE/SDLMain/SDLmain.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualCE/SDLMain/SDLmain.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="8,00"
+	Version="9.00"
 	Name="SDLmain"
 	ProjectGUID="{5AC88B84-5EAA-4C1E-948D-332DA34227F6}"
 	RootNamespace="SDLmain"
+	TargetFrameworkVersion="131072"
 	>
 	<Platforms>
 		<Platform
@@ -89,6 +90,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -172,6 +176,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -255,6 +262,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -338,6 +348,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -421,6 +434,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -507,6 +523,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/SDLmain.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -530,62 +549,8 @@
 			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
 			>
 			<File
-				RelativePath="..\..\src\main\win32\SDL_win32_main.c"
+				RelativePath="..\..\src\main\windows\SDL_windows_main.c"
 				>
-				<FileConfiguration
-					Name="Debug|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Smartphone 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Pocket PC 2003 (ARMV4)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						AdditionalIncludeDirectories=""
-						UsePrecompiledHeader="0"
-					/>
-				</FileConfiguration>
 			</File>
 		</Filter>
 		<Filter
--- a/VisualCE/loopwave/loopwave.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualCE/loopwave/loopwave.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="8,00"
+	Version="9.00"
 	Name="loopwave"
 	ProjectGUID="{6F642636-CB11-4DC7-855E-27FE1744003A}"
 	RootNamespace="loopwave"
 	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
 	>
 	<Platforms>
 		<Platform
@@ -74,6 +75,8 @@
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)/loopwave.pdb"
 				SubSystem="0"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -85,6 +88,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -125,7 +131,7 @@
 				Name="VCCLCompilerTool"
 				ExecutionBucket="7"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\nclude"
+				AdditionalIncludeDirectories="..\..\include"
 				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
 				MinimalRebuild="true"
 				RuntimeLibrary="1"
@@ -154,6 +160,8 @@
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)/loopwave.pdb"
 				SubSystem="0"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -165,6 +173,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -236,6 +247,8 @@
 				SubSystem="0"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -247,6 +260,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -317,6 +333,8 @@
 				SubSystem="0"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -328,6 +346,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
--- a/VisualCE/testalpha/testalpha.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualCE/testalpha/testalpha.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="8,00"
+	Version="9.00"
 	Name="testalpha"
 	ProjectGUID="{DF401CB3-6F70-4485-996B-B7C357CF7EE7}"
 	RootNamespace="testalpha"
+	TargetFrameworkVersion="131072"
 	>
 	<Platforms>
 		<Platform
@@ -94,6 +95,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -107,6 +110,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -195,6 +201,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -208,6 +216,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -300,6 +311,8 @@
 				LinkTimeCodeGeneration="1"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -313,6 +326,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -400,6 +416,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -413,6 +431,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -500,6 +521,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -513,6 +536,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -600,6 +626,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -613,6 +641,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testalpha.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
--- a/VisualCE/testtimer/testtimer.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualCE/testtimer/testtimer.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="8,00"
+	Version="9.00"
 	Name="testtimer"
 	ProjectGUID="{D482D7EE-6FF0-4254-9027-C59F8F03AB1F}"
 	RootNamespace="testtimer"
 	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
 	>
 	<Platforms>
 		<Platform
@@ -74,6 +75,8 @@
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)/testtimer.pdb"
 				SubSystem="0"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -85,6 +88,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -125,6 +131,7 @@
 				Name="VCCLCompilerTool"
 				ExecutionBucket="7"
 				Optimization="0"
+				AdditionalIncludeDirectories="..\..\include"
 				PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
 				MinimalRebuild="true"
 				RuntimeLibrary="1"
@@ -153,6 +160,8 @@
 				GenerateDebugInformation="true"
 				ProgramDatabaseFile="$(OutDir)/testtimer.pdb"
 				SubSystem="0"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -164,6 +173,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -235,6 +247,8 @@
 				SubSystem="0"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -246,6 +260,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -286,6 +303,7 @@
 				Name="VCCLCompilerTool"
 				ExecutionBucket="7"
 				Optimization="2"
+				AdditionalIncludeDirectories="..\..\include"
 				PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_WINDOWS;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
 				RuntimeLibrary="0"
 				UsePrecompiledHeader="0"
@@ -315,6 +333,8 @@
 				SubSystem="0"
 				OptimizeReferences="2"
 				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -326,6 +346,9 @@
 				Name="VCBscMakeTool"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
--- a/VisualCE/testwin/testwin.vcproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/VisualCE/testwin/testwin.vcproj	Tue Feb 01 00:37:02 2011 -0800
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="windows-1251"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="8,00"
+	Version="9.00"
 	Name="testwin"
 	ProjectGUID="{DC516978-88CB-4F9A-A39A-C351C258613B}"
 	RootNamespace="testwin"
+	TargetFrameworkVersion="131072"
 	>
 	<Platforms>
 		<Platform
@@ -93,6 +94,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -106,6 +109,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -194,6 +200,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -207,6 +215,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -295,6 +306,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -308,6 +321,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -395,6 +411,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -408,6 +426,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -495,6 +516,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -508,6 +531,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
@@ -595,6 +621,8 @@
 				StackCommitSize="4096"
 				EntryPointSymbol="WinMainCRTStartup"
 				BaseAddress="0x00010000"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
 			/>
 			<Tool
 				Name="VCALinkTool"
@@ -608,6 +636,9 @@
 				OutputFile="$(PlatformName)\$(ConfigurationName)/testwin.bsc"
 			/>
 			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
 				Name="VCCodeSignTool"
 			/>
 			<Tool
--- a/Xcode-iPhoneOS/Demos/src/keyboard.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/Xcode-iPhoneOS/Demos/src/keyboard.c	Tue Feb 01 00:37:02 2011 -0800
@@ -34,7 +34,7 @@
 */
 typedef struct
 {
-    SDL_scancode scancode;      /* scancode of the key we want to map */
+    SDL_ScanCode scancode;      /* scancode of the key we want to map */
     int allow_no_mod;           /* is the map valid if the key has no modifiers? */
     SDLMod mod;                 /* what modifiers are allowed for the mapping */
     int index;                  /* what index in the font does the scancode map to */
@@ -103,7 +103,7 @@
 };
 
 /*
-	This function maps an SDL_keysym to an index in the bitmap font.
+	This function maps an SDL_KeySym to an index in the bitmap font.
 	It does so by scanning through the font mapping table one entry
 	at a time.
  
@@ -113,7 +113,7 @@
 	If there is no entry for the key, -1 is returned
 */
 int
-keyToIndex(SDL_keysym key)
+keyToIndex(SDL_KeySym key)
 {
     int i, index = -1;
     for (i = 0; i < TABLE_SIZE; i++) {
@@ -240,7 +240,7 @@
     SDL_Window *window;
     SDL_Event event;            /* last event received */
     SDLMod mod;                 /* key modifiers of last key we pushed */
-    SDL_scancode scancode;      /* scancode of last key we pushed */
+    SDL_ScanCode scancode;      /* scancode of last key we pushed */
 
     if (SDL_Init(SDL_INIT_VIDEO) < 0) {
         printf("Error initializing SDL: %s", SDL_GetError());
--- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Mon Jan 31 07:36:12 2011 -0800
+++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj	Tue Feb 01 00:37:02 2011 -0800
@@ -123,6 +123,10 @@
 		00D8DA2A1195093100638393 /* testsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 00D8DA1A1195093100638393 /* testsdl.c */; };
 		044E5F8511E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		044E5F8611E6051C0076F181 /* SDL_clipboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 044E5F8411E6051C0076F181 /* SDL_clipboard.h */; };
+		0469A10B12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		0469A10C12EE4BF100B846D6 /* SDL_scalemode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		0469A10D12EE4BF100B846D6 /* SDL_blendmode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10912EE4BF100B846D6 /* SDL_blendmode.h */; };
+		0469A10E12EE4BF100B846D6 /* SDL_scalemode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */; };
 		04BD000812E6671800899322 /* SDL_diskaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD8812E6671700899322 /* SDL_diskaudio.c */; };
 		04BD000912E6671800899322 /* SDL_diskaudio.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BDFD8912E6671700899322 /* SDL_diskaudio.h */; };
 		04BD001012E6671800899322 /* SDL_dummyaudio.c in Sources */ = {isa = PBXBuildFile; fileRef = 04BDFD9412E6671700899322 /* SDL_dummyaudio.c */; };
@@ -578,7 +582,7 @@
 		04DEA57311E6006A00386CAC /* SDL_input.h in Headers */ = {isa = PBXBuildFile; fileRef = 04DEA56F11E6006A00386CAC /* SDL_input.h */; };
 		04F2AF691104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		04F2AF6A1104AC4500D6DDF7 /* SDL_assert.h in Headers */ = {isa = PBXBuildFile; fileRef = 04F2AF681104AC4500D6DDF7 /* SDL_assert.h */; };
-		453773821207C518002F0F45 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 453773811207C518002F0F45 /* SDL_shape.h */; };
+		453773821207C518002F0F45 /* SDL_shape.h in Headers */ = {isa = PBXBuildFile; fileRef = 453773811207C518002F0F45 /* SDL_shape.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		8CB0A77811F6A87F00CBA2DE /* SDL_gesture.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		8CB0A77911F6A87F00CBA2DE /* SDL_touch.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		BECDF6760761BA81005FE872 /* SDL_cpuinfo.h in Headers */ = {isa = PBXBuildFile; fileRef = B2CF8DC405C444E400E5DC7F /* SDL_cpuinfo.h */; };
@@ -711,6 +715,8 @@
 		00D8DA1A1195093100638393 /* testsdl.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = testsdl.c; path = ../../test/automated/testsdl.c; sourceTree = SOURCE_ROOT; };
 		00F5D79E0990CA0D0051C449 /* UniversalBinaryNotes.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = UniversalBinaryNotes.rtf; sourceTree = "<group>"; };
 		044E5F8411E6051C0076F181 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = ../../include/SDL_clipboard.h; sourceTree = SOURCE_ROOT; };
+		0469A10912EE4BF100B846D6 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_blendmode.h; path = ../../include/SDL_blendmode.h; sourceTree = SOURCE_ROOT; };
+		0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_scalemode.h; path = ../../include/SDL_scalemode.h; sourceTree = SOURCE_ROOT; };
 		04BDFD7412E6671700899322 /* SDL_atomic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_atomic.c; sourceTree = "<group>"; };
 		04BDFD7512E6671700899322 /* SDL_spinlock.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_spinlock.c; sourceTree = "<group>"; };
 		04BDFD8812E6671700899322 /* SDL_diskaudio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_diskaudio.c; sourceTree = "<group>"; };
@@ -1141,14 +1147,13 @@
 		0153844A006D81B07F000001 /* Public Headers */ = {
 			isa = PBXGroup;
 			children = (
-				8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */,
-				8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */,
 				0C5AF5E501191D2B7F000001 /* begin_code.h */,
 				0C5AF5E601191D2B7F000001 /* close_code.h */,
 				0C5AF5FF01191D2B7F000001 /* SDL.h */,
 				04F2AF681104AC4500D6DDF7 /* SDL_assert.h */,
 				00CFA67A106B44CE00758660 /* SDL_atomic.h */,
 				0C5AF5E801191D2B7F000001 /* SDL_audio.h */,
+				0469A10912EE4BF100B846D6 /* SDL_blendmode.h */,
 				044E5F8411E6051C0076F181 /* SDL_clipboard.h */,
 				00CFA67B106B44CE00758660 /* SDL_compat.h */,
 				00162D3709BD1FA90037C8D0 /* SDL_config.h */,
@@ -1158,6 +1163,7 @@
 				0C5AF5EC01191D2B7F000001 /* SDL_endian.h */,
 				0C5AF5ED01191D2B7F000001 /* SDL_error.h */,
 				0C5AF5EE01191D2B7F000001 /* SDL_events.h */,
+				8CB0A77611F6A87F00CBA2DE /* SDL_gesture.h */,
 				00CFA67C106B44CE00758660 /* SDL_haptic.h */,
 				04DEA56F11E6006A00386CAC /* SDL_input.h */,
 				0C5AF5F001191D2B7F000001 /* SDL_joystick.h */,
@@ -1176,6 +1182,7 @@
 				00CFA67F106B44CE00758660 /* SDL_rect.h */,
 				00A6EBD91078D569001EEA06 /* SDL_revision.h */,
 				0C5AF5F801191D2B7F000001 /* SDL_rwops.h */,
+				0469A10A12EE4BF100B846D6 /* SDL_scalemode.h */,
 				00CFA680106B44CE00758660 /* SDL_scancode.h */,
 				453773811207C518002F0F45 /* SDL_shape.h */,
 				00162D3909BD1FA90037C8D0 /* SDL_stdinc.h */,
@@ -1183,6 +1190,7 @@
 				0C5AF5F901191D2B7F000001 /* SDL_syswm.h */,
 				0C5AF5FA01191D2B7F000001 /* SDL_thread.h */,
 				0C5AF5FB01191D2B7F000001 /* SDL_timer.h */,
+				8CB0A77711F6A87F00CBA2DE /* SDL_touch.h */,
 				0C5AF5FC01191D2B7F000001 /* SDL_types.h */,
 				0C5AF5FD01191D2B7F000001 /* SDL_version.h */,
 				0C5AF5FE01191D2B7F000001 /* SDL_video.h */,
@@ -1952,6 +1960,8 @@
 				04BD020712E6671800899322 /* Xvlib.h in Headers */,
 				04BD020812E6671800899322 /* Xvproto.h in Headers */,
 				04BD021512E6671800899322 /* Xvlibint.h in Headers */,
+				0469A10B12EE4BF100B846D6 /* SDL_blendmode.h in Headers */,
+				0469A10C12EE4BF100B846D6 /* SDL_scalemode.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2080,6 +2090,8 @@
 				04BD041F12E6671800899322 /* Xvlib.h in Headers */,
 				04BD042012E6671800899322 /* Xvproto.h in Headers */,
 				04BD042C12E6671800899322 /* Xvlibint.h in Headers */,
+				0469A10D12EE4BF100B846D6 /* SDL_blendmode.h in Headers */,
+				0469A10E12EE4BF100B846D6 /* SDL_scalemode.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2280,7 +2292,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "# The underlying scripts require calling hg to get revision info.\n# Since hg may not be in the standard Xcode path, I am sourcing .bashrc\n# But I don't know what to do if people are using other shells.\nif test -f ~/.bash_profile; then source ~/.bash_profile; fi\nif test -f ~/.bashrc; then source ~/.bashrc; fi\nsh ../../build-scripts/updaterev.sh\n";
+			shellScript = "# The official HG installer puts the binary in /usr/local/bin, so add that\n# to Xcode's path and see if the hg executable is found. Otherwise, source\n# the user's bash settings file as a last resort.\nPATH=$PATH:/usr/local/bin\nif ! which -s hg ; then\n    if test -f ~/.bash_profile; then source ~/.bash_profile; fi\nfi\nsh ../../build-scripts/updaterev.sh\n";
 		};
 		0083103E1072EA5700A531F1 /* ShellScript */ = {
 			isa = PBXShellScriptBuildPhase;
--- a/acinclude/libtool.m4	Mon Jan 31 07:36:12 2011 -0800
+++ b/acinclude/libtool.m4	Tue Feb 01 00:37:02 2011 -0800
@@ -3014,7 +3014,7 @@
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
     lt_cv_file_magic_cmd='$OBJDUMP -f'
   fi
   lt_cv_deplibs_check_method=pass_all
--- a/build-scripts/ltmain.sh	Mon Jan 31 07:36:12 2011 -0800
+++ b/build-scripts/ltmain.sh	Tue Feb 01 00:37:02 2011 -0800
@@ -2560,7 +2560,7 @@
     ;;
   *ar\ archive*) # could be an import, or static
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
-       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 |
 	$SED -n -e '
 	    1,100{
--- a/configure.in	Mon Jan 31 07:36:12 2011 -0800
+++ b/configure.in	Tue Feb 01 00:37:02 2011 -0800
@@ -301,6 +301,7 @@
     int a;
     void *x, *y, *z;
     __sync_lock_test_and_set(&a, 4);
+    __sync_lock_test_and_set(&x, y);
     __sync_fetch_and_add(&a, 1);
     __sync_bool_compare_and_swap(&a, 5, 10);
     __sync_bool_compare_and_swap(&x, y, z);
@@ -317,6 +318,7 @@
         ],[
         int a;
         __sync_lock_test_and_set(&a, 1);
+        __sync_lock_release(&a);
         ],[
         have_gcc_sync_lock_test_and_set=yes
         ])
@@ -2446,6 +2448,10 @@
         CheckWINDOWS
         CheckWINDOWSGL
         CheckDIRECTX
+
+        # Set up the core platform files
+        SOURCES="$SOURCES $srcdir/src/core/windows/*.c"
+
         # Set up files for the video library
         if test x$enable_video = xyes; then
             AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS)
@@ -2662,32 +2668,6 @@
             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
         fi
         ;;
-    *-riscos)
-        ARCH=riscos
-        CheckOSS
-        CheckPTHREAD
-        # Set up files for the video library
-        if test x$enable_video = xyes; then
-            AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
-            SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
-            SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
-            have_video=yes
-        fi
-        # Set up files for the joystick library
-        if test x$enable_joystick = xyes; then
-            AC_DEFINE(SDL_JOYSTICK_RISCOS)
-            SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
-            have_joystick=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            AC_DEFINE(SDL_TIMER_RISCOS)
-            SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
-            have_timers=yes
-        fi
-        # The RISC OS platform requires special setup.
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ljpeg -ltiff -lpng -lz"
-        ;;
     *)
         AC_MSG_ERROR([
 *** Unsupported host:  Please add to configure.in
@@ -2732,10 +2712,10 @@
 fi
 
 OBJECTS=`echo $SOURCES`
-DEPENDS=`echo $SOURCES`
+DEPENDS=`echo $SOURCES | tr ' ' '\n'`
 for EXT in asm cc m c S; do
     OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
-    DEPENDS=`echo "$DEPENDS" | sed "s,\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT,\\\\
+    DEPENDS=`echo "$DEPENDS" | sed "s,^\\([[^ ]]*\\)/\\([[^ ]]*\\)\\.$EXT\\$,\\\\
 \\$(objects)/\\2.lo: \\1/\\2.$EXT\\\\
 	\\$(LIBTOOL) --mode=compile \\$(CC) \\$(CFLAGS) \\$(EXTRA_CFLAGS) $DEPENDENCY_TRACKING_OPTIONS -c \\$< -o \\$@,g"`
 done
--- a/include/SDL.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL.h	Tue Feb 01 00:37:02 2011 -0800
@@ -116,7 +116,6 @@
 #define SDL_INIT_JOYSTICK       0x00000200
 #define SDL_INIT_HAPTIC         0x00001000
 #define SDL_INIT_NOPARACHUTE    0x00100000      /**< Don't catch fatal signals */
-#define SDL_INIT_EVENTTHREAD    0x01000000      /**< Not supported on all OS's */
 #define SDL_INIT_EVERYTHING     0x0000FFFF
 /*@}*/
 
--- a/include/SDL_assert.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_assert.h	Tue Feb 01 00:37:02 2011 -0800
@@ -50,7 +50,7 @@
 assert can have unique static variables associated with it.
 */
 
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && !defined(_WIN32_WCE)
 #include <intrin.h>
     #define SDL_TriggerBreakpoint() __debugbreak()
 #elif (defined(__GNUC__) && ((__i386__) || (__x86_64__)))
--- a/include/SDL_atomic.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_atomic.h	Tue Feb 01 00:37:02 2011 -0800
@@ -38,8 +38,16 @@
  *  SDL_AtomicDecRef()
  * 
  * Seriously, here be dragons!
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  *
- * These operations may, or may not, actually be implemented using
+ * You can find out a little more about lockless programming and the 
+ * subtle issues that can arise here:
+ * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
+ *
+ * There's also lots of good information here:
+ * http://www.1024cores.net/home/lock-free-algorithms
+ *
+ * These operations may or may not actually be implemented using
  * processor specific atomic operations. When possible they are
  * implemented as true processor specific atomic operations. When that
  * is not possible the are implemented using locks that *do* use the
@@ -58,9 +66,9 @@
 
 /* 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)
+#if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(_WIN32_WCE)
 #include <intrin.h>
-#define HAVE_MSC_ATOMICS
+#define HAVE_MSC_ATOMICS 1
 #endif
 
 /* Set up for C function definitions, even when using C++ */
@@ -114,19 +122,32 @@
 
 /*@}*//*SDL AtomicLock*/
 
+
+/* The compiler barrier prevents the compiler from reordering
+   reads and writes to globally visible variables across the call.
+*/
+#ifdef _MSC_VER
+void _ReadWriteBarrier(void);
+#pragma intrinsic(_ReadWriteBarrier)
+#define SDL_CompilerBarrier()   _ReadWriteBarrier()
+#elif defined(__GNUC__)
+#define SDL_CompilerBarrier()   __asm__ __volatile__ ("" : : : "memory")
+#else
+#define SDL_CompilerBarrier()   \
+({ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); })
+#endif
+
 /* Platform specific optimized versions of the atomic functions,
  * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
  */
 #ifndef SDL_DISABLE_ATOMIC_INLINE
 
-#if defined(HAVE_MSC_ATOMICS)
+#ifdef HAVE_MSC_ATOMICS
 
 #define SDL_AtomicSet(a, v)     _InterlockedExchange((long*)&(a)->value, (v))
-#define SDL_AtomicGet(a)        ((a)->value)
 #define SDL_AtomicAdd(a, v)     _InterlockedExchangeAdd((long*)&(a)->value, (v))
 #define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval))
-#define SDL_AtomicSetPtr(a, v)  (void)_InterlockedExchangePointer((a), (v))
-#define SDL_AtomicGetPtr(a)     (*(a))
+#define SDL_AtomicSetPtr(a, v)  _InterlockedExchangePointer((a), (v))
 #if _M_IX86
 #define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval))
 #else
@@ -136,30 +157,7 @@
 #elif defined(__MACOSX__)
 #include <libkern/OSAtomic.h>
 
-#define SDL_AtomicSet(a, v) \
-({                          \
-    int oldvalue;           \
-                            \
-    do {                    \
-        oldvalue = (a)->value; \
-    } while (!OSAtomicCompareAndSwap32Barrier(oldvalue, v, &(a)->value)); \
-                            \
-    oldvalue;               \
-})
-#define SDL_AtomicGet(a)        ((a)->value)
-#define SDL_AtomicAdd(a, v) \
-({                          \
-    int oldvalue;           \
-                            \
-    do {                    \
-        oldvalue = (a)->value; \
-    } while (!OSAtomicCompareAndSwap32Barrier(oldvalue, oldvalue+v, &(a)->value)); \
-                            \
-    oldvalue;               \
-})
-#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier(oldval, newval, &(a)->value)
-#define SDL_AtomicSetPtr(a, v)  (*(a) = v, OSMemoryBarrier())
-#define SDL_AtomicGetPtr(a)     (*(a))
+#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value)
 #if SIZEOF_VOIDP == 4
 #define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a))
 #elif SIZEOF_VOIDP == 8
@@ -169,11 +167,9 @@
 #elif defined(HAVE_GCC_ATOMICS)
 
 #define SDL_AtomicSet(a, v)     __sync_lock_test_and_set(&(a)->value, v)
-#define SDL_AtomicGet(a)        ((a)->value)
 #define SDL_AtomicAdd(a, v)     __sync_fetch_and_add(&(a)->value, v)
+#define SDL_AtomicSetPtr(a, v)  __sync_lock_test_and_set(a, v)
 #define SDL_AtomicCAS(a, oldval, newval) __sync_bool_compare_and_swap(&(a)->value, oldval, newval)
-#define SDL_AtomicSetPtr(a, v)  (*(a) = v, __sync_synchronize())
-#define SDL_AtomicGetPtr(a)     (*(a))
 #define SDL_AtomicCASPtr(a, oldval, newval) __sync_bool_compare_and_swap(a, oldval, newval)
 
 #endif
@@ -190,48 +186,6 @@
 #endif
 
 /**
- * \brief Set an atomic variable to a value.
- *
- * \return The previous value of the atomic variable.
- */
-#ifndef SDL_AtomicSet
-extern DECLSPEC int SDLCALL SDL_AtomicSet(SDL_atomic_t *a, int value);
-#endif
-
-/**
- * \brief Get the value of an atomic variable
- */
-#ifndef SDL_AtomicGet
-extern DECLSPEC int SDLCALL SDL_AtomicGet(SDL_atomic_t *a);
-#endif
-
-/**
- * \brief  Add to an atomic variable.
- *
- * \return The previous value of the atomic variable.
- */
-#ifndef SDL_AtomicAdd
-extern DECLSPEC int SDLCALL SDL_AtomicAdd(SDL_atomic_t *a, int value);
-#endif
-
-/**
- * \brief Increment an atomic variable used as a reference count.
- */
-#ifndef SDL_AtomicIncRef
-extern DECLSPEC void SDLCALL SDL_AtomicIncRef(SDL_atomic_t *a);
-#endif
-
-/**
- * \brief Decrement an atomic variable used as a reference count.
- *
- * \return SDL_TRUE if the variable has reached zero after decrementing,
- *         SDL_FALSE otherwise
- */
-#ifndef SDL_AtomicDecRef
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicDecRef(SDL_atomic_t *a);
-#endif
-
-/**
  * \brief Set an atomic variable to a new value if it is currently an old value.
  *
  * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
@@ -239,21 +193,71 @@
  * \note If you don't know what this function is for, you shouldn't use it!
 */
 #ifndef SDL_AtomicCAS
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval);
+#define SDL_AtomicCAS SDL_AtomicCAS_
+#endif
+extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval);
+
+/**
+ * \brief Set an atomic variable to a value.
+ *
+ * \return The previous value of the atomic variable.
+ */
+#ifndef SDL_AtomicSet
+static __inline__ int SDL_AtomicSet(SDL_atomic_t *a, int v)
+{
+    int value;
+    do {
+        value = a->value;
+    } while (!SDL_AtomicCAS(a, value, v));
+    return value;
+}
+#endif
+
+/**
+ * \brief Get the value of an atomic variable
+ */
+#ifndef SDL_AtomicGet
+static __inline__ int SDL_AtomicGet(SDL_atomic_t *a)
+{
+    int value = a->value;
+    SDL_CompilerBarrier();
+    return value;
+}
 #endif
 
 /**
- * \brief Set a pointer to a value atomically.
+ * \brief Add to an atomic variable.
+ *
+ * \return The previous value of the atomic variable.
+ *
+ * \note This same style can be used for any number operation
  */
-#ifndef SDL_AtomicSetPtr
-extern DECLSPEC void SDLCALL SDL_AtomicSetPtr(void** a, void* value);
+#ifndef SDL_AtomicAdd
+static __inline__ int SDL_AtomicAdd(SDL_atomic_t *a, int v)
+{
+    int value;
+    do {
+        value = a->value;
+    } while (!SDL_AtomicCAS(a, value, (value + v)));
+    return value;
+}
 #endif
 
 /**
- * \brief Get the value of a pointer atomically.
+ * \brief Increment an atomic variable used as a reference count.
  */
-#ifndef SDL_AtomicGetPtr
-extern DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void** a);
+#ifndef SDL_AtomicIncRef
+#define SDL_AtomicIncRef(a)    SDL_AtomicAdd(a, 1)
+#endif
+
+/**
+ * \brief Decrement an atomic variable used as a reference count.
+ *
+ * \return SDL_TRUE if the variable reached zero after decrementing,
+ *         SDL_FALSE otherwise
+ */
+#ifndef SDL_AtomicDecRef
+#define SDL_AtomicDecRef(a)    (SDL_AtomicAdd(a, -1) == 1)
 #endif
 
 /**
@@ -264,8 +268,38 @@
  * \note If you don't know what this function is for, you shouldn't use it!
 */
 #ifndef SDL_AtomicCASPtr
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void **a, void *oldval, void *newval);
+#define SDL_AtomicCASPtr SDL_AtomicCASPtr_
 #endif
+extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr_(void **a, void *oldval, void *newval);
+
+/**
+ * \brief Set a pointer to a value atomically.
+ *
+ * \return The previous value of the pointer.
+ */
+#ifndef SDL_AtomicSetPtr
+static __inline__ void* SDL_AtomicSetPtr(void* *a, void* v)
+{
+    void* value;
+    do {
+        value = *a;
+    } while (!SDL_AtomicCASPtr(a, value, v));
+    return value;
+}
+#endif
+
+/**
+ * \brief Get the value of a pointer atomically.
+ */
+#ifndef SDL_AtomicGetPtr
+static __inline__ void* SDL_AtomicGetPtr(void* *a)
+{
+    void* value = *a;
+    SDL_CompilerBarrier();
+    return value;
+}
+#endif
+
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
--- a/include/SDL_compat.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_compat.h	Tue Feb 01 00:37:02 2011 -0800
@@ -65,7 +65,7 @@
 /*@{*/
 
 /* Platform */
-#ifdef __WINDOWS__
+#ifdef __WIN32__
 #undef __WIN32__
 #define __WIN32__   1
 #endif
@@ -223,6 +223,9 @@
  */
 /*@{*/
 
+#define SDL_keysym		SDL_KeySym
+#define SDL_scancode	SDL_ScanCode
+
 /** 
  *  \name Renamed keys
  *
@@ -341,6 +344,13 @@
 #define SDL_RenderFill(X)  (X) ? SDL_RenderFillRect(X) : SDL_RenderClear()
 #define SDL_KillThread(X)
 
+/* The timeslice and timer resolution are no longer relevant */
+#define SDL_TIMESLICE		10
+#define TIMER_RESOLUTION	10
+
+typedef Uint32 (SDLCALL * SDL_OldTimerCallback) (Uint32 interval);
+extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_OldTimerCallback callback);
+
 extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
 
 /*@}*//*Compatibility*/
--- a/include/SDL_config.h.in	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_config.h.in	Tue Feb 01 00:37:02 2011 -0800
@@ -90,7 +90,7 @@
 #undef HAVE_REALLOC
 #undef HAVE_FREE
 #undef HAVE_ALLOCA
-#ifndef __WINDOWS__ /* Don't use C runtime versions of these on Windows */
+#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
 #undef HAVE_GETENV
 #undef HAVE_SETENV
 #undef HAVE_PUTENV
@@ -221,7 +221,6 @@
 #undef SDL_JOYSTICK_IOKIT
 #undef SDL_JOYSTICK_LINUX
 #undef SDL_JOYSTICK_NDS
-#undef SDL_JOYSTICK_RISCOS
 #undef SDL_JOYSTICK_WINMM
 #undef SDL_JOYSTICK_USBHID
 #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H
@@ -251,7 +250,6 @@
 #undef SDL_TIMER_BEOS
 #undef SDL_TIMER_DUMMY
 #undef SDL_TIMER_NDS
-#undef SDL_TIMER_RISCOS
 #undef SDL_TIMER_UNIX
 #undef SDL_TIMER_WINDOWS
 #undef SDL_TIMER_WINCE
@@ -265,7 +263,6 @@
 #undef SDL_VIDEO_DRIVER_NDS
 #undef SDL_VIDEO_DRIVER_PHOTON
 #undef SDL_VIDEO_DRIVER_QNXGF
-#undef SDL_VIDEO_DRIVER_RISCOS
 #undef SDL_VIDEO_DRIVER_WINDOWS
 #undef SDL_VIDEO_DRIVER_X11
 #undef SDL_VIDEO_DRIVER_X11_DYNAMIC
--- a/include/SDL_config_macosx.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_config_macosx.h	Tue Feb 01 00:37:02 2011 -0800
@@ -148,13 +148,23 @@
 #define SDL_VIDEO_DRIVER_X11_XV 1
 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
 
+#ifndef SDL_VIDEO_RENDER_OGL
 #define SDL_VIDEO_RENDER_OGL	1
+#endif
+#ifndef SDL_VIDEO_RENDER_X11
 #define SDL_VIDEO_RENDER_X11	1
+#endif
 
 /* Enable OpenGL support */
+#ifndef SDL_VIDEO_OPENGL
 #define SDL_VIDEO_OPENGL	1
+#endif
+#ifndef SDL_VIDEO_OPENGL_CGL
 #define SDL_VIDEO_OPENGL_CGL	1
+#endif
+#ifndef SDL_VIDEO_OPENGL_GLX
 #define SDL_VIDEO_OPENGL_GLX	1
+#endif
 
 /* Enable system power support */
 #define SDL_POWER_MACOSX 1
--- a/include/SDL_config_windows.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_config_windows.h	Tue Feb 01 00:37:02 2011 -0800
@@ -20,8 +20,8 @@
     slouken@libsdl.org
 */
 
-#ifndef _SDL_config_windows2_h
-#define _SDL_config_windows2_h
+#ifndef _SDL_config_windows_h
+#define _SDL_config_windows_h
 
 #include "SDL_platform.h"
 
@@ -178,15 +178,31 @@
 #define SDL_VIDEO_DRIVER_DUMMY	1
 #define SDL_VIDEO_DRIVER_WINDOWS	1
 
+#ifdef _WIN32_WCE
+#ifndef SDL_VIDEO_RENDER_GAPI
+#define SDL_VIDEO_RENDER_GAPI	1
+#endif
+#else
+#ifndef SDL_VIDEO_RENDER_D3D
 #define SDL_VIDEO_RENDER_D3D	1
+#endif
+#endif
+#ifndef SDL_VIDEO_RENDER_GDI
 #define SDL_VIDEO_RENDER_GDI	1
+#endif
 
 /* Enable OpenGL support */
 #ifndef _WIN32_WCE
+#ifndef SDL_VIDEO_OPENGL
 #define SDL_VIDEO_OPENGL	1
+#endif
+#ifndef SDL_VIDEO_OPENGL_WGL
 #define SDL_VIDEO_OPENGL_WGL	1
+#endif
+#ifndef SDL_VIDEO_RENDER_OGL
 #define SDL_VIDEO_RENDER_OGL	1
 #endif
+#endif
 
 /* Enable system power support */
 #define SDL_POWER_WINDOWS 1
@@ -196,4 +212,4 @@
 #define SDL_ASSEMBLY_ROUTINES	1
 #endif
 
-#endif /* _SDL_config_windows2_h */
+#endif /* _SDL_config_windows_h */
--- a/include/SDL_cpuinfo.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_cpuinfo.h	Tue Feb 01 00:37:02 2011 -0800
@@ -39,12 +39,27 @@
 /* *INDENT-ON* */
 #endif
 
+/* This is a guess for the cacheline size used for padding.
+ * Most x86 processors have a 64 byte cache line.
+ * The 64-bit PowerPC processors have a 128 byte cache line.
+ * We'll use the larger value to be generally safe.
+ */
+#define SDL_CACHELINE_SIZE  128
+
 /**
  *  This function returns the number of CPU cores available.
  */
 extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
 
 /**
+ *  This function returns the L1 cache line size of the CPU
+ *
+ *  This is useful for determining multi-threaded structure padding
+ *  or SIMD prefetch sizes.
+ */
+extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
+
+/**
  *  This function returns true if the CPU has the RDTSC instruction.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
--- a/include/SDL_events.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_events.h	Tue Feb 01 00:37:02 2011 -0800
@@ -151,7 +151,7 @@
     Uint8 repeat;       /**< Non-zero if this is a key repeat */
     Uint8 padding2;
     Uint8 padding3;
-    SDL_keysym keysym;  /**< The key that was pressed or released */
+    SDL_KeySym keysym;  /**< The key that was pressed or released */
 } SDL_KeyboardEvent;
 
 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
--- a/include/SDL_haptic.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_haptic.h	Tue Feb 01 00:37:02 2011 -0800
@@ -81,6 +81,10 @@
  *    return 0; // Success
  * }
  * \endcode
+ *
+ * You can also find out more information on my blog:
+ * http://bobbens.dyndns.org/journal/2010/sdl_haptic/
+ *
  * \author Edgar Simo Serra
  */
 
--- a/include/SDL_keyboard.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_keyboard.h	Tue Feb 01 00:37:02 2011 -0800
@@ -45,13 +45,13 @@
 /**
  *  \brief The SDL keysym structure, used in key events.
  */
-typedef struct SDL_keysym
+typedef struct SDL_KeySym
 {
-    SDL_scancode scancode;      /**< SDL physical key code - see ::SDL_scancode for details */
+    SDL_ScanCode scancode;      /**< SDL physical key code - see ::SDL_ScanCode for details */
     SDLKey sym;                 /**< SDL virtual key code - see ::SDLKey for details */
     Uint16 mod;                 /**< current key modifiers */
     Uint32 unicode;             /**< \deprecated use SDL_TextInputEvent instead */
-} SDL_keysym;
+} SDL_KeySym;
 
 /* Function prototypes */
 
@@ -65,7 +65,7 @@
  *  
  *  \param numkeys if non-NULL, receives the length of the returned array.
  *  
- *  \return An array of key states. Indexes into this array are obtained by using ::SDL_scancode values.
+ *  \return An array of key states. Indexes into this array are obtained by using ::SDL_ScanCode values.
  *  
  *  \b Example:
  *  \code
@@ -97,17 +97,17 @@
  *  
  *  \sa SDL_GetKeyName()
  */
-extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_scancode scancode);
+extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_ScanCode scancode);
 
 /**
  *  \brief Get the scancode corresponding to the given key code according to the
  *         current keyboard layout.
  *  
- *  See ::SDL_scancode for details.
+ *  See ::SDL_ScanCode for details.
  *  
  *  \sa SDL_GetScancodeName()
  */
-extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
+extern DECLSPEC SDL_ScanCode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
 
 /**
  *  \brief Get a human-readable name for a scancode.
@@ -117,9 +117,9 @@
  *          copy it.  If the scancode doesn't have a name, this function returns
  *          an empty string ("").
  *
- *  \sa SDL_scancode
+ *  \sa SDL_ScanCode
  */
-extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode
+extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_ScanCode
                                                         scancode);
 
 /**
--- a/include/SDL_main.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_main.h	Tue Feb 01 00:37:02 2011 -0800
@@ -31,7 +31,7 @@
  *  Redefine main() on some platforms so that it is called by SDL.
  */
 
-#if defined(__WINDOWS__) || \
+#if defined(__WIN32__) || \
     (defined(__MWERKS__) && !defined(__BEOS__)) || \
     defined(__SYMBIAN32__) || defined(__IPHONEOS__) || \
     defined(__ANDROID__)
@@ -66,7 +66,7 @@
 
 
 /* From the SDL library code -- needed for registering the app on Win32 */
-#ifdef __WINDOWS__
+#ifdef __WIN32__
 
 #include "begin_code.h"
 #ifdef __cplusplus
--- a/include/SDL_mutex.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_mutex.h	Tue Feb 01 00:37:02 2011 -0800
@@ -164,6 +164,31 @@
 
 /**
  *  Create a condition variable.
+ *
+ *  Typical use of condition variables:
+ *
+ *  Thread A:
+ *    SDL_LockMutex(lock);
+ *    while ( ! condition ) {
+ *        SDL_CondWait(cond, lock);
+ *    }
+ *    SDL_UnlockMutex(lock);
+ *
+ *  Thread B:
+ *    SDL_LockMutex(lock);
+ *    ...
+ *    condition = true;
+ *    ...
+ *    SDL_CondSignal(cond);
+ *    SDL_UnlockMutex(lock);
+ *
+ *  There is some discussion whether to signal the condition variable
+ *  with the mutex locked or not.  There is some potential performance
+ *  benefit to unlocking first on some platforms, but there are some
+ *  potential race conditions depending on how your code is structured.
+ *
+ *  In general it's safer to signal the condition variable while the
+ *  mutex is locked.
  */
 extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
 
@@ -181,6 +206,7 @@
 
 /**
  *  Restart all threads that are waiting on the condition variable.
+ *
  *  \return 0 or -1 on error.
  */
 extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
--- a/include/SDL_opengl.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_opengl.h	Tue Feb 01 00:37:02 2011 -0800
@@ -31,7 +31,7 @@
 
 #include "SDL_config.h"
 
-#ifdef __WINDOWS__
+#ifdef __WIN32__
 #define WIN32_LEAN_AND_MEAN
 #ifndef NOMINMAX
 #define NOMINMAX                /* Don't defined min() and max() */
--- a/include/SDL_platform.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_platform.h	Tue Feb 01 00:37:02 2011 -0800
@@ -125,8 +125,8 @@
 #define __SOLARIS__	1
 #endif
 #if defined(WIN32) || defined(_WIN32)
-#undef __WINDOWS__
-#define __WINDOWS__	1
+#undef __WIN32__
+#define __WIN32__	1
 #endif
 
 #if defined(__NDS__)
--- a/include/SDL_rwops.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_rwops.h	Tue Feb 01 00:37:02 2011 -0800
@@ -83,7 +83,7 @@
     Uint32 type;
     union
     {
-#ifdef __WINDOWS__
+#ifdef __WIN32__
         struct
         {
             SDL_bool append;
--- a/include/SDL_scancode.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_scancode.h	Tue Feb 01 00:37:02 2011 -0800
@@ -35,7 +35,7 @@
  *  \brief The SDL keyboard scancode representation.
  *  
  *  Values of this type are used to represent keyboard keys, among other places
- *  in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the
+ *  in the \link SDL_KeySym::scancode key.keysym.scancode \endlink field of the
  *  SDL_Event structure.
  *  
  *  The values in this enumeration are based on the USB usage page standard:
@@ -392,7 +392,7 @@
 
     SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes 
                                  for array bounds */
-} SDL_scancode;
+} SDL_ScanCode;
 
 #endif /* _SDL_scancode_h */
 
--- a/include/SDL_thread.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_thread.h	Tue Feb 01 00:37:02 2011 -0800
@@ -55,7 +55,7 @@
  */
 typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
 
-#if defined(__WINDOWS__) && !defined(HAVE_LIBC)
+#if defined(__WIN32__) && !defined(HAVE_LIBC)
 /**
  *  \file SDL_thread.h
  *  
--- a/include/SDL_timer.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_timer.h	Tue Feb 01 00:37:02 2011 -0800
@@ -41,104 +41,50 @@
 #endif
 
 /**
- *  This is the OS scheduler timeslice, in milliseconds.
- */
-#define SDL_TIMESLICE		10
-
-/**
- *  This is the maximum resolution of the SDL timer on all platforms.
- */
-#define TIMER_RESOLUTION	10      /**< Experimentally determined */
-
-/**
- *  Get the number of milliseconds since the SDL library initialization.
+ * \brief Get the number of milliseconds since the SDL library initialization.
  *  
- *  Note that this value wraps if the program runs for more than ~49 days.
+ * \note This value wraps if the program runs for more than ~49 days.
  */
 extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
 
 /**
- *  Wait a specified number of milliseconds before returning.
+ * \brief Wait a specified number of milliseconds before returning.
  */
 extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
 
 /**
  *  Function prototype for the timer callback function.
- */
-typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval);
-
-/**
- *  Set a callback to run after the specified number of milliseconds has
- *  elapsed. The callback function is passed the current timer interval
- *  and returns the next timer interval.  If the returned value is the 
- *  same as the one passed in, the periodic alarm continues, otherwise a
- *  new alarm is scheduled.  If the callback returns 0, the periodic alarm
- *  is cancelled.
- *  
- *  To cancel a currently running timer, call 
- *  \code SDL_SetTimer(0, NULL); \endcode
- *  
- *  The timer callback function may run in a different thread than your
- *  main code, and so shouldn't call any functions from within itself.
- *  
- *  The maximum resolution of this timer is 10 ms, which means that if
- *  you request a 16 ms timer, your callback will run approximately 20 ms
- *  later on an unloaded system.  If you wanted to set a flag signaling
- *  a frame update at 30 frames per second (every 33 ms), you might set a 
- *  timer for 30 ms:
- *  \code
- *    SDL_SetTimer((33/10)*10, flag_update);
- *  \endcode
- *  
- *  If you use this function, you need to pass ::SDL_INIT_TIMER to SDL_Init().
- *  
- *  Under UNIX, you should not use raise or use SIGALRM and this function
- *  in the same program, as it is implemented using setitimer().  You also
- *  should not use this function in multi-threaded applications as signals
- *  to multi-threaded apps have undefined behavior in some implementations.
- *  
- *  \return 0 if successful, or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval,
-                                         SDL_TimerCallback callback);
-
-/**
- *  \name Peter timers
- *  New timer API, supports multiple timers
- *  Written by Stephane Peter <megastep@lokigames.com>
- */
-/*@{*/
-
-/**
- *  Function prototype for the new timer callback function.
  *  
  *  The callback function is passed the current timer interval and returns
  *  the next timer interval.  If the returned value is the same as the one
  *  passed in, the periodic alarm continues, otherwise a new alarm is
  *  scheduled.  If the callback returns 0, the periodic alarm is cancelled.
  */
-typedef Uint32(SDLCALL * SDL_NewTimerCallback) (Uint32 interval, void *param);
+typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
 
 /**
- *  Definition of the timer ID type.
+ * Definition of the timer ID type.
  */
-typedef struct _SDL_TimerID *SDL_TimerID;
+typedef int SDL_TimerID;
 
 /**
- *  Add a new timer to the pool of timers already running.
- *  \return A timer ID, or NULL when an error occurs.
+ * \brief Add a new timer to the pool of timers already running.
+ *
+ * \return A timer ID, or NULL when an error occurs.
  */
 extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
-                                                 SDL_NewTimerCallback
-                                                 callback, void *param);
+                                                 SDL_TimerCallback callback,
+                                                 void *param);
 
 /**
- *  Remove one of the multiple timers knowing its ID.
- *  \return A boolean value indicating success or failure.
+ * \brief Remove a timer knowing its ID.
+ *
+ * \return A boolean value indicating success or failure.
+ *
+ * \warning It is not safe to remove a timer multiple times.
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
 
-/*@}*//*Peter timers*/
 
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
--- a/include/SDL_video.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/SDL_video.h	Tue Feb 01 00:37:02 2011 -0800
@@ -278,8 +278,6 @@
  *  \param driver_name Initialize a specific driver by name, or NULL for the 
  *                     default video driver.
  *  
- *  \param flags FIXME: Still needed?
- *  
  *  \return 0 on success, -1 on error
  *  
  *  This function initializes the video subsystem; setting up a connection
@@ -288,8 +286,7 @@
  *  
  *  \sa SDL_VideoQuit()
  */
-extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name,
-                                          Uint32 flags);
+extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name);
 
 /**
  *  \brief Shuts down the video subsystem.
--- a/include/begin_code.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/begin_code.h	Tue Feb 01 00:37:02 2011 -0800
@@ -42,7 +42,7 @@
 #  else
 #   define DECLSPEC	__declspec(export)
 #  endif
-# elif defined(__WINDOWS__)
+# elif defined(__WIN32__)
 #  ifdef __BORLANDC__
 #   ifdef BUILD_SDL
 #    define DECLSPEC
@@ -63,7 +63,7 @@
 
 /* By default SDL uses the C calling convention */
 #ifndef SDLCALL
-#if defined(__WINDOWS__) && !defined(__GNUC__)
+#if defined(__WIN32__) && !defined(__GNUC__)
 #define SDLCALL __cdecl
 #else
 #define SDLCALL
--- a/include/doxyfile	Mon Jan 31 07:36:12 2011 -0800
+++ b/include/doxyfile	Tue Feb 01 00:37:02 2011 -0800
@@ -124,10 +124,7 @@
 # If left blank the directory from which doxygen is run is used as the 
 # path to strip.
 
-STRIP_FROM_PATH        = ../ \
-                         C:/source/svn.libsdl.org/trunk/ \
-                         C:\source\svn.libsdl.org\trunk\ \
-                         ..\
+STRIP_FROM_PATH        =
 
 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
 # the path mentioned in the documentation of a class, which tells 
@@ -572,7 +569,7 @@
 # directories like "/usr/src/myproject". Separate the files or directories 
 # with spaces.
 
-INPUT                  = ..
+INPUT                  = .
 
 # This tag can be used to specify the character encoding of the source files 
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
@@ -652,10 +649,7 @@
 # against the file with absolute path, so to exclude all test directories 
 # for example use the pattern */test/*
 
-EXCLUDE_PATTERNS       = */.svn/* \
-                         */bin/* \
-                         */lib/* \
-                         */obj/*
+EXCLUDE_PATTERNS       =
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
 # (namespaces, classes, functions, etc.) that should be excluded from the 
@@ -669,9 +663,7 @@
 # directories that contain example code fragments that are included (see 
 # the \include command).
 
-EXAMPLE_PATH           = ../test \
-                         ../Xcode \
-                         ../Xcode-iPhoneOS
+EXAMPLE_PATH           =
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the 
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
--- a/src/SDL.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/SDL.c	Tue Feb 01 00:37:02 2011 -0800
@@ -39,7 +39,7 @@
 extern int SDL_TimerInit(void);
 extern void SDL_TimerQuit(void);
 #endif
-#if defined(__WINDOWS__)
+#if defined(__WIN32__)
 extern int SDL_HelperWindowCreate(void);
 extern int SDL_HelperWindowDestroy(void);
 #endif
@@ -59,7 +59,7 @@
 #if !SDL_VIDEO_DISABLED
     /* Initialize the video/event subsystem */
     if ((flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO)) {
-        if (SDL_VideoInit(NULL, (flags & SDL_INIT_EVENTTHREAD)) < 0) {
+        if (SDL_VideoInit(NULL) < 0) {
             return (-1);
         }
         SDL_initialized |= SDL_INIT_VIDEO;
@@ -147,7 +147,7 @@
     /* Clear the error message */
     SDL_ClearError();
 
-#if defined(__WINDOWS__)
+#if defined(__WIN32__)
     if (SDL_HelperWindowCreate() < 0) {
         return -1;
     }
@@ -220,7 +220,7 @@
     fflush(stdout);
 #endif
 
-#if defined(__WINDOWS__)
+#if defined(__WIN32__)
     SDL_HelperWindowDestroy();
 #endif
     SDL_QuitSubSystem(SDL_INIT_EVERYTHING);
@@ -312,7 +312,7 @@
     return "RISC OS";
 #elif __SOLARIS__
     return "Solaris";
-#elif __WINDOWS__
+#elif __WIN32__
 #ifdef _WIN32_WCE
     return "Windows CE";
 #else
@@ -325,12 +325,11 @@
 #endif
 }
 
-#if defined(__WINDOWS__)
+#if defined(__WIN32__)
 
 #if !defined(HAVE_LIBC) || (defined(__WATCOMC__) && defined(BUILD_DLL))
 /* Need to include DllMain() on Watcom C for some reason.. */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "core/windows/SDL_windows.h"
 
 BOOL APIENTRY
 _DllMainCRTStartup(HANDLE hModule,
@@ -347,6 +346,6 @@
 }
 #endif /* building DLL with Watcom C */
 
-#endif /* __WINDOWS__ */
+#endif /* __WIN32__ */
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/SDL_android.cpp	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,258 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#include "SDL_android.h"
-
-extern "C" {
-#include "events/SDL_events_c.h"
-#include "video/android/SDL_androidkeyboard.h"
-#include "video/android/SDL_androidtouch.h"
-#include "video/android/SDL_androidvideo.h"
-
-/* Impelemented in audio/android/SDL_androidaudio.c */
-extern void Android_RunAudioThread();
-} // C
-
-/*******************************************************************************
- This file links the Java side of Android with libsdl
-*******************************************************************************/
-#include <jni.h>
-#include <android/log.h>
-
-
-/*******************************************************************************
-                               Globals
-*******************************************************************************/
-static JNIEnv* mEnv = NULL;
-static JNIEnv* mAudioEnv = NULL;
-
-// Main activity
-static jclass mActivityClass;
-
-// method signatures
-static jmethodID midCreateGLContext;
-static jmethodID midFlipBuffers;
-static jmethodID midAudioInit;
-static jmethodID midAudioWriteShortBuffer;
-static jmethodID midAudioWriteByteBuffer;
-static jmethodID midAudioQuit;
-
-// Accelerometer data storage
-static float fLastAccelerometer[3];
-
-
-/*******************************************************************************
-                 Functions called by JNI
-*******************************************************************************/
-
-// Library init
-extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
-{
-    return JNI_VERSION_1_4;
-}
-
-// Called before SDL_main() to initialize JNI bindings
-extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls)
-{
-    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
-
-    mEnv = env;
-    mActivityClass = cls;
-
-    midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass,
-                                "createGLContext","()V");
-    midFlipBuffers = mEnv->GetStaticMethodID(mActivityClass,
-                                "flipBuffers","()V");
-    midAudioInit = mEnv->GetStaticMethodID(mActivityClass, 
-                                "audioInit", "(IZZI)Ljava/lang/Object;");
-    midAudioWriteShortBuffer = mEnv->GetStaticMethodID(mActivityClass,
-                                "audioWriteShortBuffer", "([S)V");
-    midAudioWriteByteBuffer = mEnv->GetStaticMethodID(mActivityClass,
-                                "audioWriteByteBuffer", "([B)V");
-    midAudioQuit = mEnv->GetStaticMethodID(mActivityClass,
-                                "audioQuit", "()V");
-
-    if(!midCreateGLContext || !midFlipBuffers || !midAudioInit ||
-       !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) {
-        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly");
-    }
-}
-
-// Resize
-extern "C" void Java_org_libsdl_app_SDLActivity_onNativeResize(
-                                    JNIEnv* env, jclass jcls,
-                                    jint width, jint height, jint format)
-{
-    Android_SetScreenResolution(width, height, format);
-}
-
-// Keydown
-extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
-                                    JNIEnv* env, jclass jcls, jint keycode)
-{
-    Android_OnKeyDown(keycode);
-}
-
-// Keyup
-extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
-                                    JNIEnv* env, jclass jcls, jint keycode)
-{
-    Android_OnKeyUp(keycode);
-}
-
-// Touch
-extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(
-                                    JNIEnv* env, jclass jcls,
-                                    jint action, jfloat x, jfloat y, jfloat p)
-{
-    Android_OnTouch(action, x, y, p);
-}
-
-// Accelerometer
-extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel(
-                                    JNIEnv* env, jclass jcls,
-                                    jfloat x, jfloat y, jfloat z)
-{
-    fLastAccelerometer[0] = x;
-    fLastAccelerometer[1] = y;
-    fLastAccelerometer[2] = z;   
-}
-
-// Quit
-extern "C" void Java_org_libsdl_app_SDLActivity_nativeQuit(
-                                    JNIEnv* env, jclass cls)
-{    
-    // Inject a SDL_QUIT event
-    SDL_SendQuit();
-}
-
-extern "C" void Java_org_libsdl_app_SDLActivity_nativeRunAudioThread(
-                                    JNIEnv* env, jclass cls)
-{
-    /* This is the audio thread, with a different environment */
-    mAudioEnv = env;
-
-    Android_RunAudioThread();
-}
-
-
-/*******************************************************************************
-             Functions called by SDL into Java
-*******************************************************************************/
-extern "C" void Android_JNI_CreateContext()
-{
-    mEnv->CallStaticVoidMethod(mActivityClass, midCreateGLContext); 
-}
-
-extern "C" void Android_JNI_SwapWindow()
-{
-    mEnv->CallStaticVoidMethod(mActivityClass, midFlipBuffers); 
-}
-
-extern "C" void Android_JNI_SetActivityTitle(const char *title)
-{
-    jmethodID mid;
-
-    mid = mEnv->GetStaticMethodID(mActivityClass,"setActivityTitle","(Ljava/lang/String;)V");
-    if (mid) {
-        mEnv->CallStaticVoidMethod(mActivityClass, mid, mEnv->NewStringUTF(title));
-    }
-}
-
-extern "C" void Android_JNI_GetAccelerometerValues(float values[3])
-{
-    int i;
-    for (i = 0; i < 3; ++i) {
-        values[i] = fLastAccelerometer[i];
-    }
-}
-
-//
-// Audio support
-//
-static jboolean audioBuffer16Bit = JNI_FALSE;
-static jboolean audioBufferStereo = JNI_FALSE;
-static jobject audioBuffer = NULL;
-static void* audioBufferPinned = NULL;
-
-extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
-{
-    int audioBufferFrames;
-
-    __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
-    audioBuffer16Bit = is16Bit;
-    audioBufferStereo = channelCount > 1;
-
-    audioBuffer = mEnv->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
-
-    if (audioBuffer == NULL) {
-        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: didn't get back a good audio buffer!");
-        return 0;
-    }
-    audioBuffer = mEnv->NewGlobalRef(audioBuffer);
-
-    jboolean isCopy = JNI_FALSE;
-    if (audioBuffer16Bit) {
-        audioBufferPinned = mEnv->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
-        audioBufferFrames = mEnv->GetArrayLength((jshortArray)audioBuffer);
-    } else {
-        audioBufferPinned = mEnv->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
-        audioBufferFrames = mEnv->GetArrayLength((jbyteArray)audioBuffer);
-    }
-    if (audioBufferStereo) {
-        audioBufferFrames /= 2;
-    }
-
-    return audioBufferFrames;
-}
-
-extern "C" void * Android_JNI_GetAudioBuffer()
-{
-    return audioBufferPinned;
-}
-
-extern "C" void Android_JNI_WriteAudioBuffer()
-{
-    if (audioBuffer16Bit) {
-        mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT);
-        mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer);
-    } else {
-        mAudioEnv->ReleaseByteArrayElements((jbyteArray)audioBuffer, (jbyte *)audioBufferPinned, JNI_COMMIT);
-        mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteByteBuffer, (jbyteArray)audioBuffer);
-    }
-
-    /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */
-}
-
-extern "C" void Android_JNI_CloseAudioDevice()
-{
-    mEnv->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
-
-    if (audioBuffer) {
-        mEnv->DeleteGlobalRef(audioBuffer);
-        audioBuffer = NULL;
-        audioBufferPinned = NULL;
-    }
-}
-
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/SDL_android.h	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* Set up for C function definitions, even when using C++ */
-#ifdef __cplusplus
-/* *INDENT-OFF* */
-extern "C" {
-/* *INDENT-ON* */
-#endif
-
-/* Interface from the SDL library into the Android Java activity */
-extern void Android_JNI_CreateContext();
-extern void Android_JNI_SwapWindow();
-extern void Android_JNI_SetActivityTitle(const char *title);
-extern void Android_JNI_GetAccelerometerValues(float values[3]);
-
-// Audio support
-extern int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames);
-extern void* Android_JNI_GetAudioBuffer();
-extern void Android_JNI_WriteAudioBuffer();
-extern void Android_JNI_CloseAudioDevice();
-
-/* Ends C function definitions when using C++ */
-#ifdef __cplusplus
-/* *INDENT-OFF* */
-}
-/* *INDENT-ON* */
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/SDL_assert.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/SDL_assert.c	Tue Feb 01 00:37:02 2011 -0800
@@ -26,9 +26,12 @@
 #include "SDL_assert_c.h"
 #include "video/SDL_sysvideo.h"
 
-#ifdef __WINDOWS__
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#ifdef __WIN32__
+#include "core/windows/SDL_windows.h"
+
+#ifndef WS_OVERLAPPEDWINDOW
+#define WS_OVERLAPPEDWINDOW 0
+#endif
 #else  /* fprintf, _exit(), etc. */
 #include <stdio.h>
 #include <stdlib.h>
@@ -57,11 +60,12 @@
 static void
 debug_print(const char *fmt, ...)
 {
-#ifdef __WINDOWS__
+#ifdef __WIN32__
     /* Format into a buffer for OutputDebugStringA(). */
     char buf[1024];
     char *startptr;
     char *ptr;
+    LPTSTR tstr;
     int len;
     va_list ap;
     va_start(ap, fmt);
@@ -78,15 +82,19 @@
     for (ptr = startptr; *ptr; ptr++) {
         if (*ptr == '\n') {
             *ptr = '\0';
-            OutputDebugStringA(startptr);
-            OutputDebugStringA("\r\n");
+            tstr = WIN_UTF8ToString(startptr);
+            OutputDebugString(tstr);
+            SDL_free(tstr);
+            OutputDebugString(TEXT("\r\n"));
             startptr = ptr+1;
         }
     }
 
     /* catch that last piece if it didn't have a newline... */
     if (startptr != ptr) {
-        OutputDebugStringA(startptr);
+        tstr = WIN_UTF8ToString(startptr);
+        OutputDebugString(tstr);
+        SDL_free(tstr);
     }
 #else
     /* Unix has it easy. Just dump it to stderr. */
@@ -99,7 +107,7 @@
 }
 
 
-#ifdef __WINDOWS__
+#ifdef __WIN32__
 static SDL_assert_state SDL_Windows_AssertChoice = SDL_ASSERTION_ABORT;
 static const SDL_assert_data *SDL_Windows_AssertData = NULL;
 
@@ -113,6 +121,7 @@
             /* !!! FIXME: all this code stinks. */
             const SDL_assert_data *data = SDL_Windows_AssertData;
             char buf[1024];
+            LPTSTR tstr;
             const int w = 100;
             const int h = 25;
             const int gap = 10;
@@ -121,14 +130,14 @@
             int len;
             int i;
             static const struct { 
-                const char *name;
+                LPCTSTR name;
                 SDL_assert_state state;
             } buttons[] = {
-                {"Abort", SDL_ASSERTION_ABORT },
-                {"Break", SDL_ASSERTION_BREAK },
-                {"Retry", SDL_ASSERTION_RETRY },
-                {"Ignore", SDL_ASSERTION_IGNORE },
-                {"Always Ignore", SDL_ASSERTION_ALWAYS_IGNORE },
+                {TEXT("Abort"), SDL_ASSERTION_ABORT },
+                {TEXT("Break"), SDL_ASSERTION_BREAK },
+                {TEXT("Retry"), SDL_ASSERTION_RETRY },
+                {TEXT("Ignore"), SDL_ASSERTION_IGNORE },
+                {TEXT("Always Ignore"), SDL_ASSERTION_ALWAYS_IGNORE },
             };
 
             len = (int) SDL_snprintf(buf, sizeof (buf), 
@@ -140,14 +149,16 @@
                 buf[sizeof (buf) - 1] = '\0';
             }
 
-            CreateWindowA("STATIC", buf,
+            tstr = WIN_UTF8ToString(buf);
+            CreateWindow(TEXT("STATIC"), tstr,
                          WS_VISIBLE | WS_CHILD | SS_LEFT,
                          x, y, 550, 100,
                          hwnd, (HMENU) 1, NULL, NULL);
+            SDL_free(tstr);
             y += 110;
 
             for (i = 0; i < (sizeof (buttons) / sizeof (buttons[0])); i++) {
-                CreateWindowA("BUTTON", buttons[i].name,
+                CreateWindow(TEXT("BUTTON"), buttons[i].name,
                          WS_VISIBLE | WS_CHILD,
                          x, y, w, h,
                          hwnd, (HMENU) buttons[i].state, NULL, NULL);
@@ -248,7 +259,7 @@
 
 static void SDL_ExitProcess(int exitcode)
 {
-#ifdef __WINDOWS__
+#ifdef __WIN32__
     ExitProcess(42);
 #else
     _exit(42);
@@ -311,7 +322,7 @@
 
     /* platform-specific UI... */
 
-#ifdef __WINDOWS__
+#ifdef __WIN32__
     state = SDL_PromptAssertion_windows(data);
 
 #elif __MACOSX__
--- a/src/SDL_compat.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/SDL_compat.c	Tue Feb 01 00:37:02 2011 -0800
@@ -1760,6 +1760,31 @@
     return previous;
 }
 
+static Uint32
+SDL_SetTimerCallback(Uint32 interval, void* param)
+{
+    return ((SDL_OldTimerCallback)param)(interval);
+}
+
+int
+SDL_SetTimer(Uint32 interval, SDL_OldTimerCallback callback)
+{
+    static SDL_TimerID compat_timer;
+
+    if (compat_timer) {
+        SDL_RemoveTimer(compat_timer);
+        compat_timer = 0;
+    }
+
+    if (interval && callback) {
+        compat_timer = SDL_AddTimer(interval, SDL_SetTimerCallback, callback);
+        if (!compat_timer) {
+            return -1;
+        }
+    }
+    return 0;
+}
+
 int
 SDL_putenv(const char *_var)
 {
--- a/src/atomic/SDL_atomic.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/atomic/SDL_atomic.c	Tue Feb 01 00:37:02 2011 -0800
@@ -70,61 +70,8 @@
     SDL_AtomicUnlock(&locks[index]);
 }
 
-#undef SDL_AtomicSet
-int
-SDL_AtomicSet(SDL_atomic_t *a, int value)
-{
-    int oldvalue;
-
-    enterLock(a);
-    oldvalue = a->value;
-    a->value = value;
-    leaveLock(a);
-
-    return oldvalue;
-}
-
-#undef SDL_AtomicGet
-int
-SDL_AtomicGet(SDL_atomic_t *a)
-{
-    /* Assuming integral reads on this platform, we're safe here since the
-       functions that set the variable have the necessary memory barriers.
-    */
-    return a->value;
-}
-
-#undef SDL_AtomicAdd
-int
-SDL_AtomicAdd(SDL_atomic_t *a, int value)
-{
-    int oldvalue;
-
-    enterLock(a);
-    oldvalue = a->value;
-    a->value += value;
-    leaveLock(a);
-
-    return oldvalue;
-}
-
-#undef SDL_AtomicIncRef
-void
-SDL_AtomicIncRef(SDL_atomic_t *a)
-{
-    SDL_AtomicAdd(a, 1);
-}
-
-#undef SDL_AtomicDecRef
 SDL_bool
-SDL_AtomicDecRef(SDL_atomic_t *a)
-{
-    return SDL_AtomicAdd(a, -1) == 1;
-}
-
-#undef SDL_AtomicCAS
-SDL_bool
-SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
+SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval)
 {
     SDL_bool retval = SDL_FALSE;
 
@@ -138,28 +85,8 @@
     return retval;
 }
 
-#undef SDL_AtomicSetPtr
-void
-SDL_AtomicSetPtr(void** a, void* value)
-{
-    void *prevval;
-    do {
-        prevval = *a;
-    } while (!SDL_AtomicCASPtr(a, prevval, value));
-}
-
-#undef SDL_AtomicGetPtr
-void*
-SDL_AtomicGetPtr(void** a)
-{
-    /* Assuming integral reads on this platform, we're safe here since the
-       functions that set the pointer have the necessary memory barriers.
-    */
-    return *a;
-}
-
-#undef SDL_AtomicCASPtr
-SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
+SDL_bool
+SDL_AtomicCASPtr_(void **a, void *oldval, void *newval)
 {
     SDL_bool retval = SDL_FALSE;
 
--- a/src/atomic/SDL_spinlock.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/atomic/SDL_spinlock.c	Tue Feb 01 00:37:02 2011 -0800
@@ -25,8 +25,8 @@
 #include "SDL_timer.h"
 
 /* Don't do the check for Visual Studio 2005, it's safe here */
-#if defined(_MSC_VER)
-#include <intrin.h>
+#ifdef __WIN32__
+#include "../core/windows/SDL_windows.h"
 #endif
 
 /* This function is where all the magic happens... */
@@ -35,12 +35,12 @@
 {
 #if defined(_MSC_VER)
     SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
-    return (_InterlockedExchange((long*)lock, 1) == 0);
+    return (InterlockedExchange((long*)lock, 1) == 0);
 
 #elif defined(__MACOSX__)
     return OSAtomicCompareAndSwap32Barrier(0, 1, lock);
 
-#elif defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
+#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
     return (__sync_lock_test_and_set(lock, 1) == 0);
 
 #elif defined(__GNUC__) && defined(__arm__) && defined(__ARM_ARCH_5__)
@@ -75,8 +75,16 @@
 void
 SDL_AtomicUnlock(SDL_SpinLock *lock)
 {
-    /* Assuming atomic assignment operation and full memory barrier in lock */
+#if defined(_MSC_VER)
+    _ReadWriteBarrier();
     *lock = 0;
+
+#elif HAVE_GCC_ATOMICS || HAVE_GCC_SYNC_LOCK_TEST_AND_SET
+    __sync_lock_release(lock);
+
+#else
+    *lock = 0;
+#endif
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/audio/SDL_audio.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/audio/SDL_audio.c	Tue Feb 01 00:37:02 2011 -0800
@@ -971,7 +971,7 @@
     if (!current_audio.impl.ProvidesOwnCallbackThread) {
         /* Start the audio thread */
 /* !!! FIXME: this is nasty. */
-#if (defined(__WINDOWS__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
+#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
 #undef SDL_CreateThread
         device->thread = SDL_CreateThread(SDL_RunAudio, device, NULL, NULL);
 #else
--- a/src/audio/android/SDL_androidaudio.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/audio/android/SDL_androidaudio.c	Tue Feb 01 00:37:02 2011 -0800
@@ -27,7 +27,7 @@
 #include "../SDL_audio_c.h"
 #include "SDL_androidaudio.h"
 
-#include "../../SDL_android.h"
+#include "../../core/android/SDL_android.h"
 
 #include <android/log.h>
 
--- a/src/audio/pulseaudio/SDL_pulseaudio.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Tue Feb 01 00:37:02 2011 -0800
@@ -304,38 +304,6 @@
 }
 
 
-/* !!! FIXME: this could probably be expanded. */
-/* Try to get the name of the program */
-static char *
-get_progname(void)
-{
-#ifdef __LINUX__
-    char *progname = NULL;
-    FILE *fp;
-    static char temp[BUFSIZ];
-
-    SDL_snprintf(temp, SDL_arraysize(temp), "/proc/%d/cmdline", getpid());
-    fp = fopen(temp, "r");
-    if (fp != NULL) {
-        if (fgets(temp, sizeof(temp) - 1, fp)) {
-            progname = SDL_strrchr(temp, '/');
-            if (progname == NULL) {
-                progname = temp;
-            } else {
-                progname = progname + 1;
-            }
-        }
-        fclose(fp);
-    }
-    return(progname);
-#elif defined(__NetBSD__)
-    return getprogname();
-#else
-    return("unknown");
-#endif
-}
-
-
 static int
 PULSEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
 {
@@ -438,7 +406,7 @@
     }
 
     h->mainloop_api = PULSEAUDIO_pa_mainloop_get_api(h->mainloop);
-    h->context = PULSEAUDIO_pa_context_new(h->mainloop_api, get_progname());
+    h->context = PULSEAUDIO_pa_context_new(h->mainloop_api, NULL);
     if (!h->context) {
         PULSEAUDIO_CloseDevice(this);
         SDL_SetError("pa_context_new() failed");
--- a/src/audio/windib/SDL_dibaudio.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/audio/windib/SDL_dibaudio.c	Tue Feb 01 00:37:02 2011 -0800
@@ -23,8 +23,7 @@
 
 /* Allow access to a raw mixing buffer */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 #include <mmsystem.h>
 
 #include "SDL_timer.h"
@@ -67,21 +66,14 @@
 {
     size_t len;
     char errbuf[MAXERRORLENGTH];
-#ifdef _WIN32_WCE
     wchar_t werrbuf[MAXERRORLENGTH];
-#endif
 
     SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: ", function);
     len = SDL_strlen(errbuf);
 
-#ifdef _WIN32_WCE
-    /* UNICODE version */
     waveOutGetErrorText(code, werrbuf, MAXERRORLENGTH - len);
     WideCharToMultiByte(CP_ACP, 0, werrbuf, -1, errbuf + len,
                         MAXERRORLENGTH - len, NULL, NULL);
-#else
-    waveOutGetErrorText(code, errbuf + len, (UINT) (MAXERRORLENGTH - len));
-#endif
 
     SDL_SetError("%s", errbuf);
 }
--- a/src/audio/windx5/SDL_dx5audio.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/audio/windx5/SDL_dx5audio.c	Tue Feb 01 00:37:02 2011 -0800
@@ -24,6 +24,7 @@
 /* Allow access to a raw mixing buffer */
 
 #include "SDL_timer.h"
+#include "SDL_loadso.h"
 #include "SDL_audio.h"
 #include "../SDL_audio_c.h"
 #include "SDL_dx5audio.h"
@@ -38,19 +39,19 @@
 #endif
 
 /* DirectX function pointers for audio */
-static HINSTANCE DSoundDLL = NULL;
+static void* DSoundDLL = NULL;
 static HRESULT(WINAPI * DSoundCreate) (LPGUID, LPDIRECTSOUND *, LPUNKNOWN) =
     NULL;
 
 static void
 DSOUND_Unload(void)
 {
+    DSoundCreate = NULL;
+
     if (DSoundDLL != NULL) {
-        FreeLibrary(DSoundDLL);
+        SDL_UnloadObject(DSoundDLL);
+        DSoundDLL = NULL;
     }
-
-    DSoundCreate = NULL;
-    DSoundDLL = NULL;
 }
 
 
@@ -61,17 +62,16 @@
 
     DSOUND_Unload();
 
-    DSoundDLL = LoadLibrary(TEXT("DSOUND.DLL"));
+    DSoundDLL = SDL_LoadObject("DSOUND.DLL");
     if (DSoundDLL == NULL) {
         SDL_SetError("DirectSound: failed to load DSOUND.DLL");
     } else {
         /* Now make sure we have DirectX 5 or better... */
         /*  (DirectSoundCaptureCreate was added in DX5) */
-        if (!GetProcAddress(DSoundDLL, TEXT("DirectSoundCaptureCreate"))) {
+        if (!SDL_LoadFunction(DSoundDLL, "DirectSoundCaptureCreate")) {
             SDL_SetError("DirectSound: System doesn't appear to have DX5.");
         } else {
-            DSoundCreate = (void *) GetProcAddress(DSoundDLL,
-                                                   TEXT("DirectSoundCreate"));
+            DSoundCreate = SDL_LoadFunction(DSoundDLL, "DirectSoundCreate");
         }
 
         if (!DSoundCreate) {
--- a/src/audio/windx5/directx.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/audio/windx5/directx.h	Tue Feb 01 00:37:02 2011 -0800
@@ -4,8 +4,7 @@
 
 /* Include all of the DirectX 5.0 headers and adds any necessary tweaks */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 #include <mmsystem.h>
 #ifndef WIN32
 #define WIN32
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/android/SDL_android.cpp	Tue Feb 01 00:37:02 2011 -0800
@@ -0,0 +1,258 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_android.h"
+
+extern "C" {
+#include "../../events/SDL_events_c.h"
+#include "../../video/android/SDL_androidkeyboard.h"
+#include "../../video/android/SDL_androidtouch.h"
+#include "../../video/android/SDL_androidvideo.h"
+
+/* Impelemented in audio/android/SDL_androidaudio.c */
+extern void Android_RunAudioThread();
+} // C
+
+/*******************************************************************************
+ This file links the Java side of Android with libsdl
+*******************************************************************************/
+#include <jni.h>
+#include <android/log.h>
+
+
+/*******************************************************************************
+                               Globals
+*******************************************************************************/
+static JNIEnv* mEnv = NULL;
+static JNIEnv* mAudioEnv = NULL;
+
+// Main activity
+static jclass mActivityClass;
+
+// method signatures
+static jmethodID midCreateGLContext;
+static jmethodID midFlipBuffers;
+static jmethodID midAudioInit;
+static jmethodID midAudioWriteShortBuffer;
+static jmethodID midAudioWriteByteBuffer;
+static jmethodID midAudioQuit;
+
+// Accelerometer data storage
+static float fLastAccelerometer[3];
+
+
+/*******************************************************************************
+                 Functions called by JNI
+*******************************************************************************/
+
+// Library init
+extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved)
+{
+    return JNI_VERSION_1_4;
+}
+
+// Called before SDL_main() to initialize JNI bindings
+extern "C" void SDL_Android_Init(JNIEnv* env, jclass cls)
+{
+    __android_log_print(ANDROID_LOG_INFO, "SDL", "SDL_Android_Init()");
+
+    mEnv = env;
+    mActivityClass = cls;
+
+    midCreateGLContext = mEnv->GetStaticMethodID(mActivityClass,
+                                "createGLContext","()V");
+    midFlipBuffers = mEnv->GetStaticMethodID(mActivityClass,
+                                "flipBuffers","()V");
+    midAudioInit = mEnv->GetStaticMethodID(mActivityClass, 
+                                "audioInit", "(IZZI)Ljava/lang/Object;");
+    midAudioWriteShortBuffer = mEnv->GetStaticMethodID(mActivityClass,
+                                "audioWriteShortBuffer", "([S)V");
+    midAudioWriteByteBuffer = mEnv->GetStaticMethodID(mActivityClass,
+                                "audioWriteByteBuffer", "([B)V");
+    midAudioQuit = mEnv->GetStaticMethodID(mActivityClass,
+                                "audioQuit", "()V");
+
+    if(!midCreateGLContext || !midFlipBuffers || !midAudioInit ||
+       !midAudioWriteShortBuffer || !midAudioWriteByteBuffer || !midAudioQuit) {
+        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL: Couldn't locate Java callbacks, check that they're named and typed correctly");
+    }
+}
+
+// Resize
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeResize(
+                                    JNIEnv* env, jclass jcls,
+                                    jint width, jint height, jint format)
+{
+    Android_SetScreenResolution(width, height, format);
+}
+
+// Keydown
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyDown(
+                                    JNIEnv* env, jclass jcls, jint keycode)
+{
+    Android_OnKeyDown(keycode);
+}
+
+// Keyup
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeKeyUp(
+                                    JNIEnv* env, jclass jcls, jint keycode)
+{
+    Android_OnKeyUp(keycode);
+}
+
+// Touch
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeTouch(
+                                    JNIEnv* env, jclass jcls,
+                                    jint action, jfloat x, jfloat y, jfloat p)
+{
+    Android_OnTouch(action, x, y, p);
+}
+
+// Accelerometer
+extern "C" void Java_org_libsdl_app_SDLActivity_onNativeAccel(
+                                    JNIEnv* env, jclass jcls,
+                                    jfloat x, jfloat y, jfloat z)
+{
+    fLastAccelerometer[0] = x;
+    fLastAccelerometer[1] = y;
+    fLastAccelerometer[2] = z;   
+}
+
+// Quit
+extern "C" void Java_org_libsdl_app_SDLActivity_nativeQuit(
+                                    JNIEnv* env, jclass cls)
+{    
+    // Inject a SDL_QUIT event
+    SDL_SendQuit();
+}
+
+extern "C" void Java_org_libsdl_app_SDLActivity_nativeRunAudioThread(
+                                    JNIEnv* env, jclass cls)
+{
+    /* This is the audio thread, with a different environment */
+    mAudioEnv = env;
+
+    Android_RunAudioThread();
+}
+
+
+/*******************************************************************************
+             Functions called by SDL into Java
+*******************************************************************************/
+extern "C" void Android_JNI_CreateContext()
+{
+    mEnv->CallStaticVoidMethod(mActivityClass, midCreateGLContext); 
+}
+
+extern "C" void Android_JNI_SwapWindow()
+{
+    mEnv->CallStaticVoidMethod(mActivityClass, midFlipBuffers); 
+}
+
+extern "C" void Android_JNI_SetActivityTitle(const char *title)
+{
+    jmethodID mid;
+
+    mid = mEnv->GetStaticMethodID(mActivityClass,"setActivityTitle","(Ljava/lang/String;)V");
+    if (mid) {
+        mEnv->CallStaticVoidMethod(mActivityClass, mid, mEnv->NewStringUTF(title));
+    }
+}
+
+extern "C" void Android_JNI_GetAccelerometerValues(float values[3])
+{
+    int i;
+    for (i = 0; i < 3; ++i) {
+        values[i] = fLastAccelerometer[i];
+    }
+}
+
+//
+// Audio support
+//
+static jboolean audioBuffer16Bit = JNI_FALSE;
+static jboolean audioBufferStereo = JNI_FALSE;
+static jobject audioBuffer = NULL;
+static void* audioBufferPinned = NULL;
+
+extern "C" int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames)
+{
+    int audioBufferFrames;
+
+    __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
+    audioBuffer16Bit = is16Bit;
+    audioBufferStereo = channelCount > 1;
+
+    audioBuffer = mEnv->CallStaticObjectMethod(mActivityClass, midAudioInit, sampleRate, audioBuffer16Bit, audioBufferStereo, desiredBufferFrames);
+
+    if (audioBuffer == NULL) {
+        __android_log_print(ANDROID_LOG_WARN, "SDL", "SDL audio: didn't get back a good audio buffer!");
+        return 0;
+    }
+    audioBuffer = mEnv->NewGlobalRef(audioBuffer);
+
+    jboolean isCopy = JNI_FALSE;
+    if (audioBuffer16Bit) {
+        audioBufferPinned = mEnv->GetShortArrayElements((jshortArray)audioBuffer, &isCopy);
+        audioBufferFrames = mEnv->GetArrayLength((jshortArray)audioBuffer);
+    } else {
+        audioBufferPinned = mEnv->GetByteArrayElements((jbyteArray)audioBuffer, &isCopy);
+        audioBufferFrames = mEnv->GetArrayLength((jbyteArray)audioBuffer);
+    }
+    if (audioBufferStereo) {
+        audioBufferFrames /= 2;
+    }
+
+    return audioBufferFrames;
+}
+
+extern "C" void * Android_JNI_GetAudioBuffer()
+{
+    return audioBufferPinned;
+}
+
+extern "C" void Android_JNI_WriteAudioBuffer()
+{
+    if (audioBuffer16Bit) {
+        mAudioEnv->ReleaseShortArrayElements((jshortArray)audioBuffer, (jshort *)audioBufferPinned, JNI_COMMIT);
+        mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteShortBuffer, (jshortArray)audioBuffer);
+    } else {
+        mAudioEnv->ReleaseByteArrayElements((jbyteArray)audioBuffer, (jbyte *)audioBufferPinned, JNI_COMMIT);
+        mAudioEnv->CallStaticVoidMethod(mActivityClass, midAudioWriteByteBuffer, (jbyteArray)audioBuffer);
+    }
+
+    /* JNI_COMMIT means the changes are committed to the VM but the buffer remains pinned */
+}
+
+extern "C" void Android_JNI_CloseAudioDevice()
+{
+    mEnv->CallStaticVoidMethod(mActivityClass, midAudioQuit); 
+
+    if (audioBuffer) {
+        mEnv->DeleteGlobalRef(audioBuffer);
+        audioBuffer = NULL;
+        audioBufferPinned = NULL;
+    }
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/android/SDL_android.h	Tue Feb 01 00:37:02 2011 -0800
@@ -0,0 +1,50 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/* Interface from the SDL library into the Android Java activity */
+extern void Android_JNI_CreateContext();
+extern void Android_JNI_SwapWindow();
+extern void Android_JNI_SetActivityTitle(const char *title);
+extern void Android_JNI_GetAccelerometerValues(float values[3]);
+
+// Audio support
+extern int Android_JNI_OpenAudioDevice(int sampleRate, int is16Bit, int channelCount, int desiredBufferFrames);
+extern void* Android_JNI_GetAudioBuffer();
+extern void Android_JNI_WriteAudioBuffer();
+extern void Android_JNI_CloseAudioDevice();
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/windows/SDL_windows.c	Tue Feb 01 00:37:02 2011 -0800
@@ -0,0 +1,41 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+#include "SDL_config.h"
+
+#include "SDL_error.h"
+#include "SDL_windows.h"
+
+
+/* Sets an error message based on GetLastError() */
+void
+WIN_SetError(const char *prefix)
+{
+    TCHAR buffer[1024];
+    char *message;
+    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
+                  buffer, SDL_arraysize(buffer), NULL);
+    message = WIN_StringToUTF8(buffer);
+    SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message);
+    SDL_free(message);
+}
+
+/* vi: set ts=4 sw=4 expandtab: */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/core/windows/SDL_windows.h	Tue Feb 01 00:37:02 2011 -0800
@@ -0,0 +1,53 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2010 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    slouken@libsdl.org
+*/
+
+/* This is an include file for windows.h with the SDL build settings */
+
+#ifndef _INCLUDED_WINDOWS_H
+#define _INCLUDED_WINDOWS_H
+
+#define WIN32_LEAN_AND_MEAN
+#define STRICT
+#ifndef UNICODE
+#define UNICODE 1
+#endif
+#undef WINVER
+#define WINVER  0x500           /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
+
+#include <windows.h>
+
+
+/* Routines to convert from UTF8 to native Windows text */
+#if UNICODE
+#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
+#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)(S), SDL_strlen(S)+1)
+#else
+#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
+#define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)
+#endif
+
+/* Sets an error message based on GetLastError() */
+extern void WIN_SetError(const char *prefix);
+
+#endif /* _INCLUDED_WINDOWS_H */
+
+/* vi: set ts=4 sw=4 expandtab: */
--- a/src/cpuinfo/SDL_cpuinfo.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/cpuinfo/SDL_cpuinfo.c	Tue Feb 01 00:37:02 2011 -0800
@@ -38,9 +38,8 @@
 #include <signal.h>
 #include <setjmp.h>
 #endif
-#ifdef __WINDOWS__
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#ifdef __WIN32__
+#include "../core/windows/SDL_windows.h"
 #endif
 
 #define CPU_HAS_RDTSC   0x00000001
@@ -305,7 +304,7 @@
 static int SDL_CPUCount = 0;
 
 int
-SDL_GetCPUCount()
+SDL_GetCPUCount(void)
 {
     if (!SDL_CPUCount) {
 #if defined(HAVE_SYSCONF) && defined(_SC_NPROCESSORS_ONLN)
@@ -319,7 +318,7 @@
             sysctlbyname("hw.ncpu", &SDL_CPUCount, &size, NULL, 0);
         }
 #endif
-#ifdef __WINDOWS__
+#ifdef __WIN32__
         if (SDL_CPUCount <= 0) {
             SYSTEM_INFO info;
             GetSystemInfo(&info);
@@ -336,75 +335,127 @@
 
 /* Oh, such a sweet sweet trick, just not very useful. :) */
 static const char *
-SDL_GetCPUType()
+SDL_GetCPUType(void)
 {
-    static char SDL_CPUType[48];
+    static char SDL_CPUType[13];
 
     if (!SDL_CPUType[0]) {
         int i = 0;
         int a, b, c, d;
 
         if (CPU_haveCPUID()) {
+            cpuid(0x00000000, a, b, c, d);
+            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
+            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
+            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
+            SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
+            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
+            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
+            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
+            SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
+            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
+            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
+            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
+            SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
+        }
+        if (!SDL_CPUType[0]) {
+            SDL_strlcpy(SDL_CPUType, "Unknown", sizeof(SDL_CPUType));
+        }
+    }
+    return SDL_CPUType;
+}
+
+static const char *
+SDL_GetCPUName(void)
+{
+    static char SDL_CPUName[48];
+
+    if (!SDL_CPUName[0]) {
+        int i = 0;
+        int a, b, c, d;
+
+        if (CPU_haveCPUID()) {
             cpuid(0x80000000, a, b, c, d);
             if (a >= 0x80000004) {
                 cpuid(0x80000002, a, b, c, d);
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
                 cpuid(0x80000003, a, b, c, d);
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
                 cpuid(0x80000004, a, b, c, d);
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(a & 0xff); a >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(b & 0xff); b >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(c & 0xff); c >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
-                SDL_CPUType[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(a & 0xff); a >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(b & 0xff); b >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(c & 0xff); c >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
+                SDL_CPUName[i++] = (char)(d & 0xff); d >>= 8;
             }
         }
-        if (!SDL_CPUType[0]) {
-            SDL_strlcpy(SDL_CPUType, "Unknown", sizeof(SDL_CPUType));
+        if (!SDL_CPUName[0]) {
+            SDL_strlcpy(SDL_CPUName, "Unknown", sizeof(SDL_CPUName));
         }
     }
-    return SDL_CPUType;
+    return SDL_CPUName;
+}
+
+int
+SDL_GetCPUCacheLineSize(void)
+{
+    const char *cpuType = SDL_GetCPUType();
+
+    if (SDL_strcmp(cpuType, "GenuineIntel") == 0) {
+        int a, b, c, d;
+
+        cpuid(0x00000001, a, b, c, d);
+        return (((b >> 8) & 0xff) * 8);
+    } else if (SDL_strcmp(cpuType, "AuthenticAMD") == 0) {
+        int a, b, c, d;
+
+        cpuid(0x80000005, a, b, c, d);
+        return (c & 0xff);
+    } else {
+        /* Just make a guess here... */
+        return SDL_CACHELINE_SIZE;
+    }
 }
 
 static Uint32 SDL_CPUFeatures = 0xFFFFFFFF;
@@ -522,7 +573,9 @@
 main()
 {
     printf("CPU count: %d\n", SDL_GetCPUCount());
-    printf("CPU name: %s\n", SDL_GetCPUType());
+    printf("CPU type: %s\n", SDL_GetCPUType());
+    printf("CPU name: %s\n", SDL_GetCPUName());
+    printf("CacheLine size: %d\n", SDL_GetCPUCacheLineSize());
     printf("RDTSC: %d\n", SDL_HasRDTSC());
     printf("MMX: %d\n", SDL_HasMMX());
     printf("MMXExt: %d\n", SDL_HasMMXExt());
--- a/src/events/SDL_events.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/SDL_events.c	Tue Feb 01 00:37:02 2011 -0800
@@ -27,12 +27,12 @@
 #include "SDL_events.h"
 #include "SDL_syswm.h"
 #include "SDL_thread.h"
-#include "SDL_sysevents.h"
 #include "SDL_events_c.h"
 #include "../timer/SDL_timer_c.h"
 #if !SDL_JOYSTICK_DISABLED
 #include "../joystick/SDL_joystick_c.h"
 #endif
+#include "../video/SDL_sysvideo.h"
 
 /* Public data -- the event filter */
 SDL_EventFilter SDL_EventOK = NULL;
@@ -58,36 +58,6 @@
     struct SDL_SysWMmsg wmmsg[MAXEVENTS];
 } SDL_EventQ;
 
-/* Private data -- event locking structure */
-static struct
-{
-    SDL_mutex *lock;
-    int safe;
-} SDL_EventLock;
-
-/* Thread functions */
-static SDL_Thread *SDL_EventThread = NULL;      /* Thread handle */
-static SDL_threadID event_thread;     /* The event thread id */
-
-void
-SDL_Lock_EventThread(void)
-{
-    if (SDL_EventThread && (SDL_ThreadID() != event_thread)) {
-        /* Grab lock and spin until we're sure event thread stopped */
-        SDL_mutexP(SDL_EventLock.lock);
-        while (!SDL_EventLock.safe) {
-            SDL_Delay(1);
-        }
-    }
-}
-
-void
-SDL_Unlock_EventThread(void)
-{
-    if (SDL_EventThread && (SDL_ThreadID() != event_thread)) {
-        SDL_mutexV(SDL_EventLock.lock);
-    }
-}
 
 static __inline__ SDL_bool
 SDL_ShouldPollJoystick()
@@ -102,112 +72,6 @@
     return SDL_FALSE;
 }
 
-static int SDLCALL
-SDL_GobbleEvents(void *unused)
-{
-    event_thread = SDL_ThreadID();
-
-    while (SDL_EventQ.active) {
-        SDL_VideoDevice *_this = SDL_GetVideoDevice();
-
-        /* Get events from the video subsystem */
-        if (_this) {
-            _this->PumpEvents(_this);
-        }
-#if !SDL_JOYSTICK_DISABLED
-        /* Check for joystick state change */
-        if (SDL_ShouldPollJoystick()) {
-            SDL_JoystickUpdate();
-        }
-#endif
-
-        /* Give up the CPU for the rest of our timeslice */
-        SDL_EventLock.safe = 1;
-        if (SDL_timer_running) {
-            SDL_ThreadedTimerCheck();
-        }
-        SDL_Delay(1);
-
-        /* Check for event locking.
-           On the P of the lock mutex, if the lock is held, this thread
-           will wait until the lock is released before continuing.  The
-           safe flag will be set, meaning that the other thread can go
-           about it's business.  The safe flag is reset before the V,
-           so as soon as the mutex is free, other threads can see that
-           it's not safe to interfere with the event thread.
-         */
-        SDL_mutexP(SDL_EventLock.lock);
-        SDL_EventLock.safe = 0;
-        SDL_mutexV(SDL_EventLock.lock);
-    }
-    SDL_SetTimerThreaded(0);
-    event_thread = 0;
-    return (0);
-}
-
-static int
-SDL_StartEventThread(Uint32 flags)
-{
-    /* Reset everything to zero */
-    SDL_EventThread = NULL;
-    SDL_memset(&SDL_EventLock, 0, sizeof(SDL_EventLock));
-
-    /* Create the lock and set ourselves active */
-#if !SDL_THREADS_DISABLED
-    SDL_EventQ.lock = SDL_CreateMutex();
-    if (SDL_EventQ.lock == NULL) {
-        return (-1);
-    }
-#endif /* !SDL_THREADS_DISABLED */
-    SDL_EventQ.active = 1;
-
-    if ((flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD) {
-        SDL_EventLock.lock = SDL_CreateMutex();
-        if (SDL_EventLock.lock == NULL) {
-            return (-1);
-        }
-        SDL_EventLock.safe = 0;
-
-        /* The event thread will handle timers too */
-        SDL_SetTimerThreaded(2);
-#if (defined(__WINDOWS__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
-#undef SDL_CreateThread
-        SDL_EventThread =
-            SDL_CreateThread(SDL_GobbleEvents, NULL, NULL, NULL);
-#else
-        SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL);
-#endif
-        if (SDL_EventThread == NULL) {
-            return (-1);
-        }
-    } else {
-        event_thread = 0;
-    }
-    return (0);
-}
-
-static void
-SDL_StopEventThread(void)
-{
-    SDL_EventQ.active = 0;
-    if (SDL_EventThread) {
-        SDL_WaitThread(SDL_EventThread, NULL);
-        SDL_EventThread = NULL;
-        SDL_DestroyMutex(SDL_EventLock.lock);
-        SDL_EventLock.lock = NULL;
-    }
-    if (SDL_EventQ.lock) {
-        SDL_DestroyMutex(SDL_EventQ.lock);
-        SDL_EventQ.lock = NULL;
-    }
-}
-
-SDL_threadID
-SDL_EventThreadID(void)
-{
-    return (event_thread);
-}
-
 /* Public functions */
 
 void
@@ -215,13 +79,10 @@
 {
     int i;
 
-    /* Halt the event thread, if running */
-    SDL_StopEventThread();
-
-    /* Shutdown event handlers */
-    SDL_KeyboardQuit();
-    SDL_MouseQuit();
-    SDL_QuitQuit();
+    if (SDL_EventQ.lock) {
+        SDL_DestroyMutex(SDL_EventQ.lock);
+        SDL_EventQ.lock = NULL;
+    }
 
     /* Clean out EventQ */
     SDL_EventQ.head = 0;
@@ -239,12 +100,11 @@
 
 /* This function (and associated calls) may be called more than once */
 int
-SDL_StartEventLoop(Uint32 flags)
+SDL_StartEventLoop(void)
 {
     int retcode;
 
     /* Clean out the event queue */
-    SDL_EventThread = NULL;
     SDL_EventQ.lock = NULL;
     SDL_StopEventLoop();
 
@@ -252,22 +112,15 @@
     SDL_EventOK = NULL;
     SDL_EventState(SDL_SYSWMEVENT, SDL_DISABLE);
 
-    /* Initialize event handlers */
-    retcode = 0;
-    retcode += SDL_KeyboardInit();
-    retcode += SDL_MouseInit();
-    retcode += SDL_TouchInit();
-    retcode += SDL_QuitInit();
-    if (retcode < 0) {
-        /* We don't expect them to fail, but... */
+    /* Create the lock and set ourselves active */
+#if !SDL_THREADS_DISABLED
+    SDL_EventQ.lock = SDL_CreateMutex();
+    if (SDL_EventQ.lock == NULL) {
         return (-1);
     }
+#endif /* !SDL_THREADS_DISABLED */
+    SDL_EventQ.active = 1;
 
-    /* Create the lock and event thread */
-    if (SDL_StartEventThread(flags) < 0) {
-        SDL_StopEventLoop();
-        return (-1);
-    }
     return (0);
 }
 
@@ -426,20 +279,18 @@
 void
 SDL_PumpEvents(void)
 {
-    if (!SDL_EventThread) {
-        SDL_VideoDevice *_this = SDL_GetVideoDevice();
+    SDL_VideoDevice *_this = SDL_GetVideoDevice();
 
-        /* Get events from the video subsystem */
-        if (_this) {
-            _this->PumpEvents(_this);
-        }
+    /* Get events from the video subsystem */
+    if (_this) {
+        _this->PumpEvents(_this);
+    }
 #if !SDL_JOYSTICK_DISABLED
-        /* Check for joystick state change */
-        if (SDL_ShouldPollJoystick()) {
-            SDL_JoystickUpdate();
-        }
+    /* Check for joystick state change */
+    if (SDL_ShouldPollJoystick()) {
+        SDL_JoystickUpdate();
+    }
 #endif
-    }
 }
 
 /* Public functions */
--- a/src/events/SDL_events_c.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/SDL_events_c.h	Tue Feb 01 00:37:02 2011 -0800
@@ -29,15 +29,12 @@
 #include "SDL_touch_c.h"
 #include "SDL_windowevents_c.h"
 #include "SDL_gesture_c.h"
+
 /* Start and stop the event processing loop */
-extern int SDL_StartEventLoop(Uint32 flags);
+extern int SDL_StartEventLoop(void);
 extern void SDL_StopEventLoop(void);
 extern void SDL_QuitInterrupt(void);
 
-extern void SDL_Lock_EventThread(void);
-extern void SDL_Unlock_EventThread(void);
-extern SDL_threadID SDL_EventThreadID(void);
-
 extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message);
 
 extern int SDL_QuitInit(void);
--- a/src/events/SDL_keyboard.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/SDL_keyboard.c	Tue Feb 01 00:37:02 2011 -0800
@@ -26,7 +26,7 @@
 #include "SDL_timer.h"
 #include "SDL_events.h"
 #include "SDL_events_c.h"
-#include "SDL_sysevents.h"
+#include "../video/SDL_sysvideo.h"
 
 
 /* Global keyboard information */
@@ -562,7 +562,7 @@
 SDL_ResetKeyboard(void)
 {
     SDL_Keyboard *keyboard = &SDL_keyboard;
-    SDL_scancode scancode;
+    SDL_ScanCode scancode;
 
     for (scancode = 0; scancode < SDL_NUM_SCANCODES; ++scancode) {
         if (keyboard->keystate[scancode] == SDL_PRESSED) {
@@ -590,7 +590,7 @@
 }
 
 void
-SDL_SetScancodeName(SDL_scancode scancode, const char *name)
+SDL_SetScancodeName(SDL_ScanCode scancode, const char *name)
 {
     SDL_scancode_names[scancode] = name;
 }
@@ -638,7 +638,7 @@
 }
 
 int
-SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode)
+SDL_SendKeyboardKey(Uint8 state, SDL_ScanCode scancode)
 {
     SDL_Keyboard *keyboard = &SDL_keyboard;
     int posted;
@@ -849,18 +849,18 @@
 }
 
 SDLKey
-SDL_GetKeyFromScancode(SDL_scancode scancode)
+SDL_GetKeyFromScancode(SDL_ScanCode scancode)
 {
     SDL_Keyboard *keyboard = &SDL_keyboard;
 
     return keyboard->keymap[scancode];
 }
 
-SDL_scancode
+SDL_ScanCode
 SDL_GetScancodeFromKey(SDLKey key)
 {
     SDL_Keyboard *keyboard = &SDL_keyboard;
-    SDL_scancode scancode;
+    SDL_ScanCode scancode;
 
     for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES;
          ++scancode) {
@@ -872,7 +872,7 @@
 }
 
 const char *
-SDL_GetScancodeName(SDL_scancode scancode)
+SDL_GetScancodeName(SDL_ScanCode scancode)
 {
     const char *name = SDL_scancode_names[scancode];
 
@@ -890,7 +890,7 @@
 
     if (key & SDLK_SCANCODE_MASK) {
         return
-            SDL_GetScancodeName((SDL_scancode) (key & ~SDLK_SCANCODE_MASK));
+            SDL_GetScancodeName((SDL_ScanCode) (key & ~SDLK_SCANCODE_MASK));
     }
 
     switch (key) {
--- a/src/events/SDL_keyboard_c.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/SDL_keyboard_c.h	Tue Feb 01 00:37:02 2011 -0800
@@ -43,13 +43,13 @@
    name. Encoded as UTF-8. The string is not copied, thus the pointer given to
    this function must stay valid forever (or at least until the call to
    VideoQuit()). */
-extern void SDL_SetScancodeName(SDL_scancode scancode, const char *name);
+extern void SDL_SetScancodeName(SDL_ScanCode scancode, const char *name);
 
 /* Set the keyboard focus window */
 extern void SDL_SetKeyboardFocus(SDL_Window * window);
 
 /* Send a keyboard key event */
-extern int SDL_SendKeyboardKey(Uint8 state, SDL_scancode scancode);
+extern int SDL_SendKeyboardKey(Uint8 state, SDL_ScanCode scancode);
 
 /* Send keyboard text input */
 extern int SDL_SendKeyboardText(const char *text);
--- a/src/events/SDL_sysevents.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/SDL_sysevents.h	Tue Feb 01 00:37:02 2011 -0800
@@ -29,7 +29,7 @@
 #define MUST_THREAD_EVENTS
 #endif
 
-#ifdef __WINDOWS__              /* Windows doesn't allow a separate event thread */
+#ifdef __WIN32__              /* Windows doesn't allow a separate event thread */
 #define CANT_THREAD_EVENTS
 #endif
 
--- a/src/events/SDL_touch.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/SDL_touch.c	Tue Feb 01 00:37:02 2011 -0800
@@ -397,15 +397,16 @@
                     float xin, float yin, float pressurein)
 {
     int index = SDL_GetTouchIndexId(id);
-    SDL_Touch *touch = SDL_GetTouch(id);
-    SDL_Finger *finger = SDL_GetFinger(touch,fingerid);
+    SDL_Touch *touch;
+    SDL_Finger *finger;
     int posted;
     Sint16 xrel, yrel;
     float x_max = 0, y_max = 0;
-        Uint16 x;
-        Uint16 y;
-        Uint16 pressure;
+    Uint16 x;
+    Uint16 y;
+    Uint16 pressure;
     
+    touch = SDL_GetTouch(id);
     if (!touch) {
       return SDL_TouchNotFoundError(id);
     }
@@ -418,6 +419,7 @@
         return 0;
     }
     
+    finger = SDL_GetFinger(touch,fingerid);
     if(finger == NULL || !finger->down) {
         return SDL_SendFingerDown(id,fingerid,SDL_TRUE,xin,yin,pressurein);        
     } else {
@@ -496,14 +498,16 @@
         return posted;
     }
 }
+
 int
 SDL_SendTouchButton(SDL_TouchID id, Uint8 state, Uint8 button)
 {
-    SDL_Touch *touch = SDL_GetTouch(id);
+    SDL_Touch *touch;
     int posted;
     Uint32 type;
 
     
+    touch = SDL_GetTouch(id);
     if (!touch) {
       return SDL_TouchNotFoundError(id);
     }
--- a/src/events/SDL_windowevents.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/SDL_windowevents.c	Tue Feb 01 00:37:02 2011 -0800
@@ -176,6 +176,14 @@
 
         posted = (SDL_PushEvent(&event) > 0);
     }
+	
+	if (windowevent == SDL_WINDOWEVENT_CLOSE) {
+		if ( !window->prev && !window->next ) {
+			// This is the last window in the list so send the SDL_QUIT event
+			SDL_SendQuit();
+		}
+	}
+
     return (posted);
 }
 
--- a/src/events/scancodes_darwin.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/scancodes_darwin.h	Tue Feb 01 00:37:02 2011 -0800
@@ -27,7 +27,7 @@
    - experimentation on various ADB and USB ISO keyboards and one ADB ANSI keyboard
 */
 /* *INDENT-OFF* */
-static const SDL_scancode darwin_scancode_table[] = {
+static const SDL_ScanCode darwin_scancode_table[] = {
     /*   0 */   SDL_SCANCODE_A,
     /*   1 */   SDL_SCANCODE_S,
     /*   2 */   SDL_SCANCODE_D,
--- a/src/events/scancodes_linux.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/scancodes_linux.h	Tue Feb 01 00:37:02 2011 -0800
@@ -26,7 +26,7 @@
    - Linux kernel source input.h
 */
 /* *INDENT-OFF* */
-static SDL_scancode const linux_scancode_table[] = {
+static SDL_ScanCode const linux_scancode_table[] = {
     /*  0 */    SDL_SCANCODE_UNKNOWN,
     /*  1 */    SDL_SCANCODE_ESCAPE,
     /*  2 */    SDL_SCANCODE_1,
--- a/src/events/scancodes_windows.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/scancodes_windows.h	Tue Feb 01 00:37:02 2011 -0800
@@ -26,7 +26,7 @@
    - msdn.microsoft.com
 */
 /* *INDENT-OFF* */
-static const SDL_scancode windows_scancode_table[] = {
+static const SDL_ScanCode windows_scancode_table[] = {
     /*  0, 0x00 */      SDL_SCANCODE_UNKNOWN,
     /*  1, 0x01 */      SDL_SCANCODE_UNKNOWN,
     /*  2, 0x02 */      SDL_SCANCODE_UNKNOWN,
--- a/src/events/scancodes_xfree86.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/events/scancodes_xfree86.h	Tue Feb 01 00:37:02 2011 -0800
@@ -26,7 +26,7 @@
    - atKeyNames.h from XFree86 source code
 */
 /* *INDENT-OFF* */
-static const SDL_scancode xfree86_scancode_table[] = {
+static const SDL_ScanCode xfree86_scancode_table[] = {
     /*  0 */    SDL_SCANCODE_UNKNOWN,
     /*  1 */    SDL_SCANCODE_ESCAPE,
     /*  2 */    SDL_SCANCODE_1,
@@ -177,7 +177,7 @@
 };
 
 /* for wireless usb keyboard (manufacturer TRUST) without numpad. */
-static const SDL_scancode xfree86_scancode_table2[] = {
+static const SDL_ScanCode xfree86_scancode_table2[] = {
     /*  0 */    SDL_SCANCODE_UNKNOWN,
     /*  1 */    SDL_SCANCODE_ESCAPE,
     /*  2 */    SDL_SCANCODE_1,
--- a/src/file/SDL_rwops.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/file/SDL_rwops.c	Tue Feb 01 00:37:02 2011 -0800
@@ -37,15 +37,14 @@
 #include <fat.h>
 #endif /* __NDS__ */
 
-#ifdef __WINDOWS__
+#ifdef __WIN32__
 
 /* Functions to read/write Win32 API file pointers */
 /* Will not use it on WinCE because stdio is buffered, it means
    faster, and all stdio functions anyway are embedded in coredll.dll - 
    the main wince dll*/
 
-#define WINDOWS_LEAN_AND_MEAN
-#include <windows.h>
+#include "../core/windows/SDL_windows.h"
 
 #ifndef INVALID_SET_FILE_POINTER
 #define INVALID_SET_FILE_POINTER 0xFFFFFFFF
@@ -98,34 +97,28 @@
     }
 #ifdef _WIN32_WCE
     {
-        size_t size = SDL_strlen(filename) + 1;
-        wchar_t *filenameW = SDL_stack_alloc(wchar_t, size);
-
-        if (MultiByteToWideChar(CP_UTF8, 0, filename, -1, filenameW, size) ==
-            0) {
-            SDL_stack_free(filenameW);
-            SDL_free(context->hidden.windowsio.buffer.data);
-            context->hidden.windowsio.buffer.data = NULL;
-            SDL_SetError("Unable to convert filename to Unicode");
-            return -1;
-        }
-        h = CreateFile(filenameW, (w_right | r_right),
+        LPTSTR tstr = WIN_UTF8ToString(filename);
+        h = CreateFile(tstr, (w_right | r_right),
                        (w_right) ? 0 : FILE_SHARE_READ, NULL,
                        (must_exist | truncate | a_mode),
                        FILE_ATTRIBUTE_NORMAL, NULL);
-        SDL_stack_free(filenameW);
+        SDL_free(tstr);
     }
 #else
     /* Do not open a dialog box if failure */
     old_error_mode =
         SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
 
-    h = CreateFile(filename, (w_right | r_right),
-                   (w_right) ? 0 : FILE_SHARE_READ, NULL,
-                   (must_exist | truncate | a_mode), FILE_ATTRIBUTE_NORMAL,
-                   NULL);
+    {
+        LPTSTR tstr = WIN_UTF8ToString(filename);
+        h = CreateFile(tstr, (w_right | r_right),
+                       (w_right) ? 0 : FILE_SHARE_READ, NULL,
+                       (must_exist | truncate | a_mode),
+                       FILE_ATTRIBUTE_NORMAL, NULL);
+        SDL_free(tstr);
+    }
 
-    /* restore old behaviour */
+    /* restore old behavior */
     SetErrorMode(old_error_mode);
 #endif /* _WIN32_WCE */
 
@@ -295,7 +288,7 @@
     }
     return (0);
 }
-#endif /* __WINDOWS__ */
+#endif /* __WIN32__ */
 
 #ifdef HAVE_STDIO_H
 
@@ -449,7 +442,7 @@
         SDL_SetError("SDL_RWFromFile(): No file or no mode specified");
         return NULL;
     }
-#if defined(__WINDOWS__)
+#if defined(__WIN32__)
     rwops = SDL_AllocRW();
     if (!rwops)
         return NULL;            /* SDL_SetError already setup by SDL_AllocRW() */
--- a/src/haptic/windows/SDL_syshaptic.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/haptic/windows/SDL_syshaptic.c	Tue Feb 01 00:37:02 2011 -0800
@@ -39,6 +39,7 @@
 static struct
 {
     DIDEVICEINSTANCE instance;
+    char *name;
     SDL_Haptic *haptic;
     DIDEVCAPS capabilities;
 } SDL_hapticlist[MAX_HAPTICS];
@@ -220,6 +221,9 @@
         return DIENUM_CONTINUE;
     }
 
+    /* Copy the name */
+    SDL_hapticlist[SDL_numhaptics].name = WIN_StringToUTF8(SDL_hapticlist[SDL_numhaptics].instance.tszProductName);
+
     /* Close up device and count it. */
     IDirectInputDevice_Release(device);
     SDL_numhaptics++;
@@ -238,7 +242,7 @@
 const char *
 SDL_SYS_HapticName(int index)
 {
-    return SDL_hapticlist[index].instance.tszProductName;
+    return SDL_hapticlist[index].name;
 }
 
 
@@ -630,6 +634,15 @@
 void
 SDL_SYS_HapticQuit(void)
 {
+    int i;
+
+    for (i = 0; i < SDL_arraysize(SDL_hapticlist); ++i) {
+        if (SDL_hapticlist[i].name) {
+            SDL_free(SDL_hapticlist[i].name);
+            SDL_hapticlist[i].name = NULL;
+        }
+    }
+
     IDirectInput_Release(dinput);
     dinput = NULL;
 }
--- a/src/joystick/SDL_joystick.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/joystick/SDL_joystick.c	Tue Feb 01 00:37:02 2011 -0800
@@ -30,12 +30,6 @@
 #include "../events/SDL_events_c.h"
 #endif
 
-/* This is used for Quake III Arena */
-#if SDL_EVENTS_DISABLED
-#define SDL_Lock_EventThread()
-#define SDL_Unlock_EventThread()
-#endif
-
 Uint8 SDL_numjoysticks = 0;
 SDL_Joystick **SDL_joysticks = NULL;
 static SDL_Joystick *default_joystick = NULL;
@@ -165,11 +159,9 @@
 
     /* Add joystick to list */
     ++joystick->ref_count;
-    SDL_Lock_EventThread();
     for (i = 0; SDL_joysticks[i]; ++i)
         /* Skip to next joystick */ ;
     SDL_joysticks[i] = joystick;
-    SDL_Unlock_EventThread();
 
     return (joystick);
 }
@@ -379,9 +371,6 @@
         return;
     }
 
-    /* Lock the event queue - prevent joystick polling */
-    SDL_Lock_EventThread();
-
     if (joystick == default_joystick) {
         default_joystick = NULL;
     }
@@ -396,9 +385,6 @@
         }
     }
 
-    /* Let the event thread keep running */
-    SDL_Unlock_EventThread();
-
     /* Free the data associated with this joystick */
     if (joystick->axes) {
         SDL_free(joystick->axes);
@@ -419,9 +405,7 @@
 SDL_JoystickQuit(void)
 {
     /* Stop the event polling */
-    SDL_Lock_EventThread();
     SDL_numjoysticks = 0;
-    SDL_Unlock_EventThread();
 
     /* Quit the joystick setup */
     SDL_SYS_JoystickQuit();
--- a/src/joystick/android/SDL_sysjoystick.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/joystick/android/SDL_sysjoystick.c	Tue Feb 01 00:37:02 2011 -0800
@@ -32,7 +32,7 @@
 #include "SDL_joystick.h"
 #include "../SDL_sysjoystick.h"
 #include "../SDL_joystick_c.h"
-#include "../../SDL_android.h"
+#include "../../core/android/SDL_android.h"
 
 static const char *accelerometerName = "Android accelerometer";
 
--- a/src/joystick/linux/SDL_sysjoystick.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/joystick/linux/SDL_sysjoystick.c	Tue Feb 01 00:37:02 2011 -0800
@@ -701,25 +701,26 @@
                 continue;
             }
             if (test_bit(i, absbit)) {
-                int values[6];
+                struct input_absinfo absinfo;
 
-                if (ioctl(fd, EVIOCGABS(i), values) < 0)
+                if (ioctl(fd, EVIOCGABS(i), &absinfo) < 0)
                     continue;
 #ifdef DEBUG_INPUT_EVENTS
                 printf("Joystick has absolute axis: %x\n", i);
                 printf("Values = { %d, %d, %d, %d, %d }\n",
-                       values[0], values[1], values[2], values[3], values[4]);
+                       absinfo.value, absinfo.minimum, absinfo.maximum,
+                       absinfo.fuzz, absinfo.flat);
 #endif /* DEBUG_INPUT_EVENTS */
                 joystick->hwdata->abs_map[i] = joystick->naxes;
-                if (values[1] == values[2]) {
+                if (absinfo.minimum == absinfo.maximum) {
                     joystick->hwdata->abs_correct[i].used = 0;
                 } else {
                     joystick->hwdata->abs_correct[i].used = 1;
                     joystick->hwdata->abs_correct[i].coef[0] =
-                        (values[2] + values[1]) / 2 - values[4];
+                        (absinfo.maximum + absinfo.minimum) / 2 - absinfo.flat;
                     joystick->hwdata->abs_correct[i].coef[1] =
-                        (values[2] + values[1]) / 2 + values[4];
-                    t = ((values[2] - values[1]) / 2 - 2 * values[4]);
+                        (absinfo.maximum + absinfo.minimum) / 2 + absinfo.flat;
+                    t = ((absinfo.maximum - absinfo.minimum) / 2 - 2 * absinfo.flat);
                     if (t != 0) {
                         joystick->hwdata->abs_correct[i].coef[2] =
                             (1 << 29) / t;
--- a/src/joystick/riscos/SDL_sysjoystick.c	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_JOYSTICK_RISCOS
-
-/*
-   RISC OS - Joystick support by Alan Buckley (alan_baa@hotmail.com) - 10 April 2003
-
-   Note: Currently assumes joystick is present if joystick module is loaded
-   and that there is one joystick with four buttons.
-*/
-
-/* This is the system specific header for the SDL joystick API */
-
-#include "SDL_events.h"
-#include "SDL_joystick.h"
-#include "../SDL_sysjoystick.h"
-#include "../SDL_joystick_c.h"
-
-#include "kernel.h"
-
-#define JOYSTICK_READ 0x43F40
-
-struct joystick_hwdata
-{
-    int joystate;
-};
-
-
-/* Function to scan the system for joysticks.
- * This function should set SDL_numjoysticks to the number of available
- * joysticks.  Joystick 0 should be the system default joystick.
- * It should return number of joysticks, or -1 on an unrecoverable fatal error.
- */
-int
-SDL_SYS_JoystickInit(void)
-{
-    _kernel_swi_regs regs;
-
-    /* Try to read joystick 0 */
-    regs.r[0] = 0;
-    if (_kernel_swi(JOYSTICK_READ, &regs, &regs) == NULL) {
-        /* Switch works so assume we've got a joystick */
-        return 1;
-    }
-    /* Switch fails so it looks like there's no joystick here */
-
-    return (0);
-}
-
-/* Function to get the device-dependent name of a joystick */
-const char *
-SDL_SYS_JoystickName(int index)
-{
-    if (index == 0) {
-        return "RISC OS Joystick 0";
-    }
-
-    SDL_SetError("No joystick available with that index");
-    return (NULL);
-}
-
-/* Function to open a joystick for use.
-   The joystick to open is specified by the index field of the joystick.
-   This should fill the nbuttons and naxes fields of the joystick structure.
-   It returns 0, or -1 if there is an error.
- */
-int
-SDL_SYS_JoystickOpen(SDL_Joystick * joystick)
-{
-    _kernel_swi_regs regs;
-
-    if (!(joystick->hwdata = SDL_malloc(sizeof(struct joystick_hwdata))))
-        return -1;
-
-    regs.r[0] = joystick->index;
-
-    /* Don't know how to get exact count of buttons so assume max of 4 for now */
-    joystick->nbuttons = 4;
-
-    joystick->nhats = 0;
-    joystick->nballs = 0;
-    joystick->naxes = 2;
-    joystick->hwdata->joystate = 0;
-
-    return 0;
-
-}
-
-/* Function to update the state of a joystick - called as a device poll.
- * This function shouldn't update the joystick structure directly,
- * but instead should call SDL_PrivateJoystick*() to deliver events
- * and update joystick device state.
- */
-void
-SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
-{
-    _kernel_swi_regs regs;
-    regs.r[0] = joystick->index;
-
-    if (_kernel_swi(JOYSTICK_READ, &regs, &regs) == NULL) {
-        int newstate = regs.r[0];
-        int oldstate = joystick->hwdata->joystate;
-        if (newstate != oldstate) {
-            if ((newstate & 0xFF) != (oldstate & 0xFF)) {
-                int y = regs.r[0] & 0xFF;
-                /* Convert to signed values */
-                if (y >= 128)
-                    y -= 256;
-                SDL_PrivateJoystickAxis(joystick, 1, -y * 256); /* Up and down opposite to result in SDL */
-            }
-            if ((newstate & 0xFF00) != (oldstate & 0xFF00)) {
-                int x = (regs.r[0] & 0xFF00) >> 8;
-                if (x >= 128)
-                    x -= 256;
-                SDL_PrivateJoystickAxis(joystick, 0, x * 256);
-            }
-
-            if ((newstate & 0xFF0000) != (oldstate & 0xFF0000)) {
-                int buttons = (regs.r[0] & 0xFF0000) >> 16;
-                int oldbuttons = (oldstate & 0xFF0000) >> 16;
-                int i;
-                for (i = 0; i < joystick->nbuttons; i++) {
-                    if ((buttons & (1 << i)) != (oldbuttons & (1 << i))) {
-                        if (buttons & (1 << i))
-                            SDL_PrivateJoystickButton(joystick, i,
-                                                      SDL_PRESSED);
-                        else
-                            SDL_PrivateJoystickButton(joystick, i,
-                                                      SDL_RELEASED);
-                    }
-                }
-            }
-            joystick->hwdata->joystate = newstate;
-        }
-    }
-
-    return;
-}
-
-/* Function to close a joystick after use */
-void
-SDL_SYS_JoystickClose(SDL_Joystick * joystick)
-{
-    if (joystick->hwdata)
-        SDL_free(joystick->hwdata);
-    return;
-}
-
-/* Function to perform any system-specific joystick related cleanup */
-void
-SDL_SYS_JoystickQuit(void)
-{
-    SDL_numjoysticks = 0;
-
-    return;
-}
-
-#endif /* SDL_JOYSTICK_RISCOS */
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/joystick/windows/SDL_dxjoystick.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/joystick/windows/SDL_dxjoystick.c	Tue Feb 01 00:37:02 2011 -0800
@@ -63,6 +63,7 @@
                                        LPDIRECTINPUT * ppDI,
                                        LPUNKNOWN punkOuter);
 static DIDEVICEINSTANCE SYS_Joystick[MAX_JOYSTICKS];    /* array to hold joystick ID values */
+static char *SYS_JoystickNames[MAX_JOYSTICKS];
 static int SYS_NumJoysticks;
 static HINSTANCE DInputDLL = NULL;
 
@@ -326,6 +327,7 @@
 {
     SDL_memcpy(&SYS_Joystick[SYS_NumJoysticks], pdidInstance,
                sizeof(DIDEVICEINSTANCE));
+    SYS_JoystickNames[SYS_NumJoysticks] = WIN_StringToUTF8(pdidInstance->tszProductName);
     SYS_NumJoysticks++;
 
     if (SYS_NumJoysticks >= MAX_JOYSTICKS)
@@ -338,8 +340,7 @@
 const char *
 SDL_SYS_JoystickName(int index)
 {
-        /***-> test for invalid index ? */
-    return (SYS_Joystick[index].tszProductName);
+    return SYS_JoystickNames[index];
 }
 
 /* Function to open a joystick for use.
@@ -793,6 +794,15 @@
 void
 SDL_SYS_JoystickQuit(void)
 {
+    int i;
+
+    for (i = 0; i < SDL_arraysize(SYS_JoystickNames); ++i) {
+        if (SYS_JoystickNames[i]) {
+            SDL_free(SYS_JoystickNames[i]);
+            SYS_JoystickNames[i] = NULL;
+        }
+    }
+
     IDirectInput_Release(dinput);
     dinput = NULL;
 }
--- a/src/joystick/windows/SDL_dxjoystick_c.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/joystick/windows/SDL_dxjoystick_c.h	Tue Feb 01 00:37:02 2011 -0800
@@ -33,8 +33,7 @@
  * with polled devices, and it's fine to call IDirectInputDevice2_GetDeviceData and
  * let it return 0 events. */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 
 #define DIRECTINPUT_VERSION 0x0700      /* Need version 7 for force feedback. */
 #include <dinput.h>
--- a/src/joystick/windows/SDL_mmjoystick.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/joystick/windows/SDL_mmjoystick.c	Tue Feb 01 00:37:02 2011 -0800
@@ -25,8 +25,7 @@
 
 /* Win32 MultiMedia Joystick driver, contributed by Andrei de A. Formiga */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 #include <mmsystem.h>
 #include <regstr.h>
 
--- a/src/libm/math_private.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/libm/math_private.h	Tue Feb 01 00:37:02 2011 -0800
@@ -19,7 +19,7 @@
 
 /*#include <endian.h>*/
 #include "SDL_endian.h"
-#include <sys/types.h>
+/*#include <sys/types.h>*/
 
 #define attribute_hidden
 #define libm_hidden_proto(x)
--- a/src/loadso/windows/SDL_sysloadso.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/loadso/windows/SDL_sysloadso.c	Tue Feb 01 00:37:02 2011 -0800
@@ -26,110 +26,45 @@
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /* System dependent library loading routines                           */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 
 #include "SDL_loadso.h"
 
 void *
 SDL_LoadObject(const char *sofile)
 {
-    void *handle = NULL;
-    const char *loaderror = "Unknown error";
-
-#if defined(_WIN32_WCE)
-    char errbuf[512];
-
-    wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
-    wchar_t *sofile_t = SDL_malloc((MAX_PATH + 1) * sizeof(wchar_t));
-
-    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, sofile, -1, sofile_t,
-                        MAX_PATH);
-    handle = (void *) LoadLibrary(sofile_t);
+    LPTSTR tstr = WIN_UTF8ToString(sofile);
+    void *handle = (void *) LoadLibrary(tstr);
+    SDL_free(tstr);
 
     /* Generate an error message if all loads failed */
     if (handle == NULL) {
-        FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
-                       FORMAT_MESSAGE_FROM_SYSTEM),
-                      NULL, GetLastError(),
-                      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                      errbuf_t, SDL_arraysize(errbuf), NULL);
-        WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
-        loaderror = errbuf;
+        char errbuf[512];
+        SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));
+        SDL_strlcat(errbuf, sofile, SDL_arraysize(errbuf));
+        WIN_SetError(errbuf);
     }
-
-    SDL_free(sofile_t);
-    SDL_free(errbuf_t);
-
-#else /*if defined(__WINDOWS__) */
-    char errbuf[512];
-
-    handle = (void *) LoadLibrary(sofile);
-
-    /* Generate an error message if all loads failed */
-    if (handle == NULL) {
-        FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
-                       FORMAT_MESSAGE_FROM_SYSTEM),
-                      NULL, GetLastError(),
-                      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                      errbuf, SDL_arraysize(errbuf), NULL);
-        loaderror = errbuf;
-    }
-#endif
-
-    if (handle == NULL) {
-        SDL_SetError("Failed loading %s: %s", sofile, loaderror);
-    }
-    return (handle);
+    return handle;
 }
 
 void *
 SDL_LoadFunction(void *handle, const char *name)
 {
-    void *symbol = NULL;
-    const char *loaderror = "Unknown error";
-
-#if defined(_WIN32_WCE)
-    char errbuf[512];
-    int length = SDL_strlen(name);
-
-    wchar_t *name_t = SDL_malloc((length + 1) * sizeof(wchar_t));
-    wchar_t *errbuf_t = SDL_malloc(512 * sizeof(wchar_t));
-
-    MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, name, -1, name_t, length + 1);
-
-    symbol = (void *) GetProcAddress((HMODULE) handle, name_t);
-    if (symbol == NULL) {
-        FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
-                       FORMAT_MESSAGE_FROM_SYSTEM),
-                      NULL, GetLastError(),
-                      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                      errbuf_t, SDL_arraysize(errbuf), NULL);
-        WideCharToMultiByte(CP_ACP, 0, errbuf_t, -1, errbuf, 511, NULL, NULL);
-        loaderror = errbuf;
-    }
-
-    SDL_free(name_t);
-    SDL_free(errbuf_t);
-
-#else /*if defined(WIN32) */
-    char errbuf[512];
-
-    symbol = (void *) GetProcAddress((HMODULE) handle, name);
-    if (symbol == NULL) {
-        FormatMessage((FORMAT_MESSAGE_IGNORE_INSERTS |
-                       FORMAT_MESSAGE_FROM_SYSTEM),
-                      NULL, GetLastError(),
-                      MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                      errbuf, SDL_arraysize(errbuf), NULL);
-        loaderror = errbuf;
-    }
+#ifdef _WIN32_WCE
+    LPTSTR tstr = WIN_UTF8ToString(name);
+    void *symbol = (void *) GetProcAddress((HMODULE) handle, tstr);
+    SDL_free(tstr);
+#else
+    void *symbol = (void *) GetProcAddress((HMODULE) handle, name);
 #endif
 
     if (symbol == NULL) {
-        SDL_SetError("Failed loading %s: %s", name, loaderror);
+        char errbuf[512];
+        SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));
+        SDL_strlcat(errbuf, name, SDL_arraysize(errbuf));
+        WIN_SetError(errbuf);
     }
-    return (symbol);
+    return symbol;
 }
 
 void
--- a/src/power/windows/SDL_syspower.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/power/windows/SDL_syspower.c	Tue Feb 01 00:37:02 2011 -0800
@@ -24,19 +24,27 @@
 #ifndef SDL_POWER_DISABLED
 #ifdef SDL_POWER_WINDOWS
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 
 #include "SDL_power.h"
 
 SDL_bool
 SDL_GetPowerInfo_Windows(SDL_PowerState * state, int *seconds, int *percent)
 {
+#ifdef _WIN32_WCE
+    SYSTEM_POWER_STATUS_EX status;
+#else
     SYSTEM_POWER_STATUS status;
+#endif
     SDL_bool need_details = SDL_FALSE;
 
     /* This API should exist back to Win95 and Windows CE. */
-    if (!GetSystemPowerStatus(&status)) {
+#ifdef _WIN32_WCE
+    if (!GetSystemPowerStatusEx(&status, FALSE))
+#else
+    if (!GetSystemPowerStatus(&status))
+#endif
+    {
         /* !!! FIXME: push GetLastError() into SDL_GetError() */
         *state = SDL_POWERSTATE_UNKNOWN;
     } else if (status.BatteryFlag == 0xFF) {    /* unknown state */
--- a/src/stdlib/SDL_getenv.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/stdlib/SDL_getenv.c	Tue Feb 01 00:37:02 2011 -0800
@@ -25,10 +25,9 @@
 
 #ifndef HAVE_GETENV
 
-#if defined(__WINDOWS__) && !defined(_WIN32_WCE)
+#if defined(__WIN32__) && !defined(_WIN32_WCE)
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../core/windows/SDL_windows.h"
 
 /* Note this isn't thread-safe! */
 
@@ -41,12 +40,12 @@
 {
     if (!overwrite) {
         char ch = 0;
-        const size_t len = GetEnvironmentVariable(name, &ch, sizeof (ch));
+        const size_t len = GetEnvironmentVariableA(name, &ch, sizeof (ch));
         if (len > 0) {
             return 0;  /* asked not to overwrite existing value. */
         }
     }
-    if (!SetEnvironmentVariable(name, *value ? value : NULL)) {
+    if (!SetEnvironmentVariableA(name, *value ? value : NULL)) {
         return -1;
     }
     return 0;
@@ -59,7 +58,7 @@
     size_t bufferlen;
 
     bufferlen =
-        GetEnvironmentVariable(name, SDL_envmem, (DWORD) SDL_envmemlen);
+        GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen);
     if (bufferlen == 0) {
         return NULL;
     }
@@ -70,7 +69,7 @@
         }
         SDL_envmem = newmem;
         SDL_envmemlen = bufferlen;
-        GetEnvironmentVariable(name, SDL_envmem, (DWORD) SDL_envmemlen);
+        GetEnvironmentVariableA(name, SDL_envmem, (DWORD) SDL_envmemlen);
     }
     return SDL_envmem;
 }
@@ -163,7 +162,7 @@
     return value;
 }
 
-#endif /* __WINDOWS__ */
+#endif /* __WIN32__ */
 
 #endif /* !HAVE_GETENV */
 
--- a/src/stdlib/SDL_stdlib.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/stdlib/SDL_stdlib.c	Tue Feb 01 00:37:02 2011 -0800
@@ -35,9 +35,7 @@
 __declspec(selectany) int _fltused = 1;
 #endif
 
-#ifdef _WIN64
-
-#else
+#ifdef _M_IX86
 
 void
 __declspec(naked)
--- a/src/thread/generic/SDL_syscond.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/generic/SDL_syscond.c	Tue Feb 01 00:37:02 2011 -0800
@@ -145,18 +145,19 @@
 Typical use:
 
 Thread A:
-	SDL_LockMutex(lock);
-	while ( ! condition ) {
-		SDL_CondWait(cond);
-	}
-	SDL_UnlockMutex(lock);
+    SDL_LockMutex(lock);
+    while ( ! condition ) {
+        SDL_CondWait(cond, lock);
+    }
+    SDL_UnlockMutex(lock);
 
 Thread B:
-	SDL_LockMutex(lock);
-	...
-	condition = true;
-	...
-	SDL_UnlockMutex(lock);
+    SDL_LockMutex(lock);
+    ...
+    condition = true;
+    ...
+    SDL_CondSignal(cond);
+    SDL_UnlockMutex(lock);
  */
 int
 SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
--- a/src/thread/pthread/SDL_syssem.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/pthread/SDL_syssem.c	Tue Feb 01 00:37:02 2011 -0800
@@ -21,6 +21,7 @@
 */
 #include "SDL_config.h"
 
+#include <errno.h>
 #include <pthread.h>
 #include <semaphore.h>
 
@@ -102,6 +103,8 @@
 SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
 {
     int retval;
+    struct timeval now;
+    struct timespec ts_timeout;
 
     if (!sem) {
         SDL_SetError("Passed a NULL semaphore");
@@ -116,16 +119,34 @@
         return SDL_SemWait(sem);
     }
 
-    /* Ack!  We have to busy wait... */
-    /* FIXME: Use sem_timedwait()? */
-    timeout += SDL_GetTicks();
+    /* Setup the timeout. sem_timedwait doesn't wait for
+    * a lapse of time, but until we reach a certain time.
+    * This time is now plus the timeout.
+    */
+    gettimeofday(&now, NULL);
+
+    /* Add our timeout to current time */
+    now.tv_usec += (timeout % 1000) * 1000;
+    now.tv_sec += timeout / 1000;
+
+    /* Wrap the second if needed */
+    if ( now.tv_usec >= 1000000 ) {
+        now.tv_usec -= 1000000;
+        now.tv_sec ++;
+    }
+
+    /* Convert to timespec */
+    ts_timeout.tv_sec = now.tv_sec;
+    ts_timeout.tv_nsec = now.tv_usec * 1000;
+
+    /* Wait. */
     do {
-        retval = SDL_SemTryWait(sem);
-        if (retval == 0) {
-            break;
-        }
-        SDL_Delay(1);
-    } while (SDL_GetTicks() < timeout);
+        retval = sem_timedwait(&sem->sem, &ts_timeout);
+    } while (retval < 0 && errno == EINTR);
+
+    if (retval < 0) {
+        SDL_SetError("sem_timedwait() failed");
+    }
 
     return retval;
 }
--- a/src/thread/pthread/SDL_systhread.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/pthread/SDL_systhread.c	Tue Feb 01 00:37:02 2011 -0800
@@ -34,14 +34,6 @@
     SIGVTALRM, SIGPROF, 0
 };
 
-#ifdef __RISCOS__
-/* RISC OS needs to know the main thread for
- * it's timer and event processing. */
-int riscos_using_threads = 0;
-SDL_threadID riscos_main_thread = 0;  /* Thread running events */
-#endif
-
-
 static void *
 RunThread(void *data)
 {
@@ -67,12 +59,6 @@
         SDL_SetError("Not enough resources to create thread");
         return (-1);
     }
-#ifdef __RISCOS__
-    if (riscos_using_threads == 0) {
-        riscos_using_threads = 1;
-        riscos_main_thread = SDL_ThreadID();
-    }
-#endif
 
     return (0);
 }
--- a/src/thread/riscos/SDL_syscond.c	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* RISC OS implementations uses pthreads based on linux code */
-
-#if SDL_THREADS_DISABLED
-#include "../generic/SDL_syscond.c"
-#else
-#include <sys/time.h>
-#include <unistd.h>
-#include <pthread.h>
-
-#include "SDL_thread.h"
-#include "SDL_sysmutex_c.h"
-
-struct SDL_cond
-{
-    pthread_cond_t cond;
-};
-
-/* Create a condition variable */
-SDL_cond *
-SDL_CreateCond(void)
-{
-    SDL_cond *cond;
-
-    cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
-    if (cond) {
-        if (pthread_cond_init(&cond->cond, NULL) < 0) {
-            SDL_SetError("pthread_cond_init() failed");
-            SDL_free(cond);
-            cond = NULL;
-        }
-    }
-    return (cond);
-}
-
-/* Destroy a condition variable */
-void
-SDL_DestroyCond(SDL_cond * cond)
-{
-    if (cond) {
-        pthread_cond_destroy(&cond->cond);
-        SDL_free(cond);
-    }
-}
-
-/* Restart one of the threads that are waiting on the condition variable */
-int
-SDL_CondSignal(SDL_cond * cond)
-{
-    int retval;
-
-    if (!cond) {
-        SDL_SetError("Passed a NULL condition variable");
-        return -1;
-    }
-
-    retval = 0;
-    if (pthread_cond_signal(&cond->cond) != 0) {
-        SDL_SetError("pthread_cond_signal() failed");
-        retval = -1;
-    }
-    return retval;
-}
-
-/* Restart all threads that are waiting on the condition variable */
-int
-SDL_CondBroadcast(SDL_cond * cond)
-{
-    int retval;
-
-    if (!cond) {
-        SDL_SetError("Passed a NULL condition variable");
-        return -1;
-    }
-
-    retval = 0;
-    if (pthread_cond_broadcast(&cond->cond) != 0) {
-        SDL_SetError("pthread_cond_broadcast() failed");
-        retval = -1;
-    }
-    return retval;
-}
-
-int
-SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
-{
-    int retval;
-    struct timeval delta;
-    struct timespec abstime;
-
-    if (!cond) {
-        SDL_SetError("Passed a NULL condition variable");
-        return -1;
-    }
-
-    gettimeofday(&delta, NULL);
-
-    abstime.tv_sec = delta.tv_sec + (ms / 1000);
-    abstime.tv_nsec = (delta.tv_usec + (ms % 1000) * 1000) * 1000;
-    if (abstime.tv_nsec > 1000000000) {
-        abstime.tv_sec += 1;
-        abstime.tv_nsec -= 1000000000;
-    }
-
-  tryagain:
-    retval = pthread_cond_timedwait(&cond->cond, &mutex->id, &abstime);
-    switch (retval) {
-    case EINTR:
-        goto tryagain;
-        break;
-    case ETIMEDOUT:
-        retval = SDL_MUTEX_TIMEDOUT;
-        break;
-    case 0:
-        break;
-    default:
-        SDL_SetError("pthread_cond_timedwait() failed");
-        retval = -1;
-        break;
-    }
-    return retval;
-}
-
-/* Wait on the condition variable, unlocking the provided mutex.
-   The mutex must be locked before entering this function!
- */
-int
-SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
-{
-    int retval;
-
-    if (!cond) {
-        SDL_SetError("Passed a NULL condition variable");
-        return -1;
-    }
-
-    retval = 0;
-    if (pthread_cond_wait(&cond->cond, &mutex->id) != 0) {
-        SDL_SetError("pthread_cond_wait() failed");
-        retval = -1;
-    }
-    return retval;
-}
-#endif
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/riscos/SDL_sysmutex.c	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* RISC OS implementations uses pthreads based on linux code */
-
-#include "SDL_thread.h"
-
-#if SDL_THREADS_DISABLED
-#include "../generic/SDL_sysmutex.c"
-#else
-
-#include <pthread.h>
-
-struct SDL_mutex
-{
-    pthread_mutex_t id;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
-    int recursive;
-    pthread_t owner;
-#endif
-};
-
-SDL_mutex *
-SDL_CreateMutex(void)
-{
-    SDL_mutex *mutex;
-    pthread_mutexattr_t attr;
-
-    /* Allocate the structure */
-    mutex = (SDL_mutex *) SDL_calloc(1, sizeof(*mutex));
-    if (mutex) {
-        pthread_mutexattr_init(&attr);
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
-        /* No extra attributes necessary */
-#else
-        pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */
-        if (pthread_mutex_init(&mutex->id, &attr) != 0) {
-            SDL_SetError("pthread_mutex_init() failed");
-            SDL_free(mutex);
-            mutex = NULL;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return (mutex);
-}
-
-void
-SDL_DestroyMutex(SDL_mutex * mutex)
-{
-    if (mutex) {
-        pthread_mutex_destroy(&mutex->id);
-        SDL_free(mutex);
-    }
-}
-
-/* Lock the mutex */
-int
-SDL_mutexP(SDL_mutex * mutex)
-{
-    int retval;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
-    pthread_t this_thread;
-#endif
-
-    if (mutex == NULL) {
-        SDL_SetError("Passed a NULL mutex");
-        return -1;
-    }
-
-    retval = 0;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
-    this_thread = pthread_self();
-    if (mutex->owner == this_thread) {
-        ++mutex->recursive;
-    } else {
-        /* The order of operations is important.
-           We set the locking thread id after we obtain the lock
-           so unlocks from other threads will fail.
-         */
-        if (pthread_mutex_lock(&mutex->id) == 0) {
-            mutex->owner = this_thread;
-            mutex->recursive = 0;
-        } else {
-            SDL_SetError("pthread_mutex_lock() failed");
-            retval = -1;
-        }
-    }
-#else
-    if (pthread_mutex_lock(&mutex->id) < 0) {
-        SDL_SetError("pthread_mutex_lock() failed");
-        retval = -1;
-    }
-#endif
-    return retval;
-}
-
-int
-SDL_mutexV(SDL_mutex * mutex)
-{
-    int retval;
-
-    if (mutex == NULL) {
-        SDL_SetError("Passed a NULL mutex");
-        return -1;
-    }
-
-    retval = 0;
-#if SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX
-    /* We can only unlock the mutex if we own it */
-    if (pthread_self() == mutex->owner) {
-        if (mutex->recursive) {
-            --mutex->recursive;
-        } else {
-            /* The order of operations is important.
-               First reset the owner so another thread doesn't lock
-               the mutex and set the ownership before we reset it,
-               then release the lock semaphore.
-             */
-            mutex->owner = 0;
-            pthread_mutex_unlock(&mutex->id);
-        }
-    } else {
-        SDL_SetError("mutex not owned by this thread");
-        retval = -1;
-    }
-
-#else
-    if (pthread_mutex_unlock(&mutex->id) < 0) {
-        SDL_SetError("pthread_mutex_unlock() failed");
-        retval = -1;
-    }
-#endif /* SDL_THREAD_PTHREAD_NO_RECURSIVE_MUTEX */
-
-    return retval;
-}
-#endif
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/riscos/SDL_sysmutex_c.h	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#ifndef _SDL_mutex_c_h
-#define _SDL_mutex_c_h
-
-#if !SDL_THREADS_DISABLED
-struct SDL_mutex
-{
-    pthread_mutex_t id;
-};
-#endif
-
-
-#endif /* _SDL_mutex_c_h */
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/riscos/SDL_syssem.c	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* RISC OS semiphores based on linux code */
-
-
-#include "SDL_timer.h"
-#include "SDL_thread.h"
-#include "SDL_systhread_c.h"
-
-#if !SDL_THREADS_DISABLED
-
-SDL_sem *
-SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_SetError("SDL not configured with thread support");
-    return (SDL_sem *) 0;
-}
-
-void
-SDL_DestroySemaphore(SDL_sem * sem)
-{
-    return;
-}
-
-int
-SDL_SemTryWait(SDL_sem * sem)
-{
-    SDL_SetError("SDL not configured with thread support");
-    return -1;
-}
-
-int
-SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
-{
-    SDL_SetError("SDL not configured with thread support");
-    return -1;
-}
-
-int
-SDL_SemWait(SDL_sem * sem)
-{
-    SDL_SetError("SDL not configured with thread support");
-    return -1;
-}
-
-Uint32
-SDL_SemValue(SDL_sem * sem)
-{
-    return 0;
-}
-
-int
-SDL_SemPost(SDL_sem * sem)
-{
-    SDL_SetError("SDL not configured with thread support");
-    return -1;
-}
-
-#else
-
-
-#include <unistd.h>             /* For getpid() */
-#include <pthread.h>
-#include <semaphore.h>
-
-struct SDL_semaphore
-{
-    sem_t *sem;
-    sem_t sem_data;
-};
-
-/* Create a semaphore, initialized with value */
-SDL_sem *
-SDL_CreateSemaphore(Uint32 initial_value)
-{
-    SDL_sem *sem = (SDL_sem *) SDL_malloc(sizeof(SDL_sem));
-    if (sem) {
-        if (sem_init(&sem->sem_data, 0, initial_value) < 0) {
-            SDL_SetError("sem_init() failed");
-            SDL_free(sem);
-            sem = NULL;
-        } else {
-            sem->sem = &sem->sem_data;
-        }
-    } else {
-        SDL_OutOfMemory();
-    }
-    return sem;
-}
-
-void
-SDL_DestroySemaphore(SDL_sem * sem)
-{
-    if (sem) {
-        sem_destroy(sem->sem);
-        SDL_free(sem);
-    }
-}
-
-int
-SDL_SemTryWait(SDL_sem * sem)
-{
-    int retval;
-
-    if (!sem) {
-        SDL_SetError("Passed a NULL semaphore");
-        return -1;
-    }
-    retval = SDL_MUTEX_TIMEDOUT;
-    if (sem_trywait(sem->sem) == 0) {
-        retval = 0;
-    }
-    return retval;
-}
-
-int
-SDL_SemWait(SDL_sem * sem)
-{
-    int retval;
-
-    if (!sem) {
-        SDL_SetError("Passed a NULL semaphore");
-        return -1;
-    }
-
-    retval = sem_wait(sem->sem);
-    if (retval < 0) {
-        SDL_SetError("sem_wait() failed");
-    }
-    return retval;
-}
-
-int
-SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
-{
-    int retval;
-
-    if (!sem) {
-        SDL_SetError("Passed a NULL semaphore");
-        return -1;
-    }
-
-    /* Try the easy cases first */
-    if (timeout == 0) {
-        return SDL_SemTryWait(sem);
-    }
-    if (timeout == SDL_MUTEX_MAXWAIT) {
-        return SDL_SemWait(sem);
-    }
-
-    /* Ack!  We have to busy wait... */
-    timeout += SDL_GetTicks();
-    do {
-        retval = SDL_SemTryWait(sem);
-        if (retval == 0) {
-            break;
-        }
-        SDL_Delay(1);
-    } while (SDL_GetTicks() < timeout);
-
-    return retval;
-}
-
-Uint32
-SDL_SemValue(SDL_sem * sem)
-{
-    int ret = 0;
-    if (sem) {
-        sem_getvalue(sem->sem, &ret);
-        if (ret < 0) {
-            ret = 0;
-        }
-    }
-    return (Uint32) ret;
-}
-
-int
-SDL_SemPost(SDL_sem * sem)
-{
-    int retval;
-
-    if (!sem) {
-        SDL_SetError("Passed a NULL semaphore");
-        return -1;
-    }
-
-    retval = sem_post(sem->sem);
-    if (retval < 0) {
-        SDL_SetError("sem_post() failed");
-    }
-    return retval;
-}
-
-#endif /* !SDL_THREADS_DISABLED */
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/riscos/SDL_systhread.c	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* RISC OS version based on pthreads linux source */
-
-#include "SDL_thread.h"
-#include "../SDL_systhread.h"
-
-#if SDL_THREADS_DISABLED
-
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
-{
-    SDL_SetError
-        ("Threads have not been compiled into this version of the library");
-    return (-1);
-}
-
-void
-SDL_SYS_SetupThread(void)
-{
-    return;
-}
-
-SDL_threadID
-SDL_ThreadID(void)
-{
-    return (0);
-}
-
-void
-SDL_SYS_WaitThread(SDL_Thread * thread)
-{
-    return;
-}
-
-#else
-
-#include <signal.h>
-
-/* List of signals to mask in the subthreads */
-static int sig_list[] = {
-    SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
-    SIGVTALRM, SIGPROF, 0
-};
-
-#include <pthread.h>
-
-int riscos_using_threads = 0;
-Uint32 riscos_main_thread = 0;  /* Thread running events */
-
-static void *
-RunThread(void *data)
-{
-    SDL_RunThread(data);
-    pthread_exit((void *) 0);
-    return ((void *) 0);        /* Prevent compiler warning */
-}
-
-int
-SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
-{
-    pthread_attr_t type;
-
-    /* Set the thread attributes */
-    if (pthread_attr_init(&type) != 0) {
-        SDL_SetError("Couldn't initialize pthread attributes");
-        return (-1);
-    }
-    pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
-
-    /* Create the thread and go! */
-    if (pthread_create(&thread->handle, &type, RunThread, args) != 0) {
-        SDL_SetError("Not enough resources to create thread");
-        return (-1);
-    }
-
-    if (riscos_using_threads == 0) {
-        riscos_using_threads = 1;
-        riscos_main_thread = SDL_ThreadID();
-    }
-
-    return (0);
-}
-
-void
-SDL_SYS_SetupThread(void)
-{
-    int i;
-    sigset_t mask;
-
-    /* Mask asynchronous signals for this thread */
-    sigemptyset(&mask);
-    for (i = 0; sig_list[i]; ++i) {
-        sigaddset(&mask, sig_list[i]);
-    }
-    pthread_sigmask(SIG_BLOCK, &mask, 0);
-
-#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
-    /* Allow ourselves to be asynchronously cancelled */
-    {
-        int oldstate;
-        pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate);
-    }
-#endif
-}
-
-Uint32
-SDL_ThreadID(void)
-{
-    return ((Uint32) pthread_self());
-}
-
-void
-SDL_SYS_WaitThread(SDL_Thread * thread)
-{
-    pthread_join(thread->handle, 0);
-}
-
-#endif
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/riscos/SDL_systhread_c.h	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-#if SDL_THREADS_DISABLED
-
-typedef int SYS_ThreadHandle;
-
-#else
-
-#include <pthread.h>
-
-typedef pthread_t SYS_ThreadHandle;
-
-#endif
-
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/windows/SDL_sysmutex.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/windows/SDL_sysmutex.c	Tue Feb 01 00:37:02 2011 -0800
@@ -23,8 +23,7 @@
 
 /* Mutex functions using the Win32 API */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 
 #include "SDL_mutex.h"
 
--- a/src/thread/windows/SDL_syssem.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/windows/SDL_syssem.c	Tue Feb 01 00:37:02 2011 -0800
@@ -23,8 +23,7 @@
 
 /* Semaphore functions using the Win32 API */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 
 #include "SDL_thread.h"
 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
@@ -39,7 +38,7 @@
 #else
     HANDLE id;
 #endif
-    LONG volatile count;
+    LONG count;
 };
 
 
--- a/src/thread/windows/SDL_systhread.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/windows/SDL_systhread.c	Tue Feb 01 00:37:02 2011 -0800
@@ -23,12 +23,10 @@
 
 /* Win32 thread management routines for SDL */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
 #include "SDL_thread.h"
 #include "../SDL_thread_c.h"
 #include "../SDL_systhread.h"
+#include "SDL_systhread_c.h"
 
 #ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD
 #ifndef _WIN32_WCE
--- a/src/thread/windows/SDL_systhread_c.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/windows/SDL_systhread_c.h	Tue Feb 01 00:37:02 2011 -0800
@@ -21,9 +21,13 @@
 */
 #include "SDL_config.h"
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#ifndef _SDL_systhread_c_h
+#define _SDL_systhread_c_h
+
+#include "../../core/windows/SDL_windows.h"
 
 typedef HANDLE SYS_ThreadHandle;
 
+#endif /* _SDL_systhread_c_h */
+
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/windows/win_ce_semaphore.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/thread/windows/win_ce_semaphore.c	Tue Feb 01 00:37:02 2011 -0800
@@ -28,8 +28,7 @@
       and it is not clear how to handle a mixture of WCE semaphores and normal
       events and mutexes. */
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+#include "../../core/windows/SDL_windows.h"
 
 #include "win_ce_semaphore.h"
 
--- a/src/timer/SDL_systimer.h	Mon Jan 31 07:36:12 2011 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-    SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-    Sam Lantinga
-    slouken@libsdl.org
-*/
-#include "SDL_config.h"
-
-/* The system dependent timer handling functions */
-
-#include "SDL_timer.h"
-#include "SDL_timer_c.h"
-
-
-/* Initialize the system dependent timer subsystem */
-extern int SDL_SYS_TimerInit(void);
-
-/* Quit the system dependent timer subsystem */
-extern void SDL_SYS_TimerQuit(void);
-
-/* Start a timer set up by SDL_SetTimer() */
-extern int SDL_SYS_StartTimer(void);
-
-/* Stop a previously started timer */
-extern void SDL_SYS_StopTimer(void);
-
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/timer/SDL_timer.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/timer/SDL_timer.c	Tue Feb 01 00:37:02 2011 -0800
@@ -23,289 +23,364 @@
 
 #include "SDL_timer.h"
 #include "SDL_timer_c.h"
-#include "SDL_mutex.h"
-#include "SDL_systimer.h"
+#include "SDL_atomic.h"
+#include "SDL_cpuinfo.h"
+#include "SDL_thread.h"
 
 /* #define DEBUG_TIMERS */
 
-int SDL_timer_started = 0;
-int SDL_timer_running = 0;
+typedef struct _SDL_Timer
+{
+    int timerID;
+    SDL_TimerCallback callback;
+    void *param;
+    Uint32 interval;
+    Uint32 scheduled;
+    volatile SDL_bool canceled;
+    struct _SDL_Timer *next;
+} SDL_Timer;
+
+typedef struct _SDL_TimerMap
+{
+    int timerID;
+    SDL_Timer *timer;
+    struct _SDL_TimerMap *next;
+} SDL_TimerMap;
 
-/* Data to handle a single periodic alarm */
-Uint32 SDL_alarm_interval = 0;
-SDL_TimerCallback SDL_alarm_callback;
+/* The timers are kept in a sorted list */
+typedef struct {
+    /* Data used by the main thread */
+    SDL_Thread *thread;
+    SDL_atomic_t nextID;
+    SDL_TimerMap *timermap;
+    SDL_mutex *timermap_lock;
+
+    /* Padding to separate cache lines between threads */
+    char cache_pad[SDL_CACHELINE_SIZE];
+
+    /* Data used to communicate with the timer thread */
+    SDL_SpinLock lock;
+    SDL_sem *sem;
+    SDL_Timer * volatile pending;
+    SDL_Timer * volatile freelist;
+    volatile SDL_bool active;
+
+    /* List of timers - this is only touched by the timer thread */
+    SDL_Timer *timers;
+} SDL_TimerData;
 
-/* Data used for a thread-based timer */
-static int SDL_timer_threaded = 0;
+static SDL_TimerData SDL_timer_data;
+
 
-struct _SDL_TimerID
+/* The idea here is that any thread might add a timer, but a single
+ * thread manages the active timer queue, sorted by scheduling time.
+ *
+ * Timers are removed by simply setting a canceled flag
+ */
+
+static void
+SDL_AddTimerInternal(SDL_TimerData *data, SDL_Timer *timer)
 {
-    Uint32 interval;
-    SDL_NewTimerCallback cb;
-    void *param;
-    Uint32 last_alarm;
-    struct _SDL_TimerID *next;
-};
+    SDL_Timer *prev, *curr;
+
+    prev = NULL;
+    for (curr = data->timers; curr; prev = curr, curr = curr->next) {
+        if ((Sint32)(timer->scheduled-curr->scheduled) < 0) {
+            break;
+        }
+    }
+
+    /* Insert the timer here! */
+    if (prev) {
+        prev->next = timer;
+    } else {
+        data->timers = timer;
+    }
+    timer->next = curr;
+}
+
+static int
+SDL_TimerThread(void *_data)
+{
+    SDL_TimerData *data = (SDL_TimerData *)_data;
+    SDL_Timer *pending;
+    SDL_Timer *current;
+    SDL_Timer *freelist_head = NULL;
+    SDL_Timer *freelist_tail = NULL;
+    Uint32 tick, now, interval, delay;
 
-static SDL_TimerID SDL_timers = NULL;
-static SDL_mutex *SDL_timer_mutex;
-static volatile SDL_bool list_changed = SDL_FALSE;
+    /* Threaded timer loop:
+     *  1. Queue timers added by other threads
+     *  2. Handle any timers that should dispatch this cycle
+     *  3. Wait until next dispatch time or new timer arrives
+     */
+    for ( ; ; ) {
+        /* Pending and freelist maintenance */
+        SDL_AtomicLock(&data->lock);
+        {
+            /* Get any timers ready to be queued */
+            pending = data->pending;
+            data->pending = NULL;
+
+            /* Make any unused timer structures available */
+            if (freelist_head) {
+                freelist_tail->next = data->freelist;
+                data->freelist = freelist_head;
+            }
+        }
+        SDL_AtomicUnlock(&data->lock);
+
+        /* Sort the pending timers into our list */
+        while (pending) {
+            current = pending;
+            pending = pending->next;
+            SDL_AddTimerInternal(data, current);
+        }
+        freelist_head = NULL;
+        freelist_tail = NULL;
+
+        /* Check to see if we're still running, after maintenance */
+        if (!data->active) {
+            break;
+        }
+
+        /* Initial delay if there are no timers */
+        delay = SDL_MUTEX_MAXWAIT;
+
+        tick = SDL_GetTicks();
+
+        /* Process all the pending timers for this tick */
+        while (data->timers) {
+            current = data->timers;
 
-/* Set whether or not the timer should use a thread.
-   This should not be called while the timer subsystem is running.
-*/
-int
-SDL_SetTimerThreaded(int value)
-{
-    int retval;
+            if ((Sint32)(tick-current->scheduled) < 0) {
+                /* Scheduled for the future, wait a bit */
+                delay = (current->scheduled - tick);
+                break;
+            }
+
+            /* We're going to do something with this timer */
+            data->timers = current->next;
+
+            if (current->canceled) {
+                interval = 0;
+            } else {
+                interval = current->callback(current->interval, current->param);
+            }
 
-    if (SDL_timer_started) {
-        SDL_SetError("Timer already initialized");
-        retval = -1;
-    } else {
-        retval = 0;
-        SDL_timer_threaded = value;
+            if (interval > 0) {
+                /* Reschedule this timer */
+                current->scheduled = tick + interval;
+                SDL_AddTimerInternal(data, current);
+            } else {
+                if (!freelist_head) {
+                    freelist_head = current;
+                }
+                if (freelist_tail) {
+                    freelist_tail->next = current;
+                }
+                freelist_tail = current;
+
+                current->canceled = SDL_TRUE;
+            }
+        }
+
+        /* Adjust the delay based on processing time */
+        now = SDL_GetTicks();
+        interval = (now - tick);
+        if (interval > delay) {
+            delay = 0;
+        } else {
+            delay -= interval;
+        }
+
+        /* Note that each time a timer is added, this will return
+           immediately, but we process the timers added all at once.
+           That's okay, it just means we run through the loop a few
+           extra times.
+         */
+        SDL_SemWaitTimeout(data->sem, delay);
     }
-    return retval;
+    return 0;
 }
 
 int
 SDL_TimerInit(void)
 {
-    int retval;
+    SDL_TimerData *data = &SDL_timer_data;
+
+    if (!data->active) {
+        data->timermap_lock = SDL_CreateMutex();
+        if (!data->timermap_lock) {
+            return -1;
+        }
+
+        data->sem = SDL_CreateSemaphore(0);
+        if (!data->sem) {
+            SDL_DestroyMutex(data->timermap_lock);
+            return -1;
+        }
 
-    retval = 0;
-    if (SDL_timer_started) {
-        SDL_TimerQuit();
+        data->active = SDL_TRUE;
+        /* !!! FIXME: this is nasty. */
+#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
+#undef SDL_CreateThread
+        data->thread = SDL_CreateThread(SDL_TimerThread, data, NULL, NULL);
+#else
+        data->thread = SDL_CreateThread(SDL_TimerThread, data);
+#endif
+        if (!data->thread) {
+            SDL_TimerQuit();
+            return -1;
+        }
+
+        SDL_AtomicSet(&data->nextID, 1);
     }
-    if (!SDL_timer_threaded) {
-        retval = SDL_SYS_TimerInit();
-    }
-    if (SDL_timer_threaded) {
-        SDL_timer_mutex = SDL_CreateMutex();
-    }
-    if (retval == 0) {
-        SDL_timer_started = 1;
-    }
-    return (retval);
+    return 0;
 }
 
 void
 SDL_TimerQuit(void)
 {
-    SDL_SetTimer(0, NULL);
-    if (SDL_timer_threaded < 2) {
-        SDL_SYS_TimerQuit();
-    }
-    if (SDL_timer_threaded) {
-        SDL_DestroyMutex(SDL_timer_mutex);
-        SDL_timer_mutex = NULL;
-    }
-    SDL_timer_started = 0;
-    SDL_timer_threaded = 0;
-}
+    SDL_TimerData *data = &SDL_timer_data;
+    SDL_Timer *timer;
+    SDL_TimerMap *entry;
+
+    if (data->active) {
+        data->active = SDL_FALSE;
 
-void
-SDL_ThreadedTimerCheck(void)
-{
-    Uint32 now, ms;
-    SDL_TimerID t, prev, next;
-    SDL_bool removed;
-
-    SDL_mutexP(SDL_timer_mutex);
+        /* Shutdown the timer thread */
+        if (data->thread) {
+            SDL_SemPost(data->sem);
+            SDL_WaitThread(data->thread, NULL);
+            data->thread = NULL;
+        }
 
-    now = SDL_GetTicks();
-    do {
-        list_changed = SDL_FALSE;
-        for (prev = NULL, t = SDL_timers; t; t = next) {
-            removed = SDL_FALSE;
-            ms = t->interval - SDL_TIMESLICE;
-            next = t->next;
-            if ((int) (now - t->last_alarm) > (int) ms) {
-                struct _SDL_TimerID timer;
+        SDL_DestroySemaphore(data->sem);
+        data->sem = NULL;
 
-                if ((now - t->last_alarm) < t->interval) {
-                    t->last_alarm += t->interval;
-                } else {
-                    t->last_alarm = now;
-                }
-#ifdef DEBUG_TIMERS
-                printf("Executing timer %p (thread = %lu)\n",
-                       t, SDL_ThreadID());
-#endif
-                timer = *t;
-                SDL_mutexV(SDL_timer_mutex);
-                ms = timer.cb(timer.interval, timer.param);
-                SDL_mutexP(SDL_timer_mutex);
-                if (list_changed) {
-                    next = t->next;
-                    for (prev = SDL_timers; prev; prev = prev->next) {
-                        if (prev->next == t)
-                            break;
-                    }
-                }
-                if (ms != t->interval) {
-                    if (ms) {
-                        t->interval = ROUND_RESOLUTION(ms);
-                    } else {
-                        /* Remove timer from the list */
-#ifdef DEBUG_TIMERS
-                        printf("SDL: Removing timer %p\n", t);
-#endif
-                        if (prev) {
-                            prev->next = next;
-                        } else {
-                            SDL_timers = next;
-                        }
-                        SDL_free(t);
-                        --SDL_timer_running;
-                        removed = SDL_TRUE;
-                    }
-                }
-                if (list_changed) {
-                    /* Abort, list of timers modified */
-                    break;
-                }
-            }
-            /* Don't update prev if the timer has disappeared */
-            if (!removed) {
-                prev = t;
-            }
+        /* Clean up the timer entries */
+        while (data->timers) {
+            timer = data->timers;
+            data->timers = timer->next;
+            SDL_free(timer);
         }
-    } while (list_changed);
-
-    SDL_mutexV(SDL_timer_mutex);
-}
+        while (data->freelist) {
+            timer = data->freelist;
+            data->freelist = timer->next;
+            SDL_free(timer);
+        }
+        while (data->timermap) {
+            entry = data->timermap;
+            data->timermap = entry->next;
+            SDL_free(entry);
+        }
 
-static SDL_TimerID
-SDL_AddTimerInternal(Uint32 interval, SDL_NewTimerCallback callback,
-                     void *param)
-{
-    SDL_TimerID t;
-    t = (SDL_TimerID) SDL_malloc(sizeof(struct _SDL_TimerID));
-    if (t) {
-        t->interval = ROUND_RESOLUTION(interval);
-        t->cb = callback;
-        t->param = param;
-        t->last_alarm = SDL_GetTicks();
-        t->next = SDL_timers;
-        SDL_timers = t;
-        ++SDL_timer_running;
-        list_changed = SDL_TRUE;
+        SDL_DestroyMutex(data->timermap_lock);
+        data->timermap_lock = NULL;
     }
-#ifdef DEBUG_TIMERS
-    printf("SDL_AddTimer(%d) = %08x num_timers = %d\n", interval, (Uint32) t,
-           SDL_timer_running);
-#endif
-    return t;
 }
 
 SDL_TimerID
-SDL_AddTimer(Uint32 interval, SDL_NewTimerCallback callback, void *param)
+SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param)
 {
-    SDL_TimerID t;
-    if (!SDL_timer_mutex) {
-        if (SDL_timer_started) {
-            SDL_SetError("This platform doesn't support multiple timers");
-        } else {
-            SDL_SetError("You must call SDL_Init(SDL_INIT_TIMER) first");
+    SDL_TimerData *data = &SDL_timer_data;
+    SDL_Timer *timer;
+    SDL_TimerMap *entry;
+
+    if (!data->active) {
+        int status = 0;
+
+        SDL_AtomicLock(&data->lock);
+        if (!data->active) {
+            status = SDL_TimerInit();
+        }
+        SDL_AtomicUnlock(&data->lock);
+
+        if (status < 0) {
+            return 0;
         }
-        return NULL;
+    }
+
+    SDL_AtomicLock(&data->lock);
+    timer = data->freelist;
+    if (timer) {
+        data->freelist = timer->next;
+    }
+    SDL_AtomicUnlock(&data->lock);
+
+    if (timer) {
+        SDL_RemoveTimer(timer->timerID);
+    } else {
+        timer = (SDL_Timer *)SDL_malloc(sizeof(*timer));
+        if (!timer) {
+            SDL_OutOfMemory();
+            return 0;
+        }
     }
-    if (!SDL_timer_threaded) {
-        SDL_SetError("Multiple timers require threaded events!");
-        return NULL;
+    timer->timerID = SDL_AtomicIncRef(&data->nextID);
+    timer->callback = callback;
+    timer->param = param;
+    timer->interval = interval;
+    timer->scheduled = SDL_GetTicks() + interval;
+    timer->canceled = SDL_FALSE;
+ 
+    entry = (SDL_TimerMap *)SDL_malloc(sizeof(*entry));
+    if (!entry) {
+        SDL_free(timer);
+        SDL_OutOfMemory();
+        return 0;
     }
-    SDL_mutexP(SDL_timer_mutex);
-    t = SDL_AddTimerInternal(interval, callback, param);
-    SDL_mutexV(SDL_timer_mutex);
-    return t;
+    entry->timer = timer;
+    entry->timerID = timer->timerID;
+
+    SDL_mutexP(data->timermap_lock);
+    entry->next = data->timermap;
+    data->timermap = entry;
+    SDL_mutexV(data->timermap_lock);
+
+    /* Add the timer to the pending list for the timer thread */
+    SDL_AtomicLock(&data->lock);
+    timer->next = data->pending;
+    data->pending = timer;
+    SDL_AtomicUnlock(&data->lock);
+
+    /* Wake up the timer thread if necessary */
+    SDL_SemPost(data->sem);
+
+    return entry->timerID;
 }
 
 SDL_bool
 SDL_RemoveTimer(SDL_TimerID id)
 {
-    SDL_TimerID t, prev = NULL;
-    SDL_bool removed;
+    SDL_TimerData *data = &SDL_timer_data;
+    SDL_TimerMap *prev, *entry;
+    SDL_bool canceled = SDL_FALSE;
 
-    removed = SDL_FALSE;
-    SDL_mutexP(SDL_timer_mutex);
-    /* Look for id in the linked list of timers */
-    for (t = SDL_timers; t; prev = t, t = t->next) {
-        if (t == id) {
+    /* Find the timer */
+    SDL_mutexP(data->timermap_lock);
+    prev = NULL;
+    for (entry = data->timermap; entry; prev = entry, entry = entry->next) {
+        if (entry->timerID == id) {
             if (prev) {
-                prev->next = t->next;
+                prev->next = entry->next;
             } else {
-                SDL_timers = t->next;
+                data->timermap = entry->next;
             }
-            SDL_free(t);
-            --SDL_timer_running;
-            removed = SDL_TRUE;
-            list_changed = SDL_TRUE;
             break;
         }
     }
-#ifdef DEBUG_TIMERS
-    printf("SDL_RemoveTimer(%08x) = %d num_timers = %d thread = %lu\n",
-           (Uint32) id, removed, SDL_timer_running, SDL_ThreadID());
-#endif
-    SDL_mutexV(SDL_timer_mutex);
-    return removed;
-}
+    SDL_mutexV(data->timermap_lock);
 
-/* Old style callback functions are wrapped through this */
-static Uint32 SDLCALL
-callback_wrapper(Uint32 ms, void *param)
-{
-    SDL_TimerCallback func = (SDL_TimerCallback) param;
-    return (*func) (ms);
-}
-
-int
-SDL_SetTimer(Uint32 ms, SDL_TimerCallback callback)
-{
-    int retval;
-
-#ifdef DEBUG_TIMERS
-    printf("SDL_SetTimer(%d)\n", ms);
-#endif
-    retval = 0;
-
-    if (SDL_timer_threaded) {
-        SDL_mutexP(SDL_timer_mutex);
+    if (entry) {
+        if (!entry->timer->canceled) {
+            entry->timer->canceled = SDL_TRUE;
+            canceled = SDL_TRUE;
+        }
+        SDL_free(entry);
     }
-    if (SDL_timer_running) {    /* Stop any currently running timer */
-        if (SDL_timer_threaded) {
-            while (SDL_timers) {
-                SDL_TimerID freeme = SDL_timers;
-                SDL_timers = SDL_timers->next;
-                SDL_free(freeme);
-            }
-            SDL_timer_running = 0;
-            list_changed = SDL_TRUE;
-        } else {
-            SDL_SYS_StopTimer();
-            SDL_timer_running = 0;
-        }
-    }
-    if (ms) {
-        if (SDL_timer_threaded) {
-            if (SDL_AddTimerInternal
-                (ms, callback_wrapper, (void *) callback) == NULL) {
-                retval = -1;
-            }
-        } else {
-            SDL_timer_running = 1;
-            SDL_alarm_interval = ms;
-            SDL_alarm_callback = callback;
-            retval = SDL_SYS_StartTimer();
-        }
-    }
-    if (SDL_timer_threaded) {
-        SDL_mutexV(SDL_timer_mutex);
-    }
-
-    return retval;
+    return canceled;
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/timer/SDL_timer_c.h	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/timer/SDL_timer_c.h	Tue Feb 01 00:37:02 2011 -0800
@@ -27,21 +27,7 @@
 #define ROUND_RESOLUTION(X)	\
 	(((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION)
 
-extern int SDL_timer_started;
-extern int SDL_timer_running;
-
-/* Data to handle a single periodic alarm */
-extern Uint32 SDL_alarm_interval;
-extern SDL_TimerCallback SDL_alarm_callback;
-
-/* Set whether or not the timer should use a thread.
-   This should be called while the timer subsystem is running.
-*/
-extern int SDL_SetTimerThreaded(int value);
-
 extern int SDL_TimerInit(void);
 extern void SDL_TimerQuit(void);
 
-/* This function is called from the SDL event thread if it is available */
-extern void SDL_ThreadedTimerCheck(void);
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/timer/beos/SDL_systimer.c	Mon Jan 31 07:36:12 2011 -0800
+++ b/src/timer/beos/SDL_systimer.c	Tue Feb 01 00:37:02 2011 -0800
@@ -25,9 +25,7 @@
 
 #include <be/kernel/OS.h>
 
-#include "SDL_thread.h"