Removed outdated Dreamcast support
authorSam Lantinga <slouken@libsdl.org>
Sat, 19 Sep 2009 07:21:22 +0000
changeset 3272e8f63b28947d
parent 3271 32fc3ba8df0b
child 3273 e0dfba770eb7
Removed outdated Dreamcast support
Makefile.dc
Makefile.in
README
README.DC
VisualCE/SDLMain/SDLmain.vcp
VisualCE/loopwave/loopwave.vcp
VisualCE/testalpha/testalpha.vcp
VisualCE/testtimer/testtimer.vcp
VisualCE/testwin/testwin.vcp
Xcode/SDL/pkg-support/resources/ReadMe.txt
include/SDL.h
include/SDL_config.h.default
include/SDL_config.h.in
include/SDL_config_dreamcast.h
src/audio/SDL_audio.c
src/audio/dc/SDL_dcaudio.c
src/audio/dc/SDL_dcaudio.h
src/audio/dc/aica.c
src/audio/dc/aica.h
src/joystick/dc/SDL_sysjoystick.c
src/power/SDL_power.c
src/thread/SDL_thread_c.h
src/thread/dc/SDL_syscond.c
src/thread/dc/SDL_syscond_c.h
src/thread/dc/SDL_sysmutex.c
src/thread/dc/SDL_sysmutex_c.h
src/thread/dc/SDL_syssem.c
src/thread/dc/SDL_syssem_c.h
src/thread/dc/SDL_systhread.c
src/thread/dc/SDL_systhread_c.h
src/timer/dc/SDL_systimer.c
src/video/SDL_sysvideo.h
src/video/SDL_video.c
src/video/dc/SDL_dcevents.c
src/video/dc/SDL_dcevents_c.h
src/video/dc/SDL_dcmouse.c
src/video/dc/SDL_dcmouse_c.h
src/video/dc/SDL_dcvideo.c
src/video/dc/SDL_dcvideo.h
     1.1 --- a/Makefile.dc	Sat Sep 19 07:09:41 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,113 +0,0 @@
     1.4 -#GL=1
     1.5 -
     1.6 -CC = sh-elf-gcc
     1.7 -AR = sh-elf-ar
     1.8 -
     1.9 -ifdef GL
    1.10 -DEFS += -DSDL_VIDEO_OPENGL=1
    1.11 -TARGET = libSDL_gl.a
    1.12 -else
    1.13 -TARGET = libSDL.a
    1.14 -endif
    1.15 -
    1.16 -CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude
    1.17 -
    1.18 -SRCS = \
    1.19 -	src/audio/dc/SDL_dcaudio.c \
    1.20 -	src/audio/dc/aica.c \
    1.21 -	src/audio/dummy/SDL_dummyaudio.c \
    1.22 -	src/audio/SDL_audio.c \
    1.23 -	src/audio/SDL_audiocvt.c \
    1.24 -	src/audio/SDL_audiodev.c \
    1.25 -	src/audio/SDL_mixer.c \
    1.26 -	src/audio/SDL_wave.c \
    1.27 -	src/cdrom/dc/SDL_syscdrom.c \
    1.28 -	src/cdrom/SDL_cdrom.c \
    1.29 -	src/events/SDL_active.c \
    1.30 -	src/events/SDL_events.c \
    1.31 -	src/events/SDL_expose.c \
    1.32 -	src/events/SDL_keyboard.c \
    1.33 -	src/events/SDL_mouse.c \
    1.34 -	src/events/SDL_quit.c \
    1.35 -	src/events/SDL_resize.c \
    1.36 -	src/file/SDL_rwops.c \
    1.37 -	src/power/SDL_power.c \
    1.38 -	src/joystick/dc/SDL_sysjoystick.c \
    1.39 -	src/joystick/SDL_joystick.c \
    1.40 -	src/loadso/dummy/SDL_sysloadso.c \
    1.41 -	src/SDL.c \
    1.42 -	src/SDL_error.c \
    1.43 -	src/SDL_fatal.c \
    1.44 -	src/stdlib/SDL_getenv.c \
    1.45 -	src/stdlib/SDL_iconv.c \
    1.46 -	src/stdlib/SDL_malloc.c \
    1.47 -	src/stdlib/SDL_qsort.c \
    1.48 -	src/stdlib/SDL_stdlib.c \
    1.49 -	src/stdlib/SDL_string.c \
    1.50 -	src/thread/dc/SDL_syscond.c \
    1.51 -	src/thread/dc/SDL_sysmutex.c \
    1.52 -	src/thread/dc/SDL_syssem.c \
    1.53 -	src/thread/dc/SDL_systhread.c \
    1.54 -	src/thread/SDL_thread.c \
    1.55 -	src/timer/dc/SDL_systimer.c \
    1.56 -	src/timer/SDL_timer.c \
    1.57 -	src/video/dc/SDL_dcevents.c \
    1.58 -	src/video/dc/SDL_dcvideo.c \
    1.59 -	src/video/dummy/SDL_nullevents.c \
    1.60 -	src/video/dummy/SDL_nullmouse.c \
    1.61 -	src/video/dummy/SDL_nullvideo.c \
    1.62 -	src/video/glsdl/SDL_glsdl.c \
    1.63 -	src/video/SDL_blit.c \
    1.64 -	src/video/SDL_blit_0.c \
    1.65 -	src/video/SDL_blit_1.c \
    1.66 -	src/video/SDL_blit_A.c \
    1.67 -	src/video/SDL_blit_N.c \
    1.68 -	src/video/SDL_bmp.c \
    1.69 -	src/video/SDL_cursor.c \
    1.70 -	src/video/SDL_gamma.c \
    1.71 -	src/video/SDL_pixels.c \
    1.72 -	src/video/SDL_RLEaccel.c \
    1.73 -	src/video/SDL_stretch.c \
    1.74 -	src/video/SDL_surface.c \
    1.75 -	src/video/SDL_video.c \
    1.76 -	src/video/SDL_yuv.c \
    1.77 -	src/video/SDL_yuv_sw.c \
    1.78 -
    1.79 -OBJS = $(SRCS:.c=.o)
    1.80 -
    1.81 -TEST = \
    1.82 -	test/checkkeys.c \
    1.83 -	test/graywin.c \
    1.84 -	test/loopwave.c \
    1.85 -	test/testalpha.c \
    1.86 -	test/testbitmap.c \
    1.87 -	test/testcdrom.c \
    1.88 -	test/testerror.c \
    1.89 -	test/testgamma.c \
    1.90 -	test/testgl.c \
    1.91 -	test/testhread.c \
    1.92 -	test/testjoystick.c \
    1.93 -	test/testkeys.c \
    1.94 -	test/testlock.c \
    1.95 -	test/testoverlay.c \
    1.96 -	test/testpalette.c \
    1.97 -	test/testsem.c \
    1.98 -	test/testsprite.c \
    1.99 -	test/testtimer.c \
   1.100 -	test/testtypes.c \
   1.101 -	test/testver.c \
   1.102 -	test/testvidinfo.c \
   1.103 -	test/testwin.c \
   1.104 -	test/testwm.c \
   1.105 -	test/threadwin.c \
   1.106 -	test/torturethread.c \
   1.107 -
   1.108 -$(TARGET): copy_config \
   1.109 -	$(OBJS)
   1.110 -	$(AR) rcs $(TARGET) $(OBJS) 
   1.111 -
   1.112 -copy_config:
   1.113 -	@cp include/SDL_config.h.default include/SDL_config.h
   1.114 -
   1.115 -clean:
   1.116 -	rm -f include/SDL_config.h $(OBJS)
     2.1 --- a/Makefile.in	Sat Sep 19 07:09:41 2009 +0000
     2.2 +++ b/Makefile.in	Sat Sep 19 07:21:22 2009 +0000
     2.3 @@ -45,7 +45,7 @@
     2.4  EMBEDSPU = @EMBEDSPU@
     2.5  #include $(srcdir)/src/video/ps3/spulibs/Makefile
     2.6  
     2.7 -DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html include INSTALL Makefile.dc Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode
     2.8 +DIST = acinclude.m4 autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS docs docs.html include INSTALL Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.qpg.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode
     2.9  
    2.10  HDRS = SDL.h SDL_atomic.h SDL_audio.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_haptic.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h
    2.11  
     3.1 --- a/README	Sat Sep 19 07:09:41 2009 +0000
     3.2 +++ b/README	Sat Sep 19 07:21:22 2009 +0000
     3.3 @@ -14,8 +14,8 @@
     3.4  
     3.5  The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
     3.6  Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
     3.7 -The code contains support for Dreamcast, Atari, AIX, OSF/Tru64,
     3.8 -RISC OS, SymbianOS, but these are not officially supported.
     3.9 +The code contains support for Atari, AIX, OSF/Tru64, RISC OS, and
    3.10 +SymbianOS, but these are not officially supported.
    3.11  
    3.12  SDL is written in C, but works with C++ natively, and has bindings to
    3.13  several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
     4.1 --- a/README.DC	Sat Sep 19 07:09:41 2009 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,32 +0,0 @@
     4.4 -SDL for Dreamcast (beta2)
     4.5 -
     4.6 -	BERO
     4.7 -	berobero@users.sourceforge.net 
     4.8 -
     4.9 -	http://www.geocities.co.jp/Playtown/2004/
    4.10 -
    4.11 -this work with kos-newlib
    4.12 -http://sourceforge.net/projects/dcquake/
    4.13 -
    4.14 -compile
    4.15 -- source environ.sh (from the KOS distribution)
    4.16 -- make -f Makefile.dc
    4.17 -
    4.18 -compile with gl support
    4.19 -- install latest libgl from http://sourceforge.net/projects/dcquake/
    4.20 -- uncomment GL=1 in Makefile.dc
    4.21 -- make -f Makefile.dc clean
    4.22 -- make -f Makefile.dc
    4.23 -
    4.24 -install
    4.25 -- copy include/*.h and libSDL.a or libSDL_gl.a for your enviroment
    4.26 -
    4.27 -changelog:
    4.28 -
    4.29 -beta2
    4.30 -- OpenGL support
    4.31 -- Hardware page flip support
    4.32 -
    4.33 -beta
    4.34 -- thread, timer don't tested so much.
    4.35 -- not support OpenGL
     5.1 --- a/VisualCE/SDLMain/SDLmain.vcp	Sat Sep 19 07:09:41 2009 +0000
     5.2 +++ b/VisualCE/SDLMain/SDLmain.vcp	Sat Sep 19 07:21:22 2009 +0000
     5.3 @@ -1518,10 +1518,8 @@
     5.4  	{$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
     5.5  	{$(INCLUDE)}"..\..\include\SDL_config.h"\
     5.6  	{$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\
     5.7 -	{$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\
     5.8  	{$(INCLUDE)}"..\..\include\SDL_config_macos.h"\
     5.9  	{$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\
    5.10 -	{$(INCLUDE)}"..\..\include\SDL_config_os2.h"\
    5.11  	{$(INCLUDE)}"..\..\include\SDL_config_win32.h"\
    5.12  	{$(INCLUDE)}"..\..\include\SDL_config_wince.h"\
    5.13  	{$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\
    5.14 @@ -1556,10 +1554,8 @@
    5.15  	{$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
    5.16  	{$(INCLUDE)}"..\..\include\SDL_config.h"\
    5.17  	{$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\
    5.18 -	{$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\
    5.19  	{$(INCLUDE)}"..\..\include\SDL_config_macos.h"\
    5.20  	{$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\
    5.21 -	{$(INCLUDE)}"..\..\include\SDL_config_os2.h"\
    5.22  	{$(INCLUDE)}"..\..\include\SDL_config_win32.h"\
    5.23  	{$(INCLUDE)}"..\..\include\SDL_config_wince.h"\
    5.24  	{$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\
     6.1 --- a/VisualCE/loopwave/loopwave.vcp	Sat Sep 19 07:09:41 2009 +0000
     6.2 +++ b/VisualCE/loopwave/loopwave.vcp	Sat Sep 19 07:21:22 2009 +0000
     6.3 @@ -359,10 +359,8 @@
     6.4  	"..\include\SDL_cdrom.h"\
     6.5  	"..\include\SDL_config.h"\
     6.6  	"..\include\SDL_config_amiga.h"\
     6.7 -	"..\include\SDL_config_dreamcast.h"\
     6.8  	"..\include\SDL_config_macos.h"\
     6.9  	"..\include\SDL_config_macosx.h"\
    6.10 -	"..\include\SDL_config_os2.h"\
    6.11  	"..\include\SDL_config_win32.h"\
    6.12  	"..\include\SDL_config_wince.h"\
    6.13  	"..\include\SDL_cpuinfo.h"\
    6.14 @@ -399,10 +397,8 @@
    6.15  	"..\include\SDL_cdrom.h"\
    6.16  	"..\include\SDL_config.h"\
    6.17  	"..\include\SDL_config_amiga.h"\
    6.18 -	"..\include\SDL_config_dreamcast.h"\
    6.19  	"..\include\SDL_config_macos.h"\
    6.20  	"..\include\SDL_config_macosx.h"\
    6.21 -	"..\include\SDL_config_os2.h"\
    6.22  	"..\include\SDL_config_win32.h"\
    6.23  	"..\include\SDL_config_wince.h"\
    6.24  	"..\include\SDL_cpuinfo.h"\
    6.25 @@ -439,10 +435,8 @@
    6.26  	"..\include\SDL_cdrom.h"\
    6.27  	"..\include\SDL_config.h"\
    6.28  	"..\include\SDL_config_amiga.h"\
    6.29 -	"..\include\SDL_config_dreamcast.h"\
    6.30  	"..\include\SDL_config_macos.h"\
    6.31  	"..\include\SDL_config_macosx.h"\
    6.32 -	"..\include\SDL_config_os2.h"\
    6.33  	"..\include\SDL_config_win32.h"\
    6.34  	"..\include\SDL_config_wince.h"\
    6.35  	"..\include\SDL_cpuinfo.h"\
    6.36 @@ -479,10 +473,8 @@
    6.37  	"..\include\SDL_cdrom.h"\
    6.38  	"..\include\SDL_config.h"\
    6.39  	"..\include\SDL_config_amiga.h"\
    6.40 -	"..\include\SDL_config_dreamcast.h"\
    6.41  	"..\include\SDL_config_macos.h"\
    6.42  	"..\include\SDL_config_macosx.h"\
    6.43 -	"..\include\SDL_config_os2.h"\
    6.44  	"..\include\SDL_config_win32.h"\
    6.45  	"..\include\SDL_config_wince.h"\
    6.46  	"..\include\SDL_cpuinfo.h"\
     7.1 --- a/VisualCE/testalpha/testalpha.vcp	Sat Sep 19 07:09:41 2009 +0000
     7.2 +++ b/VisualCE/testalpha/testalpha.vcp	Sat Sep 19 07:21:22 2009 +0000
     7.3 @@ -392,10 +392,8 @@
     7.4  	"..\..\include\SDL_cdrom.h"\
     7.5  	"..\..\include\SDL_config.h"\
     7.6  	"..\..\include\SDL_config_amiga.h"\
     7.7 -	"..\..\include\SDL_config_dreamcast.h"\
     7.8  	"..\..\include\SDL_config_macos.h"\
     7.9  	"..\..\include\SDL_config_macosx.h"\
    7.10 -	"..\..\include\SDL_config_os2.h"\
    7.11  	"..\..\include\SDL_config_win32.h"\
    7.12  	"..\..\include\SDL_cpuinfo.h"\
    7.13  	"..\..\include\SDL_endian.h"\
    7.14 @@ -430,10 +428,8 @@
    7.15  	"..\..\include\SDL_cdrom.h"\
    7.16  	"..\..\include\SDL_config.h"\
    7.17  	"..\..\include\SDL_config_amiga.h"\
    7.18 -	"..\..\include\SDL_config_dreamcast.h"\
    7.19  	"..\..\include\SDL_config_macos.h"\
    7.20  	"..\..\include\SDL_config_macosx.h"\
    7.21 -	"..\..\include\SDL_config_os2.h"\
    7.22  	"..\..\include\SDL_config_win32.h"\
    7.23  	"..\..\include\SDL_cpuinfo.h"\
    7.24  	"..\..\include\SDL_endian.h"\
    7.25 @@ -468,10 +464,8 @@
    7.26  	"..\..\include\SDL_cdrom.h"\
    7.27  	"..\..\include\SDL_config.h"\
    7.28  	"..\..\include\SDL_config_amiga.h"\
    7.29 -	"..\..\include\SDL_config_dreamcast.h"\
    7.30  	"..\..\include\SDL_config_macos.h"\
    7.31  	"..\..\include\SDL_config_macosx.h"\
    7.32 -	"..\..\include\SDL_config_os2.h"\
    7.33  	"..\..\include\SDL_config_win32.h"\
    7.34  	"..\..\include\SDL_cpuinfo.h"\
    7.35  	"..\..\include\SDL_endian.h"\
    7.36 @@ -506,10 +500,8 @@
    7.37  	"..\..\include\SDL_cdrom.h"\
    7.38  	"..\..\include\SDL_config.h"\
    7.39  	"..\..\include\SDL_config_amiga.h"\
    7.40 -	"..\..\include\SDL_config_dreamcast.h"\
    7.41  	"..\..\include\SDL_config_macos.h"\
    7.42  	"..\..\include\SDL_config_macosx.h"\
    7.43 -	"..\..\include\SDL_config_os2.h"\
    7.44  	"..\..\include\SDL_config_win32.h"\
    7.45  	"..\..\include\SDL_cpuinfo.h"\
    7.46  	"..\..\include\SDL_endian.h"\
    7.47 @@ -546,10 +538,8 @@
    7.48  	"..\include\SDL_cdrom.h"\
    7.49  	"..\include\SDL_config.h"\
    7.50  	"..\include\SDL_config_amiga.h"\
    7.51 -	"..\include\SDL_config_dreamcast.h"\
    7.52  	"..\include\SDL_config_macos.h"\
    7.53  	"..\include\SDL_config_macosx.h"\
    7.54 -	"..\include\SDL_config_os2.h"\
    7.55  	"..\include\SDL_config_win32.h"\
    7.56  	"..\include\SDL_config_wince.h"\
    7.57  	"..\include\SDL_cpuinfo.h"\
    7.58 @@ -586,10 +576,8 @@
    7.59  	"..\include\SDL_cdrom.h"\
    7.60  	"..\include\SDL_config.h"\
    7.61  	"..\include\SDL_config_amiga.h"\
    7.62 -	"..\include\SDL_config_dreamcast.h"\
    7.63  	"..\include\SDL_config_macos.h"\
    7.64  	"..\include\SDL_config_macosx.h"\
    7.65 -	"..\include\SDL_config_os2.h"\
    7.66  	"..\include\SDL_config_win32.h"\
    7.67  	"..\include\SDL_config_wince.h"\
    7.68  	"..\include\SDL_cpuinfo.h"\
     8.1 --- a/VisualCE/testtimer/testtimer.vcp	Sat Sep 19 07:09:41 2009 +0000
     8.2 +++ b/VisualCE/testtimer/testtimer.vcp	Sat Sep 19 07:21:22 2009 +0000
     8.3 @@ -531,10 +531,8 @@
     8.4  	"..\include\SDL_cdrom.h"\
     8.5  	"..\include\SDL_config.h"\
     8.6  	"..\include\SDL_config_amiga.h"\
     8.7 -	"..\include\SDL_config_dreamcast.h"\
     8.8  	"..\include\SDL_config_macos.h"\
     8.9  	"..\include\SDL_config_macosx.h"\
    8.10 -	"..\include\SDL_config_os2.h"\
    8.11  	"..\include\SDL_config_win32.h"\
    8.12  	"..\include\SDL_cpuinfo.h"\
    8.13  	"..\include\SDL_endian.h"\
    8.14 @@ -570,10 +568,8 @@
    8.15  	"..\include\SDL_cdrom.h"\
    8.16  	"..\include\SDL_config.h"\
    8.17  	"..\include\SDL_config_amiga.h"\
    8.18 -	"..\include\SDL_config_dreamcast.h"\
    8.19  	"..\include\SDL_config_macos.h"\
    8.20  	"..\include\SDL_config_macosx.h"\
    8.21 -	"..\include\SDL_config_os2.h"\
    8.22  	"..\include\SDL_config_win32.h"\
    8.23  	"..\include\SDL_cpuinfo.h"\
    8.24  	"..\include\SDL_endian.h"\
    8.25 @@ -607,10 +603,8 @@
    8.26  	"..\..\include\SDL_cdrom.h"\
    8.27  	"..\..\include\SDL_config.h"\
    8.28  	"..\..\include\SDL_config_amiga.h"\
    8.29 -	"..\..\include\SDL_config_dreamcast.h"\
    8.30  	"..\..\include\SDL_config_macos.h"\
    8.31  	"..\..\include\SDL_config_macosx.h"\
    8.32 -	"..\..\include\SDL_config_os2.h"\
    8.33  	"..\..\include\SDL_config_win32.h"\
    8.34  	"..\..\include\SDL_cpuinfo.h"\
    8.35  	"..\..\include\SDL_endian.h"\
    8.36 @@ -644,10 +638,8 @@
    8.37  	"..\..\include\SDL_cdrom.h"\
    8.38  	"..\..\include\SDL_config.h"\
    8.39  	"..\..\include\SDL_config_amiga.h"\
    8.40 -	"..\..\include\SDL_config_dreamcast.h"\
    8.41  	"..\..\include\SDL_config_macos.h"\
    8.42  	"..\..\include\SDL_config_macosx.h"\
    8.43 -	"..\..\include\SDL_config_os2.h"\
    8.44  	"..\..\include\SDL_config_win32.h"\
    8.45  	"..\..\include\SDL_cpuinfo.h"\
    8.46  	"..\..\include\SDL_endian.h"\
    8.47 @@ -683,10 +675,8 @@
    8.48  	"..\include\SDL_cdrom.h"\
    8.49  	"..\include\SDL_config.h"\
    8.50  	"..\include\SDL_config_amiga.h"\
    8.51 -	"..\include\SDL_config_dreamcast.h"\
    8.52  	"..\include\SDL_config_macos.h"\
    8.53  	"..\include\SDL_config_macosx.h"\
    8.54 -	"..\include\SDL_config_os2.h"\
    8.55  	"..\include\SDL_config_win32.h"\
    8.56  	"..\include\SDL_cpuinfo.h"\
    8.57  	"..\include\SDL_endian.h"\
    8.58 @@ -722,10 +712,8 @@
    8.59  	"..\include\SDL_cdrom.h"\
    8.60  	"..\include\SDL_config.h"\
    8.61  	"..\include\SDL_config_amiga.h"\
    8.62 -	"..\include\SDL_config_dreamcast.h"\
    8.63  	"..\include\SDL_config_macos.h"\
    8.64  	"..\include\SDL_config_macosx.h"\
    8.65 -	"..\include\SDL_config_os2.h"\
    8.66  	"..\include\SDL_config_win32.h"\
    8.67  	"..\include\SDL_cpuinfo.h"\
    8.68  	"..\include\SDL_endian.h"\
    8.69 @@ -771,10 +759,8 @@
    8.70  	"..\..\include\SDL_cdrom.h"\
    8.71  	"..\..\include\SDL_config.h"\
    8.72  	"..\..\include\SDL_config_amiga.h"\
    8.73 -	"..\..\include\SDL_config_dreamcast.h"\
    8.74  	"..\..\include\SDL_config_macos.h"\
    8.75  	"..\..\include\SDL_config_macosx.h"\
    8.76 -	"..\..\include\SDL_config_os2.h"\
    8.77  	"..\..\include\SDL_config_win32.h"\
    8.78  	"..\..\include\SDL_cpuinfo.h"\
    8.79  	"..\..\include\SDL_endian.h"\
    8.80 @@ -808,10 +794,8 @@
    8.81  	"..\..\include\SDL_cdrom.h"\
    8.82  	"..\..\include\SDL_config.h"\
    8.83  	"..\..\include\SDL_config_amiga.h"\
    8.84 -	"..\..\include\SDL_config_dreamcast.h"\
    8.85  	"..\..\include\SDL_config_macos.h"\
    8.86  	"..\..\include\SDL_config_macosx.h"\
    8.87 -	"..\..\include\SDL_config_os2.h"\
    8.88  	"..\..\include\SDL_config_win32.h"\
    8.89  	"..\..\include\SDL_cpuinfo.h"\
    8.90  	"..\..\include\SDL_endian.h"\
     9.1 --- a/VisualCE/testwin/testwin.vcp	Sat Sep 19 07:09:41 2009 +0000
     9.2 +++ b/VisualCE/testwin/testwin.vcp	Sat Sep 19 07:21:22 2009 +0000
     9.3 @@ -394,10 +394,8 @@
     9.4  	"..\..\include\SDL_cdrom.h"\
     9.5  	"..\..\include\SDL_config.h"\
     9.6  	"..\..\include\SDL_config_amiga.h"\
     9.7 -	"..\..\include\SDL_config_dreamcast.h"\
     9.8  	"..\..\include\SDL_config_macos.h"\
     9.9  	"..\..\include\SDL_config_macosx.h"\
    9.10 -	"..\..\include\SDL_config_os2.h"\
    9.11  	"..\..\include\SDL_config_win32.h"\
    9.12  	"..\..\include\SDL_cpuinfo.h"\
    9.13  	"..\..\include\SDL_endian.h"\
    9.14 @@ -431,10 +429,8 @@
    9.15  	"..\..\include\SDL_cdrom.h"\
    9.16  	"..\..\include\SDL_config.h"\
    9.17  	"..\..\include\SDL_config_amiga.h"\
    9.18 -	"..\..\include\SDL_config_dreamcast.h"\
    9.19  	"..\..\include\SDL_config_macos.h"\
    9.20  	"..\..\include\SDL_config_macosx.h"\
    9.21 -	"..\..\include\SDL_config_os2.h"\
    9.22  	"..\..\include\SDL_config_win32.h"\
    9.23  	"..\..\include\SDL_cpuinfo.h"\
    9.24  	"..\..\include\SDL_endian.h"\
    9.25 @@ -468,10 +464,8 @@
    9.26  	"..\..\include\SDL_cdrom.h"\
    9.27  	"..\..\include\SDL_config.h"\
    9.28  	"..\..\include\SDL_config_amiga.h"\
    9.29 -	"..\..\include\SDL_config_dreamcast.h"\
    9.30  	"..\..\include\SDL_config_macos.h"\
    9.31  	"..\..\include\SDL_config_macosx.h"\
    9.32 -	"..\..\include\SDL_config_os2.h"\
    9.33  	"..\..\include\SDL_config_win32.h"\
    9.34  	"..\..\include\SDL_cpuinfo.h"\
    9.35  	"..\..\include\SDL_endian.h"\
    9.36 @@ -505,10 +499,8 @@
    9.37  	"..\..\include\SDL_cdrom.h"\
    9.38  	"..\..\include\SDL_config.h"\
    9.39  	"..\..\include\SDL_config_amiga.h"\
    9.40 -	"..\..\include\SDL_config_dreamcast.h"\
    9.41  	"..\..\include\SDL_config_macos.h"\
    9.42  	"..\..\include\SDL_config_macosx.h"\
    9.43 -	"..\..\include\SDL_config_os2.h"\
    9.44  	"..\..\include\SDL_config_win32.h"\
    9.45  	"..\..\include\SDL_cpuinfo.h"\
    9.46  	"..\..\include\SDL_endian.h"\
    9.47 @@ -544,10 +536,8 @@
    9.48  	"..\include\SDL_cdrom.h"\
    9.49  	"..\include\SDL_config.h"\
    9.50  	"..\include\SDL_config_amiga.h"\
    9.51 -	"..\include\SDL_config_dreamcast.h"\
    9.52  	"..\include\SDL_config_macos.h"\
    9.53  	"..\include\SDL_config_macosx.h"\
    9.54 -	"..\include\SDL_config_os2.h"\
    9.55  	"..\include\SDL_config_win32.h"\
    9.56  	"..\include\SDL_config_wince.h"\
    9.57  	"..\include\SDL_cpuinfo.h"\
    9.58 @@ -584,10 +574,8 @@
    9.59  	"..\include\SDL_cdrom.h"\
    9.60  	"..\include\SDL_config.h"\
    9.61  	"..\include\SDL_config_amiga.h"\
    9.62 -	"..\include\SDL_config_dreamcast.h"\
    9.63  	"..\include\SDL_config_macos.h"\
    9.64  	"..\include\SDL_config_macosx.h"\
    9.65 -	"..\include\SDL_config_os2.h"\
    9.66  	"..\include\SDL_config_win32.h"\
    9.67  	"..\include\SDL_config_wince.h"\
    9.68  	"..\include\SDL_cpuinfo.h"\
    10.1 --- a/Xcode/SDL/pkg-support/resources/ReadMe.txt	Sat Sep 19 07:09:41 2009 +0000
    10.2 +++ b/Xcode/SDL/pkg-support/resources/ReadMe.txt	Sat Sep 19 07:21:22 2009 +0000
    10.3 @@ -84,8 +84,8 @@
    10.4  	there are new public headers. But also as a result of these changes, there are 
    10.5  	also new headers that qualify as "PrivateHeaders". Private Headers are headers 
    10.6  	that must be exported because a public header includes them, but users shouldn't 
    10.7 -	directly invoke these. SDL_config_macosx.h and SDL_config_dreamcast.h are 
    10.8 -	examples of this. We have considered marking these headers as Private, but it 
    10.9 +	directly invoke these. SDL_config_macosx.h is an example of this.
   10.10 +	We have considered marking these headers as Private, but it 
   10.11  	requires that the public headers invoke them via framework conventions, i.e.
   10.12  	#include <FrameworkName/Header.h>
   10.13  	e.g.
    11.1 --- a/include/SDL.h	Sat Sep 19 07:09:41 2009 +0000
    11.2 +++ b/include/SDL.h	Sat Sep 19 07:21:22 2009 +0000
    11.3 @@ -38,8 +38,8 @@
    11.4  
    11.5  The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
    11.6  Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
    11.7 -The code contains support for Dreamcast, Atari, AIX, OSF/Tru64,
    11.8 -RISC OS, SymbianOS, but these are not officially supported.
    11.9 +The code contains support for Atari, AIX, OSF/Tru64, RISC OS, and
   11.10 +SymbianOS, but these are not officially supported.
   11.11  
   11.12  SDL is written in C, but works with C++ natively, and has bindings to
   11.13  several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
    12.1 --- a/include/SDL_config.h.default	Sat Sep 19 07:09:41 2009 +0000
    12.2 +++ b/include/SDL_config.h.default	Sat Sep 19 07:21:22 2009 +0000
    12.3 @@ -28,8 +28,6 @@
    12.4  /* Add any platform that doesn't build using the configure system */
    12.5  #if defined(__NINTENDODS__)
    12.6  #include "SDL_config_nintendods.h"
    12.7 -#elif defined(__DREAMCAST__)
    12.8 -#include "SDL_config_dreamcast.h"
    12.9  #elif defined(__IPHONEOS__) 
   12.10  #include "SDL_config_iphoneos.h"
   12.11  #elif defined(__MACOSX__)
    13.1 --- a/include/SDL_config.h.in	Sat Sep 19 07:09:41 2009 +0000
    13.2 +++ b/include/SDL_config.h.in	Sat Sep 19 07:21:22 2009 +0000
    13.3 @@ -182,7 +182,6 @@
    13.4  #undef SDL_AUDIO_DRIVER_BSD
    13.5  #undef SDL_AUDIO_DRIVER_COREAUDIO
    13.6  #undef SDL_AUDIO_DRIVER_DART
    13.7 -#undef SDL_AUDIO_DRIVER_DC
    13.8  #undef SDL_AUDIO_DRIVER_DISK
    13.9  #undef SDL_AUDIO_DRIVER_DUMMY
   13.10  #undef SDL_AUDIO_DRIVER_DMEDIA
   13.11 @@ -207,7 +206,6 @@
   13.12  #undef SDL_INPUT_LINUXEV
   13.13  #undef SDL_INPUT_TSLIB
   13.14  #undef SDL_JOYSTICK_BEOS
   13.15 -#undef SDL_JOYSTICK_DC
   13.16  #undef SDL_JOYSTICK_DINPUT
   13.17  #undef SDL_JOYSTICK_DUMMY
   13.18  #undef SDL_JOYSTICK_IOKIT
   13.19 @@ -233,7 +231,6 @@
   13.20  
   13.21  /* Enable various threading systems */
   13.22  #undef SDL_THREAD_BEOS
   13.23 -#undef SDL_THREAD_DC
   13.24  #undef SDL_THREAD_NDS
   13.25  #undef SDL_THREAD_PTH
   13.26  #undef SDL_THREAD_PTHREAD
   13.27 @@ -244,7 +241,6 @@
   13.28  
   13.29  /* Enable various timer systems */
   13.30  #undef SDL_TIMER_BEOS
   13.31 -#undef SDL_TIMER_DC
   13.32  #undef SDL_TIMER_DUMMY
   13.33  #undef SDL_TIMER_MINT
   13.34  #undef SDL_TIMER_NDS
   13.35 @@ -256,7 +252,6 @@
   13.36  /* Enable various video drivers */
   13.37  #undef SDL_VIDEO_DRIVER_BWINDOW
   13.38  #undef SDL_VIDEO_DRIVER_COCOA
   13.39 -#undef SDL_VIDEO_DRIVER_DC
   13.40  #undef SDL_VIDEO_DRIVER_DIRECTFB
   13.41  #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
   13.42  #undef SDL_VIDEO_DRIVER_DUMMY
    14.1 --- a/include/SDL_config_dreamcast.h	Sat Sep 19 07:09:41 2009 +0000
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,110 +0,0 @@
    14.4 -/*
    14.5 -    SDL - Simple DirectMedia Layer
    14.6 -    Copyright (C) 1997-2009 Sam Lantinga
    14.7 -
    14.8 -    This library is free software; you can redistribute it and/or
    14.9 -    modify it under the terms of the GNU Lesser General Public
   14.10 -    License as published by the Free Software Foundation; either
   14.11 -    version 2.1 of the License, or (at your option) any later version.
   14.12 -
   14.13 -    This library is distributed in the hope that it will be useful,
   14.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   14.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   14.16 -    Lesser General Public License for more details.
   14.17 -
   14.18 -    You should have received a copy of the GNU Lesser General Public
   14.19 -    License along with this library; if not, write to the Free Software
   14.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   14.21 -
   14.22 -    Sam Lantinga
   14.23 -    slouken@libsdl.org
   14.24 -*/
   14.25 -
   14.26 -#ifndef _SDL_config_dreamcast_h
   14.27 -#define _SDL_config_dreamcast_h
   14.28 -
   14.29 -#include "SDL_platform.h"
   14.30 -
   14.31 -/* This is a set of defines to configure the SDL features */
   14.32 -
   14.33 -#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
   14.34 -typedef signed char int8_t;
   14.35 -typedef unsigned char uint8_t;
   14.36 -typedef signed short int16_t;
   14.37 -typedef unsigned short uint16_t;
   14.38 -typedef signed int int32_t;
   14.39 -typedef unsigned int uint32_t;
   14.40 -typedef signed long long int64_t;
   14.41 -typedef unsigned long long uint64_t;
   14.42 -typedef unsigned long uintptr_t;
   14.43 -#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
   14.44 -
   14.45 -#define SIZEOF_VOIDP 4
   14.46 -#define SDL_HAS_64BIT_TYPE	1
   14.47 -
   14.48 -/* Useful headers */
   14.49 -#define HAVE_SYS_TYPES_H	1
   14.50 -#define HAVE_STDIO_H	1
   14.51 -#define STDC_HEADERS	1
   14.52 -#define HAVE_STRING_H	1
   14.53 -#define HAVE_CTYPE_H	1
   14.54 -
   14.55 -/* C library functions */
   14.56 -#define HAVE_MALLOC	1
   14.57 -#define HAVE_CALLOC	1
   14.58 -#define HAVE_REALLOC	1
   14.59 -#define HAVE_FREE	1
   14.60 -#define HAVE_ALLOCA	1
   14.61 -#define HAVE_GETENV	1
   14.62 -#define HAVE_PUTENV	1
   14.63 -#define HAVE_QSORT	1
   14.64 -#define HAVE_ABS	1
   14.65 -#define HAVE_BCOPY	1
   14.66 -#define HAVE_MEMSET	1
   14.67 -#define HAVE_MEMCPY	1
   14.68 -#define HAVE_MEMMOVE	1
   14.69 -#define HAVE_MEMCMP	1
   14.70 -#define HAVE_STRLEN	1
   14.71 -#define HAVE_STRDUP	1
   14.72 -#define HAVE_INDEX	1
   14.73 -#define HAVE_RINDEX	1
   14.74 -#define HAVE_STRCHR	1
   14.75 -#define HAVE_STRRCHR	1
   14.76 -#define HAVE_STRSTR	1
   14.77 -#define HAVE_STRTOL	1
   14.78 -#define HAVE_STRTOD	1
   14.79 -#define HAVE_ATOI	1
   14.80 -#define HAVE_ATOF	1
   14.81 -#define HAVE_STRCMP	1
   14.82 -#define HAVE_STRNCMP	1
   14.83 -#define HAVE_STRICMP	1
   14.84 -#define HAVE_STRCASECMP	1
   14.85 -#define HAVE_SSCANF	1
   14.86 -#define HAVE_SNPRINTF	1
   14.87 -#define HAVE_VSNPRINTF	1
   14.88 -
   14.89 -/* Enable various audio drivers */
   14.90 -#define SDL_AUDIO_DRIVER_DC	1
   14.91 -#define SDL_AUDIO_DRIVER_DISK	1
   14.92 -#define SDL_AUDIO_DRIVER_DUMMY	1
   14.93 -
   14.94 -/* Enable various input drivers */
   14.95 -#define SDL_JOYSTICK_DC	1
   14.96 -#define SDL_HAPTIC_DUMMY	1
   14.97 -
   14.98 -/* Enable various shared object loading systems */
   14.99 -#define SDL_LOADSO_DUMMY	1
  14.100 -
  14.101 -/* Enable various threading systems */
  14.102 -#define SDL_THREAD_DC	1
  14.103 -
  14.104 -/* Enable various timer systems */
  14.105 -#define SDL_TIMER_DC	1
  14.106 -
  14.107 -/* Enable various video drivers */
  14.108 -#define SDL_VIDEO_DRIVER_DC	1
  14.109 -#define SDL_VIDEO_DRIVER_DUMMY	1
  14.110 -
  14.111 -#define SDL_POWER_HARDWIRED 1
  14.112 -
  14.113 -#endif /* _SDL_config_dreamcast_h */
    15.1 --- a/src/audio/SDL_audio.c	Sat Sep 19 07:09:41 2009 +0000
    15.2 +++ b/src/audio/SDL_audio.c	Sat Sep 19 07:21:22 2009 +0000
    15.3 @@ -140,9 +140,6 @@
    15.4  #if SDL_AUDIO_DRIVER_DUMMY
    15.5      &DUMMYAUD_bootstrap,
    15.6  #endif
    15.7 -#if SDL_AUDIO_DRIVER_DC
    15.8 -    &DCAUD_bootstrap,
    15.9 -#endif
   15.10  #if SDL_AUDIO_DRIVER_MMEAUDIO
   15.11      &MMEAUDIO_bootstrap,
   15.12  #endif
    16.1 --- a/src/audio/dc/SDL_dcaudio.c	Sat Sep 19 07:09:41 2009 +0000
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,245 +0,0 @@
    16.4 -/*
    16.5 -    SDL - Simple DirectMedia Layer
    16.6 -    Copyright (C) 1997-2009 Sam Lantinga
    16.7 -
    16.8 -    This library is free software; you can redistribute it and/or
    16.9 -    modify it under the terms of the GNU Lesser General Public
   16.10 -    License as published by the Free Software Foundation; either
   16.11 -    version 2.1 of the License, or (at your option) any later version.
   16.12 -
   16.13 -    This library is distributed in the hope that it will be useful,
   16.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16.16 -    Lesser General Public License for more details.
   16.17 -
   16.18 -    You should have received a copy of the GNU Lesser General Public
   16.19 -    License along with this library; if not, write to the Free Software
   16.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   16.21 -
   16.22 -    Sam Lantinga
   16.23 -    slouken@libsdl.org
   16.24 -
   16.25 -*/
   16.26 -#include "SDL_config.h"
   16.27 -
   16.28 -/* Output dreamcast aica */
   16.29 -
   16.30 -#include "SDL_timer.h"
   16.31 -#include "SDL_audio.h"
   16.32 -#include "../SDL_audiomem.h"
   16.33 -#include "../SDL_audio_c.h"
   16.34 -#include "SDL_dcaudio.h"
   16.35 -
   16.36 -#include "aica.h"
   16.37 -#include <dc/spu.h>
   16.38 -
   16.39 -#define	SPU_RAM_BASE	0xa0800000
   16.40 -
   16.41 -static void
   16.42 -spu_memload_stereo8(int leftpos, int rightpos, void *src0, size_t size)
   16.43 -{
   16.44 -    uint8 *src = src0;
   16.45 -    uint32 *left = (uint32 *) (leftpos + SPU_RAM_BASE);
   16.46 -    uint32 *right = (uint32 *) (rightpos + SPU_RAM_BASE);
   16.47 -    size = (size + 7) / 8;
   16.48 -    while (size--) {
   16.49 -        unsigned lval, rval;
   16.50 -        lval = *src++;
   16.51 -        rval = *src++;
   16.52 -        lval |= (*src++) << 8;
   16.53 -        rval |= (*src++) << 8;
   16.54 -        lval |= (*src++) << 16;
   16.55 -        rval |= (*src++) << 16;
   16.56 -        lval |= (*src++) << 24;
   16.57 -        rval |= (*src++) << 24;
   16.58 -        g2_write_32(left++, lval);
   16.59 -        g2_write_32(right++, rval);
   16.60 -        g2_fifo_wait();
   16.61 -    }
   16.62 -}
   16.63 -
   16.64 -static void
   16.65 -spu_memload_stereo16(int leftpos, int rightpos, void *src0, size_t size)
   16.66 -{
   16.67 -    uint16 *src = src0;
   16.68 -    uint32 *left = (uint32 *) (leftpos + SPU_RAM_BASE);
   16.69 -    uint32 *right = (uint32 *) (rightpos + SPU_RAM_BASE);
   16.70 -    size = (size + 7) / 8;
   16.71 -    while (size--) {
   16.72 -        unsigned lval, rval;
   16.73 -        lval = *src++;
   16.74 -        rval = *src++;
   16.75 -        lval |= (*src++) << 16;
   16.76 -        rval |= (*src++) << 16;
   16.77 -        g2_write_32(left++, lval);
   16.78 -        g2_write_32(right++, rval);
   16.79 -        g2_fifo_wait();
   16.80 -    }
   16.81 -}
   16.82 -
   16.83 -static void
   16.84 -DCAUD_PlayDevice(_THIS)
   16.85 -{
   16.86 -    SDL_AudioSpec *spec = &this->spec;
   16.87 -    unsigned int offset;
   16.88 -
   16.89 -    if (this->hidden->playing) {
   16.90 -        /* wait */
   16.91 -        while (aica_get_pos(0) / spec->samples == this->hidden->nextbuf) {
   16.92 -            thd_pass();
   16.93 -        }
   16.94 -    }
   16.95 -
   16.96 -    offset = this->hidden->nextbuf * spec->size;
   16.97 -    this->hidden->nextbuf ^= 1;
   16.98 -    /* Write the audio data, checking for EAGAIN on broken audio drivers */
   16.99 -    if (spec->channels == 1) {
  16.100 -        spu_memload(this->hidden->leftpos + offset, this->hidden->mixbuf,
  16.101 -                    this->hidden->mixlen);
  16.102 -    } else {
  16.103 -        offset /= 2;
  16.104 -        if ((this->spec.format & 255) == 8) {
  16.105 -            spu_memload_stereo8(this->hidden->leftpos + offset,
  16.106 -                                this->hidden->rightpos + offset,
  16.107 -                                this->hidden->mixbuf, this->hidden->mixlen);
  16.108 -        } else {
  16.109 -            spu_memload_stereo16(this->hidden->leftpos + offset,
  16.110 -                                 this->hidden->rightpos + offset,
  16.111 -                                 this->hidden->mixbuf, this->hidden->mixlen);
  16.112 -        }
  16.113 -    }
  16.114 -
  16.115 -    if (!this->hidden->playing) {
  16.116 -        int mode;
  16.117 -        this->hidden->playing = 1;
  16.118 -        mode = (spec->format == AUDIO_S8) ? SM_8BIT : SM_16BIT;
  16.119 -        if (spec->channels == 1) {
  16.120 -            aica_play(0, mode, this->hidden->leftpos, 0,
  16.121 -                      spec->samples * 2, spec->freq, 255, 128, 1);
  16.122 -        } else {
  16.123 -            aica_play(0, mode, this->hidden->leftpos, 0,
  16.124 -                      spec->samples * 2, spec->freq, 255, 0, 1);
  16.125 -            aica_play(1, mode, this->hidden->rightpos, 0,
  16.126 -                      spec->samples * 2, spec->freq, 255, 255, 1);
  16.127 -        }
  16.128 -    }
  16.129 -}
  16.130 -
  16.131 -static Uint8 *
  16.132 -DCAUD_GetDeviceBuf(_THIS)
  16.133 -{
  16.134 -    return (this->hidden->mixbuf);
  16.135 -}
  16.136 -
  16.137 -/* This function waits until it is possible to write a full sound buffer */
  16.138 -static void
  16.139 -DCAUD_WaitDevice(_THIS)
  16.140 -{
  16.141 -    if (this->hidden->playing) {
  16.142 -        /* wait */
  16.143 -        while (aica_get_pos(0) / this->spec.samples == this->hidden->nextbuf) {
  16.144 -            thd_pass();
  16.145 -        }
  16.146 -    }
  16.147 -}
  16.148 -
  16.149 -static void
  16.150 -DCAUD_CloseDevice(_THIS)
  16.151 -{
  16.152 -    if (this->hidden != NULL) {
  16.153 -        aica_stop(0);
  16.154 -        if (this->spec.channels == 2) {
  16.155 -            aica_stop(1);
  16.156 -        }
  16.157 -        if (this->hidden->mixbuf != NULL) {
  16.158 -            SDL_FreeAudioMem(this->hidden->mixbuf);
  16.159 -            this->hidden->mixbuf = NULL;
  16.160 -        }
  16.161 -        SDL_free(this->hidden);
  16.162 -        this->hidden = NULL;
  16.163 -
  16.164 -        /* !!! FIXME: is there a reverse of spu_init()? */
  16.165 -    }
  16.166 -}
  16.167 -
  16.168 -static int
  16.169 -DCAUD_OpenDevice(_THIS, SDL_AudioSpec * spec)
  16.170 -{
  16.171 -    SDL_AudioFormat test_format = SDL_FirstAudioFormat(spec->format);
  16.172 -    int valid_datatype = 0;
  16.173 -
  16.174 -    /* Initialize all variables that we clean on shutdown */
  16.175 -    this->hidden = (struct SDL_PrivateAudioData *)
  16.176 -        SDL_malloc((sizeof *this->hidden));
  16.177 -    if (this->hidden == NULL) {
  16.178 -        SDL_OutOfMemory();
  16.179 -        return 0;
  16.180 -    }
  16.181 -    SDL_memset(this->hidden, 0, (sizeof *this->hidden));
  16.182 -
  16.183 -    spu_init();
  16.184 -
  16.185 -    while ((!valid_datatype) && (test_format)) {
  16.186 -        spec->format = test_format;
  16.187 -        switch (test_format) {
  16.188 -            /* only formats Dreamcast accepts... */
  16.189 -        case AUDIO_S8:
  16.190 -        case AUDIO_S16LSB:
  16.191 -            valid_datatype = 1;
  16.192 -            break;
  16.193 -
  16.194 -        default:
  16.195 -            test_format = SDL_NextAudioFormat();
  16.196 -            break;
  16.197 -        }
  16.198 -    }
  16.199 -
  16.200 -    if (!valid_datatype) {      /* shouldn't happen, but just in case... */
  16.201 -        DCAUD_CloseDevice(this);
  16.202 -        SDL_SetError("Unsupported audio format");
  16.203 -        return 0;
  16.204 -    }
  16.205 -
  16.206 -    if (spec->channels > 2)
  16.207 -        spec->channels = 2;     /* no more than stereo on the Dreamcast. */
  16.208 -
  16.209 -    /* Update the fragment size as size in bytes */
  16.210 -    SDL_CalculateAudioSpec(spec);
  16.211 -
  16.212 -    /* Allocate mixing buffer */
  16.213 -    this->hidden->mixlen = spec->size;
  16.214 -    this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
  16.215 -    if (this->hidden->mixbuf == NULL) {
  16.216 -        DCAUD_CloseDevice(this);
  16.217 -        SDL_OutOfMemory();
  16.218 -        return 0;
  16.219 -    }
  16.220 -    SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
  16.221 -    this->hidden->leftpos = 0x11000;
  16.222 -    this->hidden->rightpos = 0x11000 + spec->size;
  16.223 -    this->hidden->playing = 0;
  16.224 -    this->hidden->nextbuf = 0;
  16.225 -
  16.226 -    /* We're ready to rock and roll. :-) */
  16.227 -    return 1;
  16.228 -}
  16.229 -
  16.230 -static int
  16.231 -DCAUD_Init(SDL_AudioDriverImpl * impl)
  16.232 -{
  16.233 -    /* Set the function pointers */
  16.234 -    impl->OpenDevice = DCAUD_OpenDevice;
  16.235 -    impl->PlayDevice = DCAUD_PlayDevice;
  16.236 -    impl->WaitDevice = DCAUD_WaitDevice;
  16.237 -    impl->GetDeviceBuf = DCAUD_GetDeviceBuf;
  16.238 -    impl->CloseDevice = DCAUD_CloseDevice;
  16.239 -    impl->OnlyHasDefaultOutputDevice = 1;
  16.240 -
  16.241 -    return 1;
  16.242 -}
  16.243 -
  16.244 -AudioBootStrap DCAUD_bootstrap = {
  16.245 -    "dcaudio", "Dreamcast AICA audio", DCAUD_Init, 0
  16.246 -};
  16.247 -
  16.248 -/* vi: set ts=4 sw=4 expandtab: */
    17.1 --- a/src/audio/dc/SDL_dcaudio.h	Sat Sep 19 07:09:41 2009 +0000
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,43 +0,0 @@
    17.4 -/*
    17.5 -    SDL - Simple DirectMedia Layer
    17.6 -    Copyright (C) 1997-2009 Sam Lantinga
    17.7 -
    17.8 -    This library is free software; you can redistribute it and/or
    17.9 -    modify it under the terms of the GNU Lesser General Public
   17.10 -    License as published by the Free Software Foundation; either
   17.11 -    version 2.1 of the License, or (at your option) any later version.
   17.12 -
   17.13 -    This library is distributed in the hope that it will be useful,
   17.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   17.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   17.16 -    Lesser General Public License for more details.
   17.17 -
   17.18 -    You should have received a copy of the GNU Lesser General Public
   17.19 -    License along with this library; if not, write to the Free Software
   17.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   17.21 -
   17.22 -    Sam Lantinga
   17.23 -    slouken@libsdl.org
   17.24 -*/
   17.25 -#include "SDL_config.h"
   17.26 -
   17.27 -#ifndef _SDL_dcaudio_h
   17.28 -#define _SDL_dcaudio_h
   17.29 -
   17.30 -#include "../SDL_sysaudio.h"
   17.31 -
   17.32 -/* Hidden "this" pointer for the audio functions */
   17.33 -#define _THIS	SDL_AudioDevice *this
   17.34 -
   17.35 -struct SDL_PrivateAudioData
   17.36 -{
   17.37 -    /* The file descriptor for the audio device */
   17.38 -    Uint8 *mixbuf;
   17.39 -    Uint32 mixlen;
   17.40 -    int playing;
   17.41 -    int leftpos, rightpos;
   17.42 -    int nextbuf;
   17.43 -};
   17.44 -
   17.45 -#endif /* _SDL_dcaudio_h */
   17.46 -/* vi: set ts=4 sw=4 expandtab: */
    18.1 --- a/src/audio/dc/aica.c	Sat Sep 19 07:09:41 2009 +0000
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,301 +0,0 @@
    18.4 -/* This file is part of the Dreamcast function library.
    18.5 - * Please see libdream.c for further details.
    18.6 - *
    18.7 - * (c)2000 Dan Potter
    18.8 - * modify BERO
    18.9 - */
   18.10 -#include "aica.h"
   18.11 -
   18.12 -#include <arch/irq.h>
   18.13 -#include <dc/spu.h>
   18.14 -
   18.15 -#if 0
   18.16 -#define dc_snd_base ((volatile unsigned char *)0x00800000)      /* arm side */
   18.17 -#endif
   18.18 -#define dc_snd_base ((volatile unsigned char *)0xa0700000)      /* dc side */
   18.19 -
   18.20 -/* Some convienence macros */
   18.21 -#define	SNDREGADDR(x)	(0xa0700000 + (x))
   18.22 -#define	CHNREGADDR(ch,x)	SNDREGADDR(0x80*(ch)+(x))
   18.23 -
   18.24 -
   18.25 -#define SNDREG32(x)	(*(volatile unsigned long *)SNDREGADDR(x))
   18.26 -#define SNDREG8(x)	(*(volatile unsigned char *)SNDREGADDR(x))
   18.27 -#define CHNREG32(ch, x) (*(volatile unsigned long *)CHNREGADDR(ch,x))
   18.28 -#define CHNREG8(ch, x)	(*(volatile unsigned long *)CHNREGADDR(ch,x))
   18.29 -
   18.30 -#define G2_LOCK(OLD) \
   18.31 -	do { \
   18.32 -		if (!irq_inside_int()) \
   18.33 -			OLD = irq_disable(); \
   18.34 -		/* suspend any G2 DMA here... */ \
   18.35 -		while((*(volatile unsigned int *)0xa05f688c) & 0x20) \
   18.36 -			; \
   18.37 -	} while(0)
   18.38 -
   18.39 -#define G2_UNLOCK(OLD) \
   18.40 -	do { \
   18.41 -		/* resume any G2 DMA here... */ \
   18.42 -		if (!irq_inside_int()) \
   18.43 -			irq_restore(OLD); \
   18.44 -	} while(0)
   18.45 -
   18.46 -
   18.47 -void
   18.48 -aica_init()
   18.49 -{
   18.50 -    int i, j, old = 0;
   18.51 -
   18.52 -    /* Initialize AICA channels */
   18.53 -    G2_LOCK(old);
   18.54 -    SNDREG32(0x2800) = 0x0000;
   18.55 -
   18.56 -    for (i = 0; i < 64; i++) {
   18.57 -        for (j = 0; j < 0x80; j += 4) {
   18.58 -            if ((j & 31) == 0)
   18.59 -                g2_fifo_wait();
   18.60 -            CHNREG32(i, j) = 0;
   18.61 -        }
   18.62 -        g2_fifo_wait();
   18.63 -        CHNREG32(i, 0) = 0x8000;
   18.64 -        CHNREG32(i, 20) = 0x1f;
   18.65 -    }
   18.66 -
   18.67 -    SNDREG32(0x2800) = 0x000f;
   18.68 -    g2_fifo_wait();
   18.69 -    G2_UNLOCK(old);
   18.70 -}
   18.71 -
   18.72 -/* Translates a volume from linear form to logarithmic form (required by
   18.73 -   the AICA chip */
   18.74 -/* int logs[] = {
   18.75 -
   18.76 -0, 40, 50, 58, 63, 68, 73, 77, 80, 83, 86, 89, 92, 94, 97, 99, 101, 103,
   18.77 -105, 107, 109, 111, 112, 114, 116, 117, 119, 120, 122, 123, 125, 126, 127,
   18.78 -129, 130, 131, 133, 134, 135, 136, 137, 139, 140, 141, 142, 143, 144, 145,
   18.79 -146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159,
   18.80 -160, 161, 162, 162, 163, 164, 165, 166, 166, 167, 168, 169, 170, 170, 171,
   18.81 -172, 172, 173, 174, 175, 175, 176, 177, 177, 178, 179, 180, 180, 181, 182,
   18.82 -182, 183, 183, 184, 185, 185, 186, 187, 187, 188, 188, 189, 190, 190, 191,
   18.83 -191, 192, 193, 193, 194, 194, 195, 196, 196, 197, 197, 198, 198, 199, 199,
   18.84 -200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 206, 207, 207,
   18.85 -208, 208, 209, 209, 210, 210, 211, 211, 212, 212, 213, 213, 214, 214, 215,
   18.86 -215, 216, 216, 217, 217, 217, 218, 218, 219, 219, 220, 220, 221, 221, 222,
   18.87 -222, 222, 223, 223, 224, 224, 225, 225, 225, 226, 226, 227, 227, 228, 228,
   18.88 -228, 229, 229, 230, 230, 230, 231, 231, 232, 232, 232, 233, 233, 234, 234,
   18.89 -234, 235, 235, 236, 236, 236, 237, 237, 238, 238, 238, 239, 239, 240, 240,
   18.90 -240, 241, 241, 241, 242, 242, 243, 243, 243, 244, 244, 244, 245, 245, 245,
   18.91 -246, 246, 247, 247, 247, 248, 248, 248, 249, 249, 249, 250, 250, 250, 251,
   18.92 -251, 251, 252, 252, 252, 253, 253, 253, 254, 254, 254, 255
   18.93 -
   18.94 -}; */
   18.95 -
   18.96 -const static unsigned char logs[] = {
   18.97 -    0, 15, 22, 27, 31, 35, 39, 42, 45, 47, 50, 52, 55, 57, 59, 61,
   18.98 -    63, 65, 67, 69, 71, 73, 74, 76, 78, 79, 81, 82, 84, 85, 87, 88,
   18.99 -    90, 91, 92, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 106,
  18.100 -    108, 109, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120, 121,
  18.101 -    122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
  18.102 -    135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 145, 146,
  18.103 -    146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 156,
  18.104 -    157, 158, 159, 160, 160, 161, 162, 163, 164, 164, 165, 166, 167,
  18.105 -    167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176,
  18.106 -    177, 178, 178, 179, 180, 181, 181, 182, 183, 183, 184, 185, 185,
  18.107 -    186, 187, 187, 188, 189, 189, 190, 191, 191, 192, 193, 193, 194,
  18.108 -    195, 195, 196, 197, 197, 198, 199, 199, 200, 200, 201, 202, 202,
  18.109 -    203, 204, 204, 205, 205, 206, 207, 207, 208, 209, 209, 210, 210,
  18.110 -    211, 212, 212, 213, 213, 214, 215, 215, 216, 216, 217, 217, 218,
  18.111 -    219, 219, 220, 220, 221, 221, 222, 223, 223, 224, 224, 225, 225,
  18.112 -    226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 232, 232, 233,
  18.113 -    233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 239, 239, 240,
  18.114 -    240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246,
  18.115 -    247, 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 254, 255
  18.116 -};
  18.117 -
  18.118 -/* For the moment this is going to have to suffice, until we really
  18.119 -   figure out what these mean. */
  18.120 -#define AICA_PAN(x) ((x)==0x80?(0):((x)<0x80?(0x1f):(0x0f)))
  18.121 -#define AICA_VOL(x) (0xff - logs[128 + (((x) & 0xff) / 2)])
  18.122 -//#define AICA_VOL(x) (0xff - logs[x&255])
  18.123 -
  18.124 -static inline unsigned
  18.125 -AICA_FREQ(unsigned freq)
  18.126 -{
  18.127 -    unsigned long freq_lo, freq_base = 5644800;
  18.128 -    int freq_hi = 7;
  18.129 -
  18.130 -    /* Need to convert frequency to floating point format
  18.131 -       (freq_hi is exponent, freq_lo is mantissa)
  18.132 -       Formula is ferq = 44100*2^freq_hi*(1+freq_lo/1024) */
  18.133 -    while (freq < freq_base && freq_hi > -8) {
  18.134 -        freq_base >>= 1;
  18.135 -        --freq_hi;
  18.136 -    }
  18.137 -    while (freq < freq_base && freq_hi > -8) {
  18.138 -        freq_base >>= 1;
  18.139 -        freq_hi--;
  18.140 -    }
  18.141 -    freq_lo = (freq << 10) / freq_base;
  18.142 -    return (freq_hi << 11) | (freq_lo & 1023);
  18.143 -}
  18.144 -
  18.145 -/* Sets up a sound channel completely. This is generally good if you want
  18.146 -   a quick and dirty way to play notes. If you want a more comprehensive
  18.147 -   set of routines (more like PC wavetable cards) see below.
  18.148 -   
  18.149 -   ch is the channel to play on (0 - 63)
  18.150 -   smpptr is the pointer to the sound data; if you're running off the
  18.151 -     SH4, then this ought to be (ptr - 0xa0800000); otherwise it's just
  18.152 -     ptr. Basically, it's an offset into sound ram.
  18.153 -   mode is one of the mode constants (16 bit, 8 bit, ADPCM)
  18.154 -   nsamp is the number of samples to play (not number of bytes!)
  18.155 -   freq is the sampling rate of the sound
  18.156 -   vol is the volume, 0 to 0xff (0xff is louder)
  18.157 -   pan is a panning constant -- 0 is left, 128 is center, 255 is right.
  18.158 -
  18.159 -   This routine (and the similar ones) owe a lot to Marcus' sound example -- 
  18.160 -   I hadn't gotten quite this far into dissecting the individual regs yet. */
  18.161 -void
  18.162 -aica_play(int ch, int mode, unsigned long smpptr, int loopst, int loopend,
  18.163 -          int freq, int vol, int pan, int loopflag)
  18.164 -{
  18.165 -/*	int i;
  18.166 -*/
  18.167 -    int val;
  18.168 -    int old = 0;
  18.169 -
  18.170 -    /* Stop the channel (if it's already playing) */
  18.171 -    aica_stop(ch);
  18.172 -    /* doesn't seem to be needed, but it's here just in case */
  18.173 -/*
  18.174 -	for (i=0; i<256; i++) {
  18.175 -		asm("nop");
  18.176 -		asm("nop");
  18.177 -		asm("nop");
  18.178 -		asm("nop");
  18.179 -	}
  18.180 -*/
  18.181 -    G2_LOCK(old);
  18.182 -    /* Envelope setup. The first of these is the loop point,
  18.183 -       e.g., where the sample starts over when it loops. The second
  18.184 -       is the loop end. This is the full length of the sample when
  18.185 -       you are not looping, or the loop end point when you are (though
  18.186 -       storing more than that is a waste of memory if you're not doing
  18.187 -       volume enveloping). */
  18.188 -    CHNREG32(ch, 8) = loopst & 0xffff;
  18.189 -    CHNREG32(ch, 12) = loopend & 0xffff;
  18.190 -
  18.191 -    /* Write resulting values */
  18.192 -    CHNREG32(ch, 24) = AICA_FREQ(freq);
  18.193 -
  18.194 -    /* Set volume, pan, and some other things that we don't know what
  18.195 -       they do =) */
  18.196 -    CHNREG32(ch, 36) = AICA_PAN(pan) | (0xf << 8);
  18.197 -    /* Convert the incoming volume and pan into hardware values */
  18.198 -    /* Vol starts at zero so we can ramp */
  18.199 -    vol = AICA_VOL(vol);
  18.200 -    CHNREG32(ch, 40) = 0x24 | (vol << 8);
  18.201 -    /* Convert the incoming volume and pan into hardware values */
  18.202 -    /* Vol starts at zero so we can ramp */
  18.203 -
  18.204 -    /* If we supported volume envelopes (which we don't yet) then
  18.205 -       this value would set that up. The top 4 bits determine the
  18.206 -       envelope speed. f is the fastest, 1 is the slowest, and 0
  18.207 -       seems to be an invalid value and does weird things). The
  18.208 -       default (below) sets it into normal mode (play and terminate/loop).
  18.209 -       CHNREG32(ch, 16) = 0xf010;
  18.210 -     */
  18.211 -    CHNREG32(ch, 16) = 0x1f;    /* No volume envelope */
  18.212 -
  18.213 -
  18.214 -    /* Set sample format, buffer address, and looping control. If
  18.215 -       0x0200 mask is set on reg 0, the sample loops infinitely. If
  18.216 -       it's not set, the sample plays once and terminates. We'll
  18.217 -       also set the bits to start playback here. */
  18.218 -    CHNREG32(ch, 4) = smpptr & 0xffff;
  18.219 -    val = 0xc000 | 0x0000 | (mode << 7) | (smpptr >> 16);
  18.220 -    if (loopflag)
  18.221 -        val |= 0x200;
  18.222 -
  18.223 -    CHNREG32(ch, 0) = val;
  18.224 -
  18.225 -    G2_UNLOCK(old);
  18.226 -
  18.227 -    /* Enable playback */
  18.228 -    /* CHNREG32(ch, 0) |= 0xc000; */
  18.229 -    g2_fifo_wait();
  18.230 -
  18.231 -#if 0
  18.232 -    for (i = 0xff; i >= vol; i--) {
  18.233 -        if ((i & 7) == 0)
  18.234 -            g2_fifo_wait();
  18.235 -        CHNREG32(ch, 40) = 0x24 | (i << 8);;
  18.236 -    }
  18.237 -
  18.238 -    g2_fifo_wait();
  18.239 -#endif
  18.240 -}
  18.241 -
  18.242 -/* Stop the sound on a given channel */
  18.243 -void
  18.244 -aica_stop(int ch)
  18.245 -{
  18.246 -    g2_write_32(CHNREGADDR(ch, 0),
  18.247 -                (g2_read_32(CHNREGADDR(ch, 0)) & ~0x4000) | 0x8000);
  18.248 -    g2_fifo_wait();
  18.249 -}
  18.250 -
  18.251 -
  18.252 -/* The rest of these routines can change the channel in mid-stride so you
  18.253 -   can do things like vibrato and panning effects. */
  18.254 -
  18.255 -/* Set channel volume */
  18.256 -void
  18.257 -aica_vol(int ch, int vol)
  18.258 -{
  18.259 -//      g2_write_8(CHNREGADDR(ch, 41),AICA_VOL(vol));
  18.260 -    g2_write_32(CHNREGADDR(ch, 40),
  18.261 -                (g2_read_32(CHNREGADDR(ch, 40)) & 0xffff00ff) |
  18.262 -                (AICA_VOL(vol) << 8));
  18.263 -    g2_fifo_wait();
  18.264 -}
  18.265 -
  18.266 -/* Set channel pan */
  18.267 -void
  18.268 -aica_pan(int ch, int pan)
  18.269 -{
  18.270 -//      g2_write_8(CHNREGADDR(ch, 36),AICA_PAN(pan));
  18.271 -    g2_write_32(CHNREGADDR(ch, 36),
  18.272 -                (g2_read_32(CHNREGADDR(ch, 36)) & 0xffffff00) |
  18.273 -                (AICA_PAN(pan)));
  18.274 -    g2_fifo_wait();
  18.275 -}
  18.276 -
  18.277 -/* Set channel frequency */
  18.278 -void
  18.279 -aica_freq(int ch, int freq)
  18.280 -{
  18.281 -    g2_write_32(CHNREGADDR(ch, 24), AICA_FREQ(freq));
  18.282 -    g2_fifo_wait();
  18.283 -}
  18.284 -
  18.285 -/* Get channel position */
  18.286 -int
  18.287 -aica_get_pos(int ch)
  18.288 -{
  18.289 -#if 1
  18.290 -    /* Observe channel ch */
  18.291 -    g2_write_32(SNDREGADDR(0x280c),
  18.292 -                (g2_read_32(SNDREGADDR(0x280c)) & 0xffff00ff) | (ch << 8));
  18.293 -    g2_fifo_wait();
  18.294 -    /* Update position counters */
  18.295 -    return g2_read_32(SNDREGADDR(0x2814)) & 0xffff;
  18.296 -#else
  18.297 -    /* Observe channel ch */
  18.298 -    g2_write_8(SNDREGADDR(0x280d), ch);
  18.299 -    /* Update position counters */
  18.300 -    return g2_read_32(SNDREGADDR(0x2814)) & 0xffff;
  18.301 -#endif
  18.302 -}
  18.303 -
  18.304 -/* vi: set ts=4 sw=4 expandtab: */
    19.1 --- a/src/audio/dc/aica.h	Sat Sep 19 07:09:41 2009 +0000
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,42 +0,0 @@
    19.4 -/*
    19.5 -    SDL - Simple DirectMedia Layer
    19.6 -    Copyright (C) 1997-2009 Sam Lantinga
    19.7 -
    19.8 -    This library is free software; you can redistribute it and/or
    19.9 -    modify it under the terms of the GNU Lesser General Public
   19.10 -    License as published by the Free Software Foundation; either
   19.11 -    version 2.1 of the License, or (at your option) any later version.
   19.12 -
   19.13 -    This library is distributed in the hope that it will be useful,
   19.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   19.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   19.16 -    Lesser General Public License for more details.
   19.17 -
   19.18 -    You should have received a copy of the GNU Lesser General Public
   19.19 -    License along with this library; if not, write to the Free Software
   19.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   19.21 -
   19.22 -    Sam Lantinga
   19.23 -    slouken@libsdl.org
   19.24 -*/
   19.25 -#include "SDL_config.h"
   19.26 -
   19.27 -#ifndef _AICA_H_
   19.28 -#define _AICA_H_
   19.29 -
   19.30 -#define	AICA_MEM	0xa0800000
   19.31 -
   19.32 -#define SM_8BIT		1
   19.33 -#define SM_16BIT	0
   19.34 -#define SM_ADPCM	2
   19.35 -
   19.36 -void aica_play(int ch, int mode, unsigned long smpptr, int looptst,
   19.37 -               int loopend, int freq, int vol, int pan, int loopflag);
   19.38 -void aica_stop(int ch);
   19.39 -void aica_vol(int ch, int vol);
   19.40 -void aica_pan(int ch, int pan);
   19.41 -void aica_freq(int ch, int freq);
   19.42 -int aica_get_pos(int ch);
   19.43 -
   19.44 -#endif
   19.45 -/* vi: set ts=4 sw=4 expandtab: */
    20.1 --- a/src/joystick/dc/SDL_sysjoystick.c	Sat Sep 19 07:09:41 2009 +0000
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,216 +0,0 @@
    20.4 -/*
    20.5 -    SDL - Simple DirectMedia Layer
    20.6 -    Copyright (C) 1997-2009 Sam Lantinga
    20.7 -
    20.8 -    This library is free software; you can redistribute it and/or
    20.9 -    modify it under the terms of the GNU Lesser General Public
   20.10 -    License as published by the Free Software Foundation; either
   20.11 -    version 2.1 of the License, or (at your option) any later version.
   20.12 -
   20.13 -    This library is distributed in the hope that it will be useful,
   20.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   20.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   20.16 -    Lesser General Public License for more details.
   20.17 -
   20.18 -    You should have received a copy of the GNU Lesser General Public
   20.19 -    License along with this library; if not, write to the Free Software
   20.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   20.21 -
   20.22 -    Sam Lantinga
   20.23 -    slouken@libsdl.org
   20.24 -*/
   20.25 -#include "SDL_config.h"
   20.26 -
   20.27 -#ifdef SDL_JOYSTICK_DC
   20.28 -
   20.29 -#include "SDL_events.h"
   20.30 -#include "SDL_joystick.h"
   20.31 -#include "../SDL_sysjoystick.h"
   20.32 -#include "../SDL_joystick_c.h"
   20.33 -
   20.34 -#include <dc/maple.h>
   20.35 -#include <dc/maple/controller.h>
   20.36 -
   20.37 -#define MAX_JOYSTICKS	8       /* only 2 are supported in the multimedia API */
   20.38 -#define MAX_AXES	6       /* each joystick can have up to 6 axes */
   20.39 -#define MAX_BUTTONS	8       /* and 8 buttons                      */
   20.40 -#define	MAX_HATS	2
   20.41 -
   20.42 -#define	JOYNAMELEN	8
   20.43 -
   20.44 -/* array to hold joystick ID values */
   20.45 -static uint8 SYS_Joystick_addr[MAX_JOYSTICKS];
   20.46 -
   20.47 -/* The private structure used to keep track of a joystick */
   20.48 -struct joystick_hwdata
   20.49 -{
   20.50 -    cont_cond_t prev_cond;
   20.51 -    int prev_buttons;
   20.52 -};
   20.53 -
   20.54 -/* Function to scan the system for joysticks.
   20.55 - * This function should set SDL_numjoysticks to the number of available
   20.56 - * joysticks.  Joystick 0 should be the system default joystick.
   20.57 - * It should return 0, or -1 on an unrecoverable fatal error.
   20.58 - */
   20.59 -int
   20.60 -SDL_SYS_JoystickInit(void)
   20.61 -{
   20.62 -    int numdevs;
   20.63 -
   20.64 -    int p, u;
   20.65 -
   20.66 -    numdevs = 0;
   20.67 -    for (p = 0; p < MAPLE_PORT_COUNT; p++) {
   20.68 -        for (u = 0; u < MAPLE_UNIT_COUNT; u++) {
   20.69 -            if (maple_device_func(p, u) & MAPLE_FUNC_CONTROLLER) {
   20.70 -                SYS_Joystick_addr[numdevs] = maple_addr(p, u);
   20.71 -                numdevs++;
   20.72 -            }
   20.73 -        }
   20.74 -    }
   20.75 -
   20.76 -    return (numdevs);
   20.77 -}
   20.78 -
   20.79 -/* Function to get the device-dependent name of a joystick */
   20.80 -const char *
   20.81 -SDL_SYS_JoystickName(int index)
   20.82 -{
   20.83 -    maple_device_t *dev;
   20.84 -    if (maple_compat_resolve
   20.85 -        (SYS_Joystick_addr[index], &dev, MAPLE_FUNC_CONTROLLER) != 0)
   20.86 -        return NULL;
   20.87 -    return dev->info.product_name;
   20.88 -}
   20.89 -
   20.90 -/* Function to open a joystick for use.
   20.91 -   The joystick to open is specified by the index field of the joystick.
   20.92 -   This should fill the nbuttons and naxes fields of the joystick structure.
   20.93 -   It returns 0, or -1 if there is an error.
   20.94 - */
   20.95 -int
   20.96 -SDL_SYS_JoystickOpen(SDL_Joystick * joystick)
   20.97 -{
   20.98 -    /* allocate memory for system specific hardware data */
   20.99 -    joystick->hwdata =
  20.100 -        (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
  20.101 -    if (joystick->hwdata == NULL) {
  20.102 -        SDL_OutOfMemory();
  20.103 -        return (-1);
  20.104 -    }
  20.105 -    SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
  20.106 -
  20.107 -    /* fill nbuttons, naxes, and nhats fields */
  20.108 -    joystick->nbuttons = MAX_BUTTONS;
  20.109 -    joystick->naxes = MAX_AXES;
  20.110 -    joystick->nhats = MAX_HATS;
  20.111 -    return (0);
  20.112 -}
  20.113 -
  20.114 -
  20.115 -/* Function to update the state of a joystick - called as a device poll.
  20.116 - * This function shouldn't update the joystick structure directly,
  20.117 - * but instead should call SDL_PrivateJoystick*() to deliver events
  20.118 - * and update joystick device state.
  20.119 - */
  20.120 -
  20.121 -void
  20.122 -SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
  20.123 -{
  20.124 -    const int sdl_buttons[] = {
  20.125 -        CONT_C,
  20.126 -        CONT_B,
  20.127 -        CONT_A,
  20.128 -        CONT_START,
  20.129 -        CONT_Z,
  20.130 -        CONT_Y,
  20.131 -        CONT_X,
  20.132 -        CONT_D
  20.133 -    };
  20.134 -
  20.135 -    uint8 addr;
  20.136 -    cont_cond_t cond, *prev_cond;
  20.137 -    int buttons, prev_buttons, i, changed;
  20.138 -
  20.139 -    addr = SYS_Joystick_addr[joystick->index];
  20.140 -    if (cont_get_cond(addr, &cond) < 0)
  20.141 -        return;
  20.142 -
  20.143 -    buttons = cond.buttons;
  20.144 -    prev_buttons = joystick->hwdata->prev_buttons;
  20.145 -    changed = buttons ^ prev_buttons;
  20.146 -
  20.147 -    if ((changed) &
  20.148 -        (CONT_DPAD_UP | CONT_DPAD_DOWN | CONT_DPAD_LEFT | CONT_DPAD_RIGHT)) {
  20.149 -        int hat = SDL_HAT_CENTERED;
  20.150 -        if (buttons & CONT_DPAD_UP)
  20.151 -            hat |= SDL_HAT_UP;
  20.152 -        if (buttons & CONT_DPAD_DOWN)
  20.153 -            hat |= SDL_HAT_DOWN;
  20.154 -        if (buttons & CONT_DPAD_LEFT)
  20.155 -            hat |= SDL_HAT_LEFT;
  20.156 -        if (buttons & CONT_DPAD_RIGHT)
  20.157 -            hat |= SDL_HAT_RIGHT;
  20.158 -        SDL_PrivateJoystickHat(joystick, 0, hat);
  20.159 -    }
  20.160 -    if ((changed) &
  20.161 -        (CONT_DPAD2_UP | CONT_DPAD2_DOWN | CONT_DPAD2_LEFT |
  20.162 -         CONT_DPAD2_RIGHT)) {
  20.163 -        int hat = SDL_HAT_CENTERED;
  20.164 -        if (buttons & CONT_DPAD2_UP)
  20.165 -            hat |= SDL_HAT_UP;
  20.166 -        if (buttons & CONT_DPAD2_DOWN)
  20.167 -            hat |= SDL_HAT_DOWN;
  20.168 -        if (buttons & CONT_DPAD2_LEFT)
  20.169 -            hat |= SDL_HAT_LEFT;
  20.170 -        if (buttons & CONT_DPAD2_RIGHT)
  20.171 -            hat |= SDL_HAT_RIGHT;
  20.172 -        SDL_PrivateJoystickHat(joystick, 1, hat);
  20.173 -    }
  20.174 -
  20.175 -    for (i = 0; i < sizeof(sdl_buttons) / sizeof(sdl_buttons[0]); i++) {
  20.176 -        if (changed & sdl_buttons[i]) {
  20.177 -            SDL_PrivateJoystickButton(joystick, i,
  20.178 -                                      (buttons & sdl_buttons[i]) ?
  20.179 -                                      SDL_PRESSED : SDL_RELEASED);
  20.180 -        }
  20.181 -    }
  20.182 -
  20.183 -    prev_cond = &joystick->hwdata->prev_cond;
  20.184 -    if (cond.joyx != prev_cond->joyx)
  20.185 -        SDL_PrivateJoystickAxis(joystick, 0, cond.joyx - 128);
  20.186 -    if (cond.joyy != prev_cond->joyy)
  20.187 -        SDL_PrivateJoystickAxis(joystick, 1, cond.joyy - 128);
  20.188 -    if (cond.rtrig != prev_cond->rtrig)
  20.189 -        SDL_PrivateJoystickAxis(joystick, 2, cond.rtrig);
  20.190 -    if (cond.ltrig != prev_cond->ltrig)
  20.191 -        SDL_PrivateJoystickAxis(joystick, 3, cond.ltrig);
  20.192 -    if (cond.joy2x != prev_cond->joy2x)
  20.193 -        SDL_PrivateJoystickAxis(joystick, 4, cond.joy2x - 128);
  20.194 -    if (cond.joy2y != prev_cond->joy2y)
  20.195 -        SDL_PrivateJoystickAxis(joystick, 5, cond.joy2y - 128);
  20.196 -
  20.197 -    joystick->hwdata->prev_buttons = buttons;
  20.198 -    joystick->hwdata->prev_cond = cond;
  20.199 -}
  20.200 -
  20.201 -/* Function to close a joystick after use */
  20.202 -void
  20.203 -SDL_SYS_JoystickClose(SDL_Joystick * joystick)
  20.204 -{
  20.205 -    if (joystick->hwdata != NULL) {
  20.206 -        /* free system specific hardware data */
  20.207 -        SDL_free(joystick->hwdata);
  20.208 -    }
  20.209 -}
  20.210 -
  20.211 -/* Function to perform any system-specific joystick related cleanup */
  20.212 -void
  20.213 -SDL_SYS_JoystickQuit(void)
  20.214 -{
  20.215 -    return;
  20.216 -}
  20.217 -
  20.218 -#endif /* SDL_JOYSTICK_DC */
  20.219 -/* vi: set ts=4 sw=4 expandtab: */
    21.1 --- a/src/power/SDL_power.c	Sat Sep 19 07:09:41 2009 +0000
    21.2 +++ b/src/power/SDL_power.c	Sat Sep 19 07:21:22 2009 +0000
    21.3 @@ -39,7 +39,7 @@
    21.4  
    21.5  #ifndef SDL_POWER_DISABLED
    21.6  #ifdef SDL_POWER_HARDWIRED
    21.7 -/* This is for things that _never_ have a battery, like the Dreamcast, etc. */
    21.8 +/* This is for things that _never_ have a battery */
    21.9  static SDL_bool
   21.10  SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent)
   21.11  {
    22.1 --- a/src/thread/SDL_thread_c.h	Sat Sep 19 07:09:41 2009 +0000
    22.2 +++ b/src/thread/SDL_thread_c.h	Sat Sep 19 07:21:22 2009 +0000
    22.3 @@ -29,8 +29,6 @@
    22.4  #include "generic/SDL_systhread_c.h"
    22.5  #elif SDL_THREAD_BEOS
    22.6  #include "beos/SDL_systhread_c.h"
    22.7 -#elif SDL_THREAD_DC
    22.8 -#include "dc/SDL_systhread_c.h"
    22.9  #elif SDL_THREAD_EPOC
   22.10  #include "epoc/SDL_systhread_c.h"
   22.11  #elif SDL_THREAD_PTH
    23.1 --- a/src/thread/dc/SDL_syscond.c	Sat Sep 19 07:09:41 2009 +0000
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,223 +0,0 @@
    23.4 -/*
    23.5 -    SDL - Simple DirectMedia Layer
    23.6 -    Copyright (C) 1997-2009 Sam Lantinga
    23.7 -
    23.8 -    This library is free software; you can redistribute it and/or
    23.9 -    modify it under the terms of the GNU Lesser General Public
   23.10 -    License as published by the Free Software Foundation; either
   23.11 -    version 2.1 of the License, or (at your option) any later version.
   23.12 -
   23.13 -    This library is distributed in the hope that it will be useful,
   23.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   23.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   23.16 -    Lesser General Public License for more details.
   23.17 -
   23.18 -    You should have received a copy of the GNU Lesser General Public
   23.19 -    License along with this library; if not, write to the Free Software
   23.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   23.21 -
   23.22 -    Sam Lantinga
   23.23 -    slouken@libsdl.org
   23.24 -*/
   23.25 -#include "SDL_config.h"
   23.26 -
   23.27 -/* An implementation of condition variables using semaphores and mutexes */
   23.28 -/*
   23.29 -   This implementation borrows heavily from the BeOS condition variable
   23.30 -   implementation, written by Christopher Tate and Owen Smith.  Thanks!
   23.31 - */
   23.32 -
   23.33 -#include "SDL_thread.h"
   23.34 -
   23.35 -struct SDL_cond
   23.36 -{
   23.37 -    SDL_mutex *lock;
   23.38 -    int waiting;
   23.39 -    int signals;
   23.40 -    SDL_sem *wait_sem;
   23.41 -    SDL_sem *wait_done;
   23.42 -};
   23.43 -
   23.44 -/* Create a condition variable */
   23.45 -SDL_cond *
   23.46 -SDL_CreateCond(void)
   23.47 -{
   23.48 -    SDL_cond *cond;
   23.49 -
   23.50 -    cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
   23.51 -    if (cond) {
   23.52 -        cond->lock = SDL_CreateMutex();
   23.53 -        cond->wait_sem = SDL_CreateSemaphore(0);
   23.54 -        cond->wait_done = SDL_CreateSemaphore(0);
   23.55 -        cond->waiting = cond->signals = 0;
   23.56 -        if (!cond->lock || !cond->wait_sem || !cond->wait_done) {
   23.57 -            SDL_DestroyCond(cond);
   23.58 -            cond = NULL;
   23.59 -        }
   23.60 -    } else {
   23.61 -        SDL_OutOfMemory();
   23.62 -    }
   23.63 -    return (cond);
   23.64 -}
   23.65 -
   23.66 -/* Destroy a condition variable */
   23.67 -void
   23.68 -SDL_DestroyCond(SDL_cond * cond)
   23.69 -{
   23.70 -    if (cond) {
   23.71 -        if (cond->wait_sem) {
   23.72 -            SDL_DestroySemaphore(cond->wait_sem);
   23.73 -        }
   23.74 -        if (cond->wait_done) {
   23.75 -            SDL_DestroySemaphore(cond->wait_done);
   23.76 -        }
   23.77 -        if (cond->lock) {
   23.78 -            SDL_DestroyMutex(cond->lock);
   23.79 -        }
   23.80 -        SDL_free(cond);
   23.81 -    }
   23.82 -}
   23.83 -
   23.84 -/* Restart one of the threads that are waiting on the condition variable */
   23.85 -int
   23.86 -SDL_CondSignal(SDL_cond * cond)
   23.87 -{
   23.88 -    if (!cond) {
   23.89 -        SDL_SetError("Passed a NULL condition variable");
   23.90 -        return -1;
   23.91 -    }
   23.92 -
   23.93 -    /* If there are waiting threads not already signalled, then
   23.94 -       signal the condition and wait for the thread to respond.
   23.95 -     */
   23.96 -    SDL_LockMutex(cond->lock);
   23.97 -    if (cond->waiting > cond->signals) {
   23.98 -        ++cond->signals;
   23.99 -        SDL_SemPost(cond->wait_sem);
  23.100 -        SDL_UnlockMutex(cond->lock);
  23.101 -        SDL_SemWait(cond->wait_done);
  23.102 -    } else {
  23.103 -        SDL_UnlockMutex(cond->lock);
  23.104 -    }
  23.105 -
  23.106 -    return 0;
  23.107 -}
  23.108 -
  23.109 -/* Restart all threads that are waiting on the condition variable */
  23.110 -int
  23.111 -SDL_CondBroadcast(SDL_cond * cond)
  23.112 -{
  23.113 -    if (!cond) {
  23.114 -        SDL_SetError("Passed a NULL condition variable");
  23.115 -        return -1;
  23.116 -    }
  23.117 -
  23.118 -    /* If there are waiting threads not already signalled, then
  23.119 -       signal the condition and wait for the thread to respond.
  23.120 -     */
  23.121 -    SDL_LockMutex(cond->lock);
  23.122 -    if (cond->waiting > cond->signals) {
  23.123 -        int i, num_waiting;
  23.124 -
  23.125 -        num_waiting = (cond->waiting - cond->signals);
  23.126 -        cond->signals = cond->waiting;
  23.127 -        for (i = 0; i < num_waiting; ++i) {
  23.128 -            SDL_SemPost(cond->wait_sem);
  23.129 -        }
  23.130 -        /* Now all released threads are blocked here, waiting for us.
  23.131 -           Collect them all (and win fabulous prizes!) :-)
  23.132 -         */
  23.133 -        SDL_UnlockMutex(cond->lock);
  23.134 -        for (i = 0; i < num_waiting; ++i) {
  23.135 -            SDL_SemWait(cond->wait_done);
  23.136 -        }
  23.137 -    } else {
  23.138 -        SDL_UnlockMutex(cond->lock);
  23.139 -    }
  23.140 -
  23.141 -    return 0;
  23.142 -}
  23.143 -
  23.144 -/* Wait on the condition variable for at most 'ms' milliseconds.
  23.145 -   The mutex must be locked before entering this function!
  23.146 -   The mutex is unlocked during the wait, and locked again after the wait.
  23.147 -
  23.148 -Typical use:
  23.149 -
  23.150 -Thread A:
  23.151 -	SDL_LockMutex(lock);
  23.152 -	while ( ! condition ) {
  23.153 -		SDL_CondWait(cond);
  23.154 -	}
  23.155 -	SDL_UnlockMutex(lock);
  23.156 -
  23.157 -Thread B:
  23.158 -	SDL_LockMutex(lock);
  23.159 -	...
  23.160 -	condition = true;
  23.161 -	...
  23.162 -	SDL_UnlockMutex(lock);
  23.163 - */
  23.164 -int
  23.165 -SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
  23.166 -{
  23.167 -    int retval;
  23.168 -
  23.169 -    if (!cond) {
  23.170 -        SDL_SetError("Passed a NULL condition variable");
  23.171 -        return -1;
  23.172 -    }
  23.173 -
  23.174 -    /* Obtain the protection mutex, and increment the number of waiters.
  23.175 -       This allows the signal mechanism to only perform a signal if there
  23.176 -       are waiting threads.
  23.177 -     */
  23.178 -    SDL_LockMutex(cond->lock);
  23.179 -    ++cond->waiting;
  23.180 -    SDL_UnlockMutex(cond->lock);
  23.181 -
  23.182 -    /* Unlock the mutex, as is required by condition variable semantics */
  23.183 -    SDL_UnlockMutex(mutex);
  23.184 -
  23.185 -    /* Wait for a signal */
  23.186 -    if (ms == SDL_MUTEX_MAXWAIT) {
  23.187 -        retval = SDL_SemWait(cond->wait_sem);
  23.188 -    } else {
  23.189 -        retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
  23.190 -    }
  23.191 -
  23.192 -    /* Let the signaler know we have completed the wait, otherwise
  23.193 -       the signaler can race ahead and get the condition semaphore
  23.194 -       if we are stopped between the mutex unlock and semaphore wait,
  23.195 -       giving a deadlock.  See the following URL for details:
  23.196 -       http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
  23.197 -     */
  23.198 -    SDL_LockMutex(cond->lock);
  23.199 -    if (cond->signals > 0) {
  23.200 -        /* If we timed out, we need to eat a condition signal */
  23.201 -        if (retval > 0) {
  23.202 -            SDL_SemWait(cond->wait_sem);
  23.203 -        }
  23.204 -        /* We always notify the signal thread that we are done */
  23.205 -        SDL_SemPost(cond->wait_done);
  23.206 -
  23.207 -        /* Signal handshake complete */
  23.208 -        --cond->signals;
  23.209 -    }
  23.210 -    --cond->waiting;
  23.211 -    SDL_UnlockMutex(cond->lock);
  23.212 -
  23.213 -    /* Lock the mutex, as is required by condition variable semantics */
  23.214 -    SDL_LockMutex(mutex);
  23.215 -
  23.216 -    return retval;
  23.217 -}
  23.218 -
  23.219 -/* Wait on the condition variable forever */
  23.220 -int
  23.221 -SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
  23.222 -{
  23.223 -    return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
  23.224 -}
  23.225 -
  23.226 -/* vi: set ts=4 sw=4 expandtab: */
    24.1 --- a/src/thread/dc/SDL_syscond_c.h	Sat Sep 19 07:09:41 2009 +0000
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,23 +0,0 @@
    24.4 -/*
    24.5 -    SDL - Simple DirectMedia Layer
    24.6 -    Copyright (C) 1997-2009 Sam Lantinga
    24.7 -
    24.8 -    This library is free software; you can redistribute it and/or
    24.9 -    modify it under the terms of the GNU Lesser General Public
   24.10 -    License as published by the Free Software Foundation; either
   24.11 -    version 2.1 of the License, or (at your option) any later version.
   24.12 -
   24.13 -    This library is distributed in the hope that it will be useful,
   24.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   24.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   24.16 -    Lesser General Public License for more details.
   24.17 -
   24.18 -    You should have received a copy of the GNU Lesser General Public
   24.19 -    License along with this library; if not, write to the Free Software
   24.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   24.21 -
   24.22 -    Sam Lantinga
   24.23 -    slouken@libsdl.org
   24.24 -*/
   24.25 -#include "SDL_config.h"
   24.26 -/* vi: set ts=4 sw=4 expandtab: */
    25.1 --- a/src/thread/dc/SDL_sysmutex.c	Sat Sep 19 07:09:41 2009 +0000
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,129 +0,0 @@
    25.4 -/*
    25.5 -    SDL - Simple DirectMedia Layer
    25.6 -    Copyright (C) 1997-2009 Sam Lantinga
    25.7 -
    25.8 -    This library is free software; you can redistribute it and/or
    25.9 -    modify it under the terms of the GNU Lesser General Public
   25.10 -    License as published by the Free Software Foundation; either
   25.11 -    version 2.1 of the License, or (at your option) any later version.
   25.12 -
   25.13 -    This library is distributed in the hope that it will be useful,
   25.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   25.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   25.16 -    Lesser General Public License for more details.
   25.17 -
   25.18 -    You should have received a copy of the GNU Lesser General Public
   25.19 -    License along with this library; if not, write to the Free Software
   25.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   25.21 -
   25.22 -    Sam Lantinga
   25.23 -    slouken@libsdl.org
   25.24 -*/
   25.25 -#include "SDL_config.h"
   25.26 -
   25.27 -/* An implementation of mutexes using semaphores */
   25.28 -
   25.29 -#include "SDL_thread.h"
   25.30 -#include "SDL_systhread_c.h"
   25.31 -
   25.32 -#include <arch/spinlock.h>
   25.33 -
   25.34 -struct SDL_mutex
   25.35 -{
   25.36 -    int recursive;
   25.37 -    Uint32 owner;
   25.38 -    spinlock_t mutex;
   25.39 -};
   25.40 -
   25.41 -/* Create a mutex */
   25.42 -SDL_mutex *
   25.43 -SDL_CreateMutex(void)
   25.44 -{
   25.45 -    SDL_mutex *mutex;
   25.46 -
   25.47 -    /* Allocate mutex memory */
   25.48 -    mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
   25.49 -    if (mutex) {
   25.50 -        spinlock_init(&mutex->mutex);
   25.51 -        mutex->recursive = 0;
   25.52 -        mutex->owner = 0;
   25.53 -    } else {
   25.54 -        SDL_OutOfMemory();
   25.55 -    }
   25.56 -    return mutex;
   25.57 -}
   25.58 -
   25.59 -/* Free the mutex */
   25.60 -void
   25.61 -SDL_DestroyMutex(SDL_mutex * mutex)
   25.62 -{
   25.63 -    if (mutex) {
   25.64 -        SDL_free(mutex);
   25.65 -    }
   25.66 -}
   25.67 -
   25.68 -/* Lock the semaphore */
   25.69 -int
   25.70 -SDL_mutexP(SDL_mutex * mutex)
   25.71 -{
   25.72 -#if SDL_THREADS_DISABLED
   25.73 -    return SDL_arraysize(return), 0;
   25.74 -#else
   25.75 -    Uint32 this_thread;
   25.76 -
   25.77 -    if (mutex == NULL) {
   25.78 -        SDL_SetError("Passed a NULL mutex");
   25.79 -        return -1;
   25.80 -    }
   25.81 -
   25.82 -    this_thread = SDL_ThreadID();
   25.83 -    if (mutex->owner == this_thread) {
   25.84 -        ++mutex->recursive;
   25.85 -    } else {
   25.86 -        /* The order of operations is important.
   25.87 -           We set the locking thread id after we obtain the lock
   25.88 -           so unlocks from other threads will fail.
   25.89 -         */
   25.90 -        spinlock_lock(&mutex->mutex);
   25.91 -        mutex->owner = this_thread;
   25.92 -        mutex->recursive = 0;
   25.93 -    }
   25.94 -
   25.95 -    return 0;
   25.96 -#endif /* SDL_THREADS_DISABLED */
   25.97 -}
   25.98 -
   25.99 -/* Unlock the mutex */
  25.100 -int
  25.101 -SDL_mutexV(SDL_mutex * mutex)
  25.102 -{
  25.103 -#if SDL_THREADS_DISABLED
  25.104 -    return 0;
  25.105 -#else
  25.106 -    if (mutex == NULL) {
  25.107 -        SDL_SetError("Passed a NULL mutex");
  25.108 -        return -1;
  25.109 -    }
  25.110 -
  25.111 -    /* If we don't own the mutex, we can't unlock it */
  25.112 -    if (SDL_ThreadID() != mutex->owner) {
  25.113 -        SDL_SetError("mutex not owned by this thread");
  25.114 -        return -1;
  25.115 -    }
  25.116 -
  25.117 -    if (mutex->recursive) {
  25.118 -        --mutex->recursive;
  25.119 -    } else {
  25.120 -        /* The order of operations is important.
  25.121 -           First reset the owner so another thread doesn't lock
  25.122 -           the mutex and set the ownership before we reset it,
  25.123 -           then release the lock semaphore.
  25.124 -         */
  25.125 -        mutex->owner = 0;
  25.126 -        spinlock_unlock(&mutex->mutex);
  25.127 -    }
  25.128 -    return 0;
  25.129 -#endif /* SDL_THREADS_DISABLED */
  25.130 -}
  25.131 -
  25.132 -/* vi: set ts=4 sw=4 expandtab: */
    26.1 --- a/src/thread/dc/SDL_sysmutex_c.h	Sat Sep 19 07:09:41 2009 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,23 +0,0 @@
    26.4 -/*
    26.5 -    SDL - Simple DirectMedia Layer
    26.6 -    Copyright (C) 1997-2009 Sam Lantinga
    26.7 -
    26.8 -    This library is free software; you can redistribute it and/or
    26.9 -    modify it under the terms of the GNU Lesser General Public
   26.10 -    License as published by the Free Software Foundation; either
   26.11 -    version 2.1 of the License, or (at your option) any later version.
   26.12 -
   26.13 -    This library is distributed in the hope that it will be useful,
   26.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   26.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   26.16 -    Lesser General Public License for more details.
   26.17 -
   26.18 -    You should have received a copy of the GNU Lesser General Public
   26.19 -    License along with this library; if not, write to the Free Software
   26.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   26.21 -
   26.22 -    Sam Lantinga
   26.23 -    slouken@libsdl.org
   26.24 -*/
   26.25 -#include "SDL_config.h"
   26.26 -/* vi: set ts=4 sw=4 expandtab: */
    27.1 --- a/src/thread/dc/SDL_syssem.c	Sat Sep 19 07:09:41 2009 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,186 +0,0 @@
    27.4 -/*
    27.5 -    SDL - Simple DirectMedia Layer
    27.6 -    Copyright (C) 1997-2009 Sam Lantinga
    27.7 -
    27.8 -    This library is free software; you can redistribute it and/or
    27.9 -    modify it under the terms of the GNU Lesser General Public
   27.10 -    License as published by the Free Software Foundation; either
   27.11 -    version 2.1 of the License, or (at your option) any later version.
   27.12 -
   27.13 -    This library is distributed in the hope that it will be useful,
   27.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   27.16 -    Lesser General Public License for more details.
   27.17 -
   27.18 -    You should have received a copy of the GNU Lesser General Public
   27.19 -    License along with this library; if not, write to the Free Software
   27.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   27.21 -
   27.22 -    Sam Lantinga
   27.23 -    slouken@libsdl.org
   27.24 -*/
   27.25 -#include "SDL_config.h"
   27.26 -
   27.27 -/* An implementation of semaphores using mutexes and condition variables */
   27.28 -
   27.29 -#include "SDL_timer.h"
   27.30 -#include "SDL_thread.h"
   27.31 -#include "SDL_systhread_c.h"
   27.32 -
   27.33 -
   27.34 -#if SDL_THREADS_DISABLED
   27.35 -
   27.36 -SDL_sem *
   27.37 -SDL_CreateSemaphore(Uint32 initial_value)
   27.38 -{
   27.39 -    SDL_SetError("SDL not configured with thread support");
   27.40 -    return (SDL_sem *) 0;
   27.41 -}
   27.42 -
   27.43 -void
   27.44 -SDL_DestroySemaphore(SDL_sem * sem)
   27.45 -{
   27.46 -    return;
   27.47 -}
   27.48 -
   27.49 -int
   27.50 -SDL_SemTryWait(SDL_sem * sem)
   27.51 -{
   27.52 -    SDL_SetError("SDL not configured with thread support");
   27.53 -    return -1;
   27.54 -}
   27.55 -
   27.56 -int
   27.57 -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
   27.58 -{
   27.59 -    SDL_SetError("SDL not configured with thread support");
   27.60 -    return -1;
   27.61 -}
   27.62 -
   27.63 -int
   27.64 -SDL_SemWait(SDL_sem * sem)
   27.65 -{
   27.66 -    SDL_SetError("SDL not configured with thread support");
   27.67 -    return -1;
   27.68 -}
   27.69 -
   27.70 -Uint32
   27.71 -SDL_SemValue(SDL_sem * sem)
   27.72 -{
   27.73 -    return 0;
   27.74 -}
   27.75 -
   27.76 -int
   27.77 -SDL_SemPost(SDL_sem * sem)
   27.78 -{
   27.79 -    SDL_SetError("SDL not configured with thread support");
   27.80 -    return -1;
   27.81 -}
   27.82 -
   27.83 -#else
   27.84 -
   27.85 -#include <kos/sem.h>
   27.86 -
   27.87 -struct SDL_semaphore
   27.88 -{
   27.89 -    semaphore_t sem;
   27.90 -};
   27.91 -
   27.92 -SDL_sem *
   27.93 -SDL_CreateSemaphore(Uint32 initial_value)
   27.94 -{
   27.95 -    return (SDL_sem *) sem_create(initial_value);
   27.96 -}
   27.97 -
   27.98 -/* WARNING:
   27.99 -   You cannot call this function when another thread is using the semaphore.
  27.100 -*/
  27.101 -void
  27.102 -SDL_DestroySemaphore(SDL_sem * sem)
  27.103 -{
  27.104 -    if (!sem) {
  27.105 -        SDL_SetError("Passed a NULL semaphore");
  27.106 -        return;
  27.107 -    }
  27.108 -
  27.109 -    sem_destroy(&sem->sem);
  27.110 -}
  27.111 -
  27.112 -int
  27.113 -SDL_SemTryWait(SDL_sem * sem)
  27.114 -{
  27.115 -    int retval;
  27.116 -
  27.117 -    if (!sem) {
  27.118 -        SDL_SetError("Passed a NULL semaphore");
  27.119 -        return -1;
  27.120 -    }
  27.121 -
  27.122 -    retval = sem_trywait(&sem->sem);
  27.123 -    if (retval == 0)
  27.124 -        return 0;
  27.125 -    else
  27.126 -        return SDL_MUTEX_TIMEDOUT;
  27.127 -
  27.128 -    return retval;
  27.129 -}
  27.130 -
  27.131 -int
  27.132 -SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
  27.133 -{
  27.134 -    int retval;
  27.135 -
  27.136 -    if (!sem) {
  27.137 -        SDL_SetError("Passed a NULL semaphore");
  27.138 -        return -1;
  27.139 -    }
  27.140 -
  27.141 -    /* A timeout of 0 is an easy case */
  27.142 -    if (timeout == 0) {
  27.143 -        return SDL_SemTryWait(sem);
  27.144 -    }
  27.145 -
  27.146 -    retval = sem_wait_timed(&sem->sem, timeout);
  27.147 -    if (retval == -1)
  27.148 -        retval = SDL_MUTEX_TIMEDOUT;
  27.149 -
  27.150 -    return retval;
  27.151 -}
  27.152 -
  27.153 -int
  27.154 -SDL_SemWait(SDL_sem * sem)
  27.155 -{
  27.156 -    if (!sem) {
  27.157 -        SDL_SetError("Passed a NULL semaphore");
  27.158 -        return -1;
  27.159 -    }
  27.160 -
  27.161 -    sem_wait(&sem->sem);
  27.162 -    return 0;
  27.163 -}
  27.164 -
  27.165 -Uint32
  27.166 -SDL_SemValue(SDL_sem * sem)
  27.167 -{
  27.168 -    if (!sem) {
  27.169 -        SDL_SetError("Passed a NULL semaphore");
  27.170 -        return -1;
  27.171 -    }
  27.172 -
  27.173 -    return sem_count(&sem->sem);
  27.174 -}
  27.175 -
  27.176 -int
  27.177 -SDL_SemPost(SDL_sem * sem)
  27.178 -{
  27.179 -    if (!sem) {
  27.180 -        SDL_SetError("Passed a NULL semaphore");
  27.181 -        return -1;
  27.182 -    }
  27.183 -
  27.184 -    sem_signal(&sem->sem);
  27.185 -    return 0;
  27.186 -}
  27.187 -
  27.188 -#endif /* SDL_THREADS_DISABLED */
  27.189 -/* vi: set ts=4 sw=4 expandtab: */
    28.1 --- a/src/thread/dc/SDL_syssem_c.h	Sat Sep 19 07:09:41 2009 +0000
    28.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.3 @@ -1,23 +0,0 @@
    28.4 -/*
    28.5 -    SDL - Simple DirectMedia Layer
    28.6 -    Copyright (C) 1997-2009 Sam Lantinga
    28.7 -
    28.8 -    This library is free software; you can redistribute it and/or
    28.9 -    modify it under the terms of the GNU Lesser General Public
   28.10 -    License as published by the Free Software Foundation; either
   28.11 -    version 2.1 of the License, or (at your option) any later version.
   28.12 -
   28.13 -    This library is distributed in the hope that it will be useful,
   28.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   28.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   28.16 -    Lesser General Public License for more details.
   28.17 -
   28.18 -    You should have received a copy of the GNU Lesser General Public
   28.19 -    License along with this library; if not, write to the Free Software
   28.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   28.21 -
   28.22 -    Sam Lantinga
   28.23 -    slouken@libsdl.org
   28.24 -*/
   28.25 -#include "SDL_config.h"
   28.26 -/* vi: set ts=4 sw=4 expandtab: */
    29.1 --- a/src/thread/dc/SDL_systhread.c	Sat Sep 19 07:09:41 2009 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,61 +0,0 @@
    29.4 -/*
    29.5 -    SDL - Simple DirectMedia Layer
    29.6 -    Copyright (C) 1997-2009 Sam Lantinga
    29.7 -
    29.8 -    This library is free software; you can redistribute it and/or
    29.9 -    modify it under the terms of the GNU Lesser General Public
   29.10 -    License as published by the Free Software Foundation; either
   29.11 -    version 2.1 of the License, or (at your option) any later version.
   29.12 -
   29.13 -    This library is distributed in the hope that it will be useful,
   29.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   29.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   29.16 -    Lesser General Public License for more details.
   29.17 -
   29.18 -    You should have received a copy of the GNU Lesser General Public
   29.19 -    License along with this library; if not, write to the Free Software
   29.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   29.21 -
   29.22 -    Sam Lantinga
   29.23 -    slouken@libsdl.org
   29.24 -*/
   29.25 -#include "SDL_config.h"
   29.26 -
   29.27 -/* Thread management routines for SDL */
   29.28 -
   29.29 -#include "SDL_thread.h"
   29.30 -#include "../SDL_thread_c.h"
   29.31 -#include "../SDL_systhread.h"
   29.32 -
   29.33 -#include <kos/thread.h>
   29.34 -
   29.35 -int
   29.36 -SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
   29.37 -{
   29.38 -    thread->handle = thd_create(SDL_RunThread, args);
   29.39 -    if (thread->handle == NULL) {
   29.40 -        SDL_SetError("Not enough resources to create thread");
   29.41 -        return (-1);
   29.42 -    }
   29.43 -    return (0);
   29.44 -}
   29.45 -
   29.46 -void
   29.47 -SDL_SYS_SetupThread(void)
   29.48 -{
   29.49 -    return;
   29.50 -}
   29.51 -
   29.52 -Uint32
   29.53 -SDL_ThreadID(void)
   29.54 -{
   29.55 -    return (Uint32) thd_get_current();
   29.56 -}
   29.57 -
   29.58 -void
   29.59 -SDL_SYS_WaitThread(SDL_Thread * thread)
   29.60 -{
   29.61 -    thd_wait(thread->handle);
   29.62 -}
   29.63 -
   29.64 -/* vi: set ts=4 sw=4 expandtab: */
    30.1 --- a/src/thread/dc/SDL_systhread_c.h	Sat Sep 19 07:09:41 2009 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,25 +0,0 @@
    30.4 -/*
    30.5 -    SDL - Simple DirectMedia Layer
    30.6 -    Copyright (C) 1997-2009 Sam Lantinga
    30.7 -
    30.8 -    This library is free software; you can redistribute it and/or
    30.9 -    modify it under the terms of the GNU Library General Public
   30.10 -    License as published by the Free Software Foundation; either
   30.11 -    version 2 of the License, or (at your option) any later version.
   30.12 -
   30.13 -    This library is distributed in the hope that it will be useful,
   30.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   30.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   30.16 -    Library General Public License for more details.
   30.17 -
   30.18 -    You should have received a copy of the GNU Library General Public
   30.19 -    License along with this library; if not, write to the Free
   30.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   30.21 -
   30.22 -    Sam Lantinga
   30.23 -    slouken@libsdl.org
   30.24 -*/
   30.25 -#include "SDL_config.h"
   30.26 -
   30.27 -typedef struct kthread *SYS_ThreadHandle;
   30.28 -/* vi: set ts=4 sw=4 expandtab: */
    31.1 --- a/src/timer/dc/SDL_systimer.c	Sat Sep 19 07:09:41 2009 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,109 +0,0 @@
    31.4 -/*
    31.5 -    SDL - Simple DirectMedia Layer
    31.6 -    Copyright (C) 1997-2009 Sam Lantinga
    31.7 -
    31.8 -    This library is free software; you can redistribute it and/or
    31.9 -    modify it under the terms of the GNU Lesser General Public
   31.10 -    License as published by the Free Software Foundation; either
   31.11 -    version 2.1 of the License, or (at your option) any later version.
   31.12 -
   31.13 -    This library is distributed in the hope that it will be useful,
   31.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   31.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   31.16 -    Lesser General Public License for more details.
   31.17 -
   31.18 -    You should have received a copy of the GNU Lesser General Public
   31.19 -    License along with this library; if not, write to the Free Software
   31.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   31.21 -
   31.22 -    Sam Lantinga
   31.23 -    slouken@libsdl.org
   31.24 -*/
   31.25 -#include "SDL_config.h"
   31.26 -
   31.27 -#ifdef SDL_TIMER_DC
   31.28 -
   31.29 -#include <kos.h>
   31.30 -
   31.31 -#include "SDL_thread.h"
   31.32 -#include "SDL_timer.h"
   31.33 -#include "../SDL_timer_c.h"
   31.34 -
   31.35 -static unsigned start;
   31.36 -
   31.37 -/* 
   31.38 -	jif =  ms * HZ /1000
   31.39 -	ms  = jif * 1000/HZ
   31.40 -*/
   31.41 -
   31.42 -void
   31.43 -SDL_StartTicks(void)
   31.44 -{
   31.45 -    /* Set first ticks value */
   31.46 -    start = jiffies;
   31.47 -}
   31.48 -
   31.49 -Uint32
   31.50 -SDL_GetTicks(void)
   31.51 -{
   31.52 -    return ((jiffies - start) * 1000 / HZ);
   31.53 -}
   31.54 -
   31.55 -void
   31.56 -SDL_Delay(Uint32 ms)
   31.57 -{
   31.58 -    thd_sleep(ms);
   31.59 -}
   31.60 -
   31.61 -/* Data to handle a single periodic alarm */
   31.62 -static int timer_alive = 0;
   31.63 -static SDL_Thread *timer = NULL;
   31.64 -
   31.65 -static int
   31.66 -RunTimer(void *unused)
   31.67 -{
   31.68 -    while (timer_alive) {
   31.69 -        if (SDL_timer_running) {
   31.70 -            SDL_ThreadedTimerCheck();
   31.71 -        }
   31.72 -        SDL_Delay(10);
   31.73 -    }
   31.74 -    return (0);
   31.75 -}
   31.76 -
   31.77 -/* This is only called if the event thread is not running */
   31.78 -int
   31.79 -SDL_SYS_TimerInit(void)
   31.80 -{
   31.81 -    timer_alive = 1;
   31.82 -    timer = SDL_CreateThread(RunTimer, NULL);
   31.83 -    if (timer == NULL)
   31.84 -        return (-1);
   31.85 -    return (SDL_SetTimerThreaded(1));
   31.86 -}
   31.87 -
   31.88 -void
   31.89 -SDL_SYS_TimerQuit(void)
   31.90 -{
   31.91 -    timer_alive = 0;
   31.92 -    if (timer) {
   31.93 -        SDL_WaitThread(timer, NULL);
   31.94 -        timer = NULL;
   31.95 -    }
   31.96 -}
   31.97 -
   31.98 -int
   31.99 -SDL_SYS_StartTimer(void)
  31.100 -{
  31.101 -    SDL_SetError("Internal logic error: DC uses threaded timer");
  31.102 -    return (-1);
  31.103 -}
  31.104 -
  31.105 -void
  31.106 -SDL_SYS_StopTimer(void)
  31.107 -{
  31.108 -    return;
  31.109 -}
  31.110 -
  31.111 -#endif /* SDL_TIMER_DC */
  31.112 -/* vi: set ts=4 sw=4 expandtab: */
    32.1 --- a/src/video/SDL_sysvideo.h	Sat Sep 19 07:09:41 2009 +0000
    32.2 +++ b/src/video/SDL_sysvideo.h	Sat Sep 19 07:21:22 2009 +0000
    32.3 @@ -389,9 +389,6 @@
    32.4  #if SDL_VIDEO_DRIVER_GEM
    32.5  extern VideoBootStrap GEM_bootstrap;
    32.6  #endif
    32.7 -#if SDL_VIDEO_DRIVER_DC
    32.8 -extern VideoBootStrap DC_bootstrap;
    32.9 -#endif
   32.10  #if SDL_VIDEO_DRIVER_RISCOS
   32.11  extern VideoBootStrap RISCOS_bootstrap;
   32.12  #endif
    33.1 --- a/src/video/SDL_video.c	Sat Sep 19 07:09:41 2009 +0000
    33.2 +++ b/src/video/SDL_video.c	Sat Sep 19 07:21:22 2009 +0000
    33.3 @@ -103,9 +103,6 @@
    33.4  #if SDL_VIDEO_DRIVER_GEM
    33.5      &GEM_bootstrap,
    33.6  #endif
    33.7 -#if SDL_VIDEO_DRIVER_DC
    33.8 -    &DC_bootstrap,
    33.9 -#endif
   33.10  #if SDL_VIDEO_DRIVER_RISCOS
   33.11      &RISCOS_bootstrap,
   33.12  #endif
    34.1 --- a/src/video/dc/SDL_dcevents.c	Sat Sep 19 07:09:41 2009 +0000
    34.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.3 @@ -1,170 +0,0 @@
    34.4 -/*
    34.5 -    SDL - Simple DirectMedia Layer
    34.6 -    Copyright (C) 1997-2009 Sam Lantinga
    34.7 -
    34.8 -    This library is free software; you can redistribute it and/or
    34.9 -    modify it under the terms of the GNU Lesser General Public
   34.10 -    License as published by the Free Software Foundation; either
   34.11 -    version 2.1 of the License, or (at your option) any later version.
   34.12 -
   34.13 -    This library is distributed in the hope that it will be useful,
   34.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   34.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   34.16 -    Lesser General Public License for more details.
   34.17 -
   34.18 -    You should have received a copy of the GNU Lesser General Public
   34.19 -    License along with this library; if not, write to the Free Software
   34.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   34.21 -
   34.22 -    Sam Lantinga
   34.23 -    slouken@libsdl.org
   34.24 -*/
   34.25 -#include "SDL_config.h"
   34.26 -
   34.27 -#include "../../events/SDL_sysevents.h"
   34.28 -#include "../../events/SDL_events_c.h"
   34.29 -#include "SDL_dcvideo.h"
   34.30 -#include "SDL_dcevents_c.h"
   34.31 -
   34.32 -#include <dc/maple.h>
   34.33 -#include <dc/maple/mouse.h>
   34.34 -#include <dc/maple/keyboard.h>
   34.35 -
   34.36 -const static unsigned short sdl_key[] = {
   34.37 -    /*0 */ 0, 0, 0, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
   34.38 -    'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
   34.39 -    'u', 'v', 'w', 'x', 'y', 'z',
   34.40 -    /*1e */ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
   34.41 -    /*28 */ SDLK_RETURN, SDLK_ESCAPE, SDLK_BACKSPACE, SDLK_TAB, SDLK_SPACE,
   34.42 -    SDLK_MINUS, SDLK_PLUS, SDLK_LEFTBRACKET,
   34.43 -    SDLK_RIGHTBRACKET, SDLK_BACKSLASH, 0, SDLK_SEMICOLON, SDLK_QUOTE,
   34.44 -    /*35 */ '~', SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH, SDLK_CAPSLOCK,
   34.45 -    SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8,
   34.46 -    SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12,
   34.47 -    /*46 */ SDLK_PRINT, SDLK_SCROLLOCK, SDLK_PAUSE, SDLK_INSERT, SDLK_HOME,
   34.48 -    SDLK_PAGEUP, SDLK_DELETE, SDLK_END, SDLK_PAGEDOWN, SDLK_RIGHT,
   34.49 -    SDLK_LEFT, SDLK_DOWN, SDLK_UP,
   34.50 -    /*53 */ SDLK_NUMLOCK, SDLK_KP_DIVIDE, SDLK_KP_MULTIPLY, SDLK_KP_MINUS,
   34.51 -    SDLK_KP_PLUS, SDLK_KP_ENTER,
   34.52 -    SDLK_KP1, SDLK_KP2, SDLK_KP3, SDLK_KP4, SDLK_KP5, SDLK_KP6,
   34.53 -    /*5f */ SDLK_KP7, SDLK_KP8, SDLK_KP9, SDLK_KP0, SDLK_KP_PERIOD, 0
   34.54 -        /* S3 */
   34.55 -};
   34.56 -
   34.57 -const static unsigned short sdl_shift[] = {
   34.58 -    SDLK_LCTRL, SDLK_LSHIFT, SDLK_LALT, 0 /* S1 */ ,
   34.59 -    SDLK_RCTRL, SDLK_RSHIFT, SDLK_RALT, 0 /* S2 */ ,
   34.60 -};
   34.61 -
   34.62 -#define	MOUSE_WHEELUP 	(1<<4)
   34.63 -#define	MOUSE_WHEELDOWN	(1<<5)
   34.64 -
   34.65 -static void
   34.66 -mouse_update(void)
   34.67 -{
   34.68 -    const static char sdl_mousebtn[] = {
   34.69 -        MOUSE_LEFTBUTTON,
   34.70 -        MOUSE_RIGHTBUTTON,
   34.71 -        MOUSE_SIDEBUTTON,
   34.72 -        MOUSE_WHEELUP,
   34.73 -        MOUSE_WHEELDOWN
   34.74 -    };
   34.75 -
   34.76 -    uint8 addr;
   34.77 -    mouse_cond_t cond;
   34.78 -
   34.79 -    static int prev_buttons;
   34.80 -    int buttons, changed;
   34.81 -    int i;
   34.82 -
   34.83 -    if ((addr = maple_first_mouse()) == 0 || mouse_get_cond(addr, &cond) < 0)
   34.84 -        return;
   34.85 -
   34.86 -    buttons = cond.buttons ^ 0xff;
   34.87 -    if (cond.dz < 0)
   34.88 -        buttons |= MOUSE_WHEELUP;
   34.89 -    if (cond.dz > 0)
   34.90 -        buttons |= MOUSE_WHEELDOWN;
   34.91 -
   34.92 -    if (cond.dx || cond.dy)
   34.93 -        SDL_PrivateMouseMotion(0, 1, cond.dx, cond.dy);
   34.94 -
   34.95 -    changed = buttons ^ prev_buttons;
   34.96 -    for (i = 0; i < sizeof(sdl_mousebtn); i++) {
   34.97 -        if (changed & sdl_mousebtn[i]) {
   34.98 -            SDL_PrivateMouseButton((buttons & sdl_mousebtn[i]) ?
   34.99 -                                   SDL_PRESSED : SDL_RELEASED, i, 0, 0);
  34.100 -        }
  34.101 -    }
  34.102 -    prev_buttons = buttons;
  34.103 -}
  34.104 -
  34.105 -static void
  34.106 -keyboard_update(void)
  34.107 -{
  34.108 -    static kbd_state_t old_state;
  34.109 -    static uint8 old_addr;
  34.110 -
  34.111 -    kbd_state_t *state;
  34.112 -    uint8 addr;
  34.113 -    int port, unit;
  34.114 -
  34.115 -    int shiftkeys;
  34.116 -    SDL_keysym keysym;
  34.117 -
  34.118 -    int i;
  34.119 -
  34.120 -    addr = maple_first_kb();
  34.121 -
  34.122 -    if (addr == 0)
  34.123 -        return;
  34.124 -
  34.125 -    if (addr != old_addr) {
  34.126 -        old_addr = addr;
  34.127 -        SDL_memset(&old_state, 0, sizeof(old_state));
  34.128 -    }
  34.129 -
  34.130 -    maple_raddr(addr, &port, &unit);
  34.131 -
  34.132 -    state = maple_dev_state(port, unit);
  34.133 -    if (!state)
  34.134 -        return;
  34.135 -
  34.136 -    shiftkeys = state->shift_keys ^ old_state.shift_keys;
  34.137 -    for (i = 0; i < sizeof(sdl_shift); i++) {
  34.138 -        if ((shiftkeys >> i) & 1) {
  34.139 -            keysym.sym = sdl_shift[i];
  34.140 -            SDL_PrivateKeyboard(((state->shift_keys >> i) & 1) ? SDL_PRESSED :
  34.141 -                                SDL_RELEASED, &keysym);
  34.142 -        }
  34.143 -    }
  34.144 -
  34.145 -    for (i = 0; i < sizeof(sdl_key); i++) {
  34.146 -        if (state->matrix[i] != old_state.matrix[i]) {
  34.147 -            int key = sdl_key[i];
  34.148 -            if (key) {
  34.149 -                keysym.sym = key;
  34.150 -                SDL_PrivateKeyboard(state->matrix[i] ? SDL_PRESSED :
  34.151 -                                    SDL_RELEASED, &keysym);
  34.152 -            }
  34.153 -        }
  34.154 -    }
  34.155 -
  34.156 -    old_state = *state;
  34.157 -}
  34.158 -
  34.159 -void
  34.160 -DC_PumpEvents(_THIS)
  34.161 -{
  34.162 -    keyboard_update();
  34.163 -    mouse_update();
  34.164 -}
  34.165 -
  34.166 -void
  34.167 -DC_InitOSKeymap(_THIS)
  34.168 -{
  34.169 -    /* do nothing. */
  34.170 -}
  34.171 -
  34.172 -/* end of SDL_dcevents.c ... */
  34.173 -/* vi: set ts=4 sw=4 expandtab: */
    35.1 --- a/src/video/dc/SDL_dcevents_c.h	Sat Sep 19 07:09:41 2009 +0000
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,33 +0,0 @@
    35.4 -/*
    35.5 -    SDL - Simple DirectMedia Layer
    35.6 -    Copyright (C) 1997-2009 Sam Lantinga
    35.7 -
    35.8 -    This library is free software; you can redistribute it and/or
    35.9 -    modify it under the terms of the GNU Lesser General Public
   35.10 -    License as published by the Free Software Foundation; either
   35.11 -    version 2.1 of the License, or (at your option) any later version.
   35.12 -
   35.13 -    This library is distributed in the hope that it will be useful,
   35.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   35.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   35.16 -    Lesser General Public License for more details.
   35.17 -
   35.18 -    You should have received a copy of the GNU Lesser General Public
   35.19 -    License along with this library; if not, write to the Free Software
   35.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   35.21 -
   35.22 -    Sam Lantinga
   35.23 -    slouken@libsdl.org
   35.24 -*/
   35.25 -#include "SDL_config.h"
   35.26 -
   35.27 -#include "SDL_dcvideo.h"
   35.28 -
   35.29 -/* Variables and functions exported by SDL_sysevents.c to other parts 
   35.30 -   of the native video subsystem (SDL_sysvideo.c)
   35.31 -*/
   35.32 -extern void DC_InitOSKeymap(_THIS);
   35.33 -extern void DC_PumpEvents(_THIS);
   35.34 -
   35.35 -/* end of SDL_dcevents_c.h ... */
   35.36 -/* vi: set ts=4 sw=4 expandtab: */
    36.1 --- a/src/video/dc/SDL_dcmouse.c	Sat Sep 19 07:09:41 2009 +0000
    36.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.3 @@ -1,37 +0,0 @@
    36.4 -/*
    36.5 -    SDL - Simple DirectMedia Layer
    36.6 -    Copyright (C) 1997-2009 Sam Lantinga
    36.7 -
    36.8 -    This library is free software; you can redistribute it and/or
    36.9 -    modify it under the terms of the GNU Lesser General Public
   36.10 -    License as published by the Free Software Foundation; either
   36.11 -    version 2.1 of the License, or (at your option) any later version.
   36.12 -
   36.13 -    This library is distributed in the hope that it will be useful,
   36.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   36.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   36.16 -    Lesser General Public License for more details.
   36.17 -
   36.18 -    You should have received a copy of the GNU Lesser General Public
   36.19 -    License along with this library; if not, write to the Free Software
   36.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   36.21 -
   36.22 -    Sam Lantinga
   36.23 -    slouken@libsdl.org
   36.24 -*/
   36.25 -#include "SDL_config.h"
   36.26 -
   36.27 -#include <stdio.h>
   36.28 -
   36.29 -#include "SDL_mouse.h"
   36.30 -#include "../../events/SDL_events_c.h"
   36.31 -
   36.32 -#include "SDL_dcmouse_c.h"
   36.33 -
   36.34 -
   36.35 -/* The implementation dependent data for the window manager cursor */
   36.36 -struct WMcursor
   36.37 -{
   36.38 -    int unused;
   36.39 -};
   36.40 -/* vi: set ts=4 sw=4 expandtab: */
    37.1 --- a/src/video/dc/SDL_dcmouse_c.h	Sat Sep 19 07:09:41 2009 +0000
    37.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.3 @@ -1,27 +0,0 @@
    37.4 -/*
    37.5 -    SDL - Simple DirectMedia Layer
    37.6 -    Copyright (C) 1997-2009 Sam Lantinga
    37.7 -
    37.8 -    This library is free software; you can redistribute it and/or
    37.9 -    modify it under the terms of the GNU Lesser General Public
   37.10 -    License as published by the Free Software Foundation; either
   37.11 -    version 2.1 of the License, or (at your option) any later version.
   37.12 -
   37.13 -    This library is distributed in the hope that it will be useful,
   37.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   37.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   37.16 -    Lesser General Public License for more details.
   37.17 -
   37.18 -    You should have received a copy of the GNU Lesser General Public
   37.19 -    License along with this library; if not, write to the Free Software
   37.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   37.21 -
   37.22 -    Sam Lantinga
   37.23 -    slouken@libsdl.org
   37.24 -*/
   37.25 -#include "SDL_config.h"
   37.26 -
   37.27 -#include "SDL_dcvideo.h"
   37.28 -
   37.29 -/* Functions to be exported */
   37.30 -/* vi: set ts=4 sw=4 expandtab: */
    38.1 --- a/src/video/dc/SDL_dcvideo.c	Sat Sep 19 07:09:41 2009 +0000
    38.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.3 @@ -1,479 +0,0 @@
    38.4 -/*
    38.5 -    SDL - Simple DirectMedia Layer
    38.6 -    Copyright (C) 1997-2009 Sam Lantinga
    38.7 -
    38.8 -    This library is free software; you can redistribute it and/or
    38.9 -    modify it under the terms of the GNU Lesser General Public
   38.10 -    License as published by the Free Software Foundation; either
   38.11 -    version 2.1 of the License, or (at your option) any later version.
   38.12 -
   38.13 -    This library is distributed in the hope that it will be useful,
   38.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   38.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   38.16 -    Lesser General Public License for more details.
   38.17 -
   38.18 -    You should have received a copy of the GNU Lesser General Public
   38.19 -    License along with this library; if not, write to the Free Software
   38.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   38.21 -
   38.22 -    Sam Lantinga
   38.23 -    slouken@libsdl.org
   38.24 -*/
   38.25 -#include "SDL_config.h"
   38.26 -
   38.27 -#include "SDL_video.h"
   38.28 -#include "SDL_mouse.h"
   38.29 -#include "../SDL_sysvideo.h"
   38.30 -#include "../SDL_pixels_c.h"
   38.31 -#include "../../events/SDL_events_c.h"
   38.32 -
   38.33 -#include "SDL_dcvideo.h"
   38.34 -#include "SDL_dcevents_c.h"
   38.35 -#include "SDL_dcmouse_c.h"
   38.36 -
   38.37 -#include <dc/video.h>
   38.38 -#include <dc/pvr.h>
   38.39 -
   38.40 -
   38.41 -/* Initialization/Query functions */
   38.42 -static int DC_VideoInit(_THIS, SDL_PixelFormat * vformat);
   38.43 -static SDL_Rect **DC_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags);
   38.44 -static SDL_Surface *DC_SetVideoMode(_THIS, SDL_Surface * current, int width,
   38.45 -                                    int height, int bpp, Uint32 flags);
   38.46 -static int DC_SetColors(_THIS, int firstcolor, int ncolors,
   38.47 -                        SDL_Color * colors);
   38.48 -static void DC_VideoQuit(_THIS);
   38.49 -
   38.50 -/* Hardware surface functions */
   38.51 -static int DC_AllocHWSurface(_THIS, SDL_Surface * surface);
   38.52 -static int DC_LockHWSurface(_THIS, SDL_Surface * surface);
   38.53 -static void DC_UnlockHWSurface(_THIS, SDL_Surface * surface);
   38.54 -static void DC_FreeHWSurface(_THIS, SDL_Surface * surface);
   38.55 -static int DC_FlipHWSurface(_THIS, SDL_Surface * surface);
   38.56 -
   38.57 -/* etc. */
   38.58 -static void DC_UpdateRects(_THIS, int numrects, SDL_Rect * rects);
   38.59 -
   38.60 -/* OpenGL */
   38.61 -#if SDL_VIDEO_OPENGL
   38.62 -static void *DC_GL_GetProcAddress(_THIS, const char *proc);
   38.63 -static int DC_GL_LoadLibrary(_THIS, const char *path);
   38.64 -static int DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
   38.65 -static void DC_GL_SwapBuffers(_THIS);
   38.66 -#endif
   38.67 -
   38.68 -/* DC driver bootstrap functions */
   38.69 -
   38.70 -static int
   38.71 -DC_Available(void)
   38.72 -{
   38.73 -    return 1;
   38.74 -}
   38.75 -
   38.76 -static void
   38.77 -DC_DeleteDevice(SDL_VideoDevice * device)
   38.78 -{
   38.79 -    SDL_free(device->hidden);
   38.80 -    SDL_free(device);
   38.81 -}
   38.82 -
   38.83 -static SDL_VideoDevice *
   38.84 -DC_CreateDevice(int devindex)
   38.85 -{
   38.86 -    SDL_VideoDevice *device;
   38.87 -
   38.88 -    /* Initialize all variables that we clean on shutdown */
   38.89 -    device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
   38.90 -    if (device) {
   38.91 -        SDL_memset(device, 0, (sizeof *device));
   38.92 -        device->hidden = (struct SDL_PrivateVideoData *)
   38.93 -            SDL_malloc((sizeof *device->hidden));
   38.94 -    }
   38.95 -    if ((device == NULL) || (device->hidden == NULL)) {
   38.96 -        SDL_OutOfMemory();
   38.97 -        if (device) {
   38.98 -            SDL_free(device);
   38.99 -        }
  38.100 -        return (0);
  38.101 -    }
  38.102 -    SDL_memset(device->hidden, 0, (sizeof *device->hidden));
  38.103 -
  38.104 -    /* Set the function pointers */
  38.105 -    device->VideoInit = DC_VideoInit;
  38.106 -    device->ListModes = DC_ListModes;
  38.107 -    device->SetVideoMode = DC_SetVideoMode;
  38.108 -    device->CreateYUVOverlay = NULL;
  38.109 -    device->SetColors = DC_SetColors;
  38.110 -    device->UpdateRects = DC_UpdateRects;
  38.111 -    device->VideoQuit = DC_VideoQuit;
  38.112 -    device->AllocHWSurface = DC_AllocHWSurface;
  38.113 -    device->CheckHWBlit = NULL;
  38.114 -    device->FillHWRect = NULL;
  38.115 -    device->SetHWColorKey = NULL;
  38.116 -    device->SetHWAlpha = NULL;
  38.117 -    device->LockHWSurface = DC_LockHWSurface;
  38.118 -    device->UnlockHWSurface = DC_UnlockHWSurface;
  38.119 -    device->FlipHWSurface = DC_FlipHWSurface;
  38.120 -    device->FreeHWSurface = DC_FreeHWSurface;
  38.121 -#if SDL_VIDEO_OPENGL
  38.122 -    device->GL_LoadLibrary = DC_GL_LoadLibrary;
  38.123 -    device->GL_GetProcAddress = DC_GL_GetProcAddress;
  38.124 -    device->GL_GetAttribute = DC_GL_GetAttribute;
  38.125 -    device->GL_MakeCurrent = NULL;
  38.126 -    device->GL_SwapBuffers = DC_GL_SwapBuffers;
  38.127 -#endif
  38.128 -    device->SetCaption = NULL;
  38.129 -    device->SetIcon = NULL;
  38.130 -    device->IconifyWindow = NULL;
  38.131 -    device->GrabInput = NULL;
  38.132 -    device->GetWMInfo = NULL;
  38.133 -    device->InitOSKeymap = DC_InitOSKeymap;
  38.134 -    device->PumpEvents = DC_PumpEvents;
  38.135 -
  38.136 -    device->free = DC_DeleteDevice;
  38.137 -
  38.138 -    return device;
  38.139 -}
  38.140 -
  38.141 -VideoBootStrap DC_bootstrap = {
  38.142 -    "dcvideo", "Dreamcast Video",
  38.143 -    DC_Available, DC_CreateDevice
  38.144 -};
  38.145 -
  38.146 -
  38.147 -int
  38.148 -DC_VideoInit(_THIS, SDL_PixelFormat * vformat)
  38.149 -{
  38.150 -    /* Determine the screen depth (use default 16-bit depth) */
  38.151 -    /* we change this during the SDL_SetVideoMode implementation... */
  38.152 -    vformat->BitsPerPixel = 16;
  38.153 -    vformat->Rmask = 0x0000f800;
  38.154 -    vformat->Gmask = 0x000007e0;
  38.155 -    vformat->Bmask = 0x0000001f;
  38.156 -
  38.157 -    /* We're done! */
  38.158 -    return (0);
  38.159 -}
  38.160 -
  38.161 -const static SDL_Rect RECT_800x600 = { 0, 0, 800, 600 }, RECT_640x480 = {
  38.162 -0, 0, 640, 480}, RECT_320x240 = {
  38.163 -0, 0, 320, 240};
  38.164 -
  38.165 -const static SDL_Rect *vid_modes[] = {
  38.166 -    &RECT_800x600,
  38.167 -    &RECT_640x480,
  38.168 -    &RECT_320x240,
  38.169 -    NULL
  38.170 -};
  38.171 -
  38.172 -SDL_Rect **
  38.173 -DC_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
  38.174 -{
  38.175 -    switch (format->BitsPerPixel) {
  38.176 -    case 15:
  38.177 -    case 16:
  38.178 -        return &vid_modes;
  38.179 -    case 32:
  38.180 -        if (!(flags & SDL_INTERNALOPENGL))
  38.181 -            return &vid_modes;
  38.182 -    default:
  38.183 -        return NULL;
  38.184 -    }
  38.185 -//      return (SDL_Rect **) -1;
  38.186 -}
  38.187 -
  38.188 -pvr_init_params_t params = {
  38.189 -    /* Enable opaque and translucent polygons with size 16 */
  38.190 -    {PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0,
  38.191 -     PVR_BINSIZE_16}
  38.192 -    ,
  38.193 -
  38.194 -    /* Vertex buffer size */
  38.195 -    512 * 1024
  38.196 -};
  38.197 -
  38.198 -#if SDL_VIDEO_OPENGL
  38.199 -static int pvr_inited;
  38.200 -#endif
  38.201 -
  38.202 -SDL_Surface *
  38.203 -DC_SetVideoMode(_THIS, SDL_Surface * current,
  38.204 -                int width, int height, int bpp, Uint32 flags)
  38.205 -{
  38.206 -    int disp_mode, pixel_mode, pitch;
  38.207 -    Uint32 Rmask, Gmask, Bmask;
  38.208 -
  38.209 -    if (width == 320 && height == 240)
  38.210 -        disp_mode = DM_320x240;
  38.211 -    else if (width == 640 && height == 480)
  38.212 -        disp_mode = DM_640x480;
  38.213 -    else if (width == 800 && height == 600)
  38.214 -        disp_mode = DM_800x608;
  38.215 -    else {
  38.216 -        SDL_SetError("Couldn't find requested mode in list");
  38.217 -        return (NULL);
  38.218 -    }
  38.219 -
  38.220 -    switch (bpp) {
  38.221 -    case 15:
  38.222 -        pixel_mode = PM_RGB555;
  38.223 -        pitch = width * 2;
  38.224 -        /* 5-5-5 */
  38.225 -        Rmask = 0x00007c00;
  38.226 -        Gmask = 0x000003e0;
  38.227 -        Bmask = 0x0000001f;
  38.228 -        break;
  38.229 -    case 16:
  38.230 -        pixel_mode = PM_RGB565;
  38.231 -        pitch = width * 2;
  38.232 -        /* 5-6-5 */
  38.233 -        Rmask = 0x0000f800;
  38.234 -        Gmask = 0x000007e0;
  38.235 -        Bmask = 0x0000001f;
  38.236 -        break;
  38.237 -    case 24:
  38.238 -        bpp = 32;
  38.239 -    case 32:
  38.240 -        pixel_mode = PM_RGB888;
  38.241 -        pitch = width * 4;
  38.242 -        Rmask = 0x00ff0000;
  38.243 -        Gmask = 0x0000ff00;
  38.244 -        Bmask = 0x000000ff;
  38.245 -#if SDL_VIDEO_OPENGL
  38.246 -        if (!(flags & SDL_INTERNALOPENGL))
  38.247 -#endif
  38.248 -            break;
  38.249 -    default:
  38.250 -        SDL_SetError("Couldn't find requested mode in list");
  38.251 -        return (NULL);
  38.252 -    }
  38.253 -
  38.254 -//  if ( bpp != current->format->BitsPerPixel ) {
  38.255 -    if (!SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0)) {
  38.256 -        return (NULL);
  38.257 -    }
  38.258 -//  }
  38.259 -
  38.260 -    /* Set up the new mode framebuffer */
  38.261 -    current->flags = (SDL_FULLSCREEN | SDL_HWSURFACE);
  38.262 -    current->w = width;
  38.263 -    current->h = height;
  38.264 -    current->pitch = pitch;
  38.265 -
  38.266 -#if SDL_VIDEO_OPENGL
  38.267 -    if (pvr_inited) {
  38.268 -        pvr_inited = 0;
  38.269 -        pvr_shutdown();
  38.270 -    }
  38.271 -#endif
  38.272 -
  38.273 -    vid_set_mode(disp_mode, pixel_mode);
  38.274 -
  38.275 -    current->pixels = vram_s;
  38.276 -
  38.277 -#if SDL_VIDEO_OPENGL
  38.278 -    if (flags & SDL_INTERNALOPENGL) {
  38.279 -        this->gl_config.driver_loaded = 1;
  38.280 -        current->flags = SDL_FULLSCREEN | SDL_INTERNALOPENGL;
  38.281 -        current->pixels = NULL;
  38.282 -        pvr_inited = 1;
  38.283 -        pvr_init(&params);
  38.284 -        glKosInit();
  38.285 -        glKosBeginFrame();
  38.286 -    } else
  38.287 -#endif
  38.288 -    if (flags | SDL_DOUBLEBUF) {
  38.289 -        current->flags |= SDL_DOUBLEBUF;
  38.290 -        current->pixels = (void *) ((int) current->pixels | 0x400000);
  38.291 -    }
  38.292 -
  38.293 -    /* We're done */
  38.294 -    return (current);
  38.295 -}
  38.296 -
  38.297 -/* We don't actually allow hardware surfaces other than the main one */
  38.298 -static int
  38.299 -DC_AllocHWSurface(_THIS, SDL_Surface * surface)
  38.300 -{
  38.301 -    return (-1);
  38.302 -}
  38.303 -
  38.304 -static void
  38.305 -DC_FreeHWSurface(_THIS, SDL_Surface * surface)
  38.306 -{
  38.307 -    return;
  38.308 -}
  38.309 -
  38.310 -/* We need to wait for vertical retrace on page flipped displays */
  38.311 -static int
  38.312 -DC_LockHWSurface(_THIS, SDL_Surface * surface)
  38.313 -{
  38.314 -    return (0);
  38.315 -}
  38.316 -
  38.317 -static void
  38.318 -DC_UnlockHWSurface(_THIS, SDL_Surface * surface)
  38.319 -{
  38.320 -    return;
  38.321 -}
  38.322 -
  38.323 -static int
  38.324 -DC_FlipHWSurface(_THIS, SDL_Surface * surface)
  38.325 -{
  38.326 -    if (surface->flags & SDL_DOUBLEBUF) {
  38.327 -        vid_set_start((int) surface->pixels & 0xffffff);
  38.328 -        surface->pixels = (void *) ((int) surface->pixels ^ 0x400000);
  38.329 -    }
  38.330 -    return (0);
  38.331 -}
  38.332 -
  38.333 -static void
  38.334 -DC_UpdateRects(_THIS, int numrects, SDL_Rect * rects)
  38.335 -{
  38.336 -    /* do nothing. */
  38.337 -}
  38.338 -
  38.339 -static int
  38.340 -DC_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color * colors)
  38.341 -{
  38.342 -    /* do nothing of note. */
  38.343 -    return (1);
  38.344 -}
  38.345 -
  38.346 -/* Note:  If we are terminated, this could be called in the middle of
  38.347 -   another SDL video routine -- notably UpdateRects.
  38.348 -*/
  38.349 -static void
  38.350 -DC_VideoQuit(_THIS)
  38.351 -{
  38.352 -#if SDL_VIDEO_OPENGL
  38.353 -    if (pvr_inited) {
  38.354 -        pvr_inited = 0;
  38.355 -        pvr_shutdown();
  38.356 -    }
  38.357 -#endif
  38.358 -}
  38.359 -
  38.360 -#if SDL_VIDEO_OPENGL
  38.361 -
  38.362 -void
  38.363 -dmyfunc(void)
  38.364 -{
  38.365 -}
  38.366 -
  38.367 -typedef void (*funcptr) ();
  38.368 -const static struct
  38.369 -{
  38.370 -    char *name;
  38.371 -    funcptr addr;
  38.372 -} glfuncs[] = {
  38.373 -#define	DEF(func)	{#func,&func}
  38.374 -    DEF(glBegin), DEF(glBindTexture), DEF(glBlendFunc), DEF(glColor4f),
  38.375 -//      DEF(glCopyImageID),
  38.376 -        DEF(glDisable),
  38.377 -        DEF(glEnable),
  38.378 -        DEF(glEnd),
  38.379 -        DEF(glFlush),
  38.380 -        DEF(glGenTextures),
  38.381 -        DEF(glGetString),
  38.382 -        DEF(glLoadIdentity),
  38.383 -        DEF(glMatrixMode), DEF(glOrtho), DEF(glPixelStorei),
  38.384 -//      DEF(glPopAttrib),
  38.385 -//      DEF(glPopClientAttrib),
  38.386 -    {
  38.387 -    "glPopAttrib", &dmyfunc}, {
  38.388 -    "glPopClientAttrib", &dmyfunc}, DEF(glPopMatrix),
  38.389 -//      DEF(glPushAttrib),
  38.390 -//      DEF(glPushClientAttrib),
  38.391 -    {
  38.392 -    "glPushAttrib", &dmyfunc}, {
  38.393 -    "glPushClientAttrib", &dmyfunc},
  38.394 -        DEF(glPushMatrix),
  38.395 -        DEF(glTexCoord2f),
  38.396 -        DEF(glTexEnvf),
  38.397 -        DEF(glTexImage2D),
  38.398 -        DEF(glTexParameteri),
  38.399 -        DEF(glTexSubImage2D), DEF(glVertex2i), DEF(glViewport),
  38.400 -#undef	DEF
  38.401 -};
  38.402 -
  38.403 -static void *
  38.404 -DC_GL_GetProcAddress(_THIS, const char *proc)
  38.405 -{
  38.406 -    void *ret;
  38.407 -    int i;
  38.408 -
  38.409 -    ret = glKosGetProcAddress(proc);
  38.410 -    if (ret)
  38.411 -        return ret;
  38.412 -
  38.413 -    for (i = 0; i < sizeof(glfuncs) / sizeof(glfuncs[0]); i++) {
  38.414 -        if (SDL_strcmp(proc, glfuncs[i].name) == 0)
  38.415 -            return glfuncs[i].addr;
  38.416 -    }
  38.417 -
  38.418 -    return NULL;
  38.419 -}
  38.420 -
  38.421 -static int
  38.422 -DC_GL_LoadLibrary(_THIS, const char *path)
  38.423 -{
  38.424 -    this->gl_config.driver_loaded = 1;
  38.425 -
  38.426 -    return 0;
  38.427 -}
  38.428 -
  38.429 -static int
  38.430 -DC_GL_GetAttribute(_THIS, SDL_GLattr attrib, int *value)
  38.431 -{
  38.432 -    GLenum mesa_attrib;
  38.433 -    int val;
  38.434 -
  38.435 -    switch (attrib) {
  38.436 -    case SDL_GL_RED_SIZE:
  38.437 -        val = 5;
  38.438 -        break;
  38.439 -    case SDL_GL_GREEN_SIZE:
  38.440 -        val = 6;
  38.441 -        break;
  38.442 -    case SDL_GL_BLUE_SIZE:
  38.443 -        val = 5;
  38.444 -        break;
  38.445 -    case SDL_GL_ALPHA_SIZE:
  38.446 -        val = 0;
  38.447 -        break;
  38.448 -    case SDL_GL_DOUBLEBUFFER:
  38.449 -        val = 1;
  38.450 -        break;
  38.451 -    case SDL_GL_DEPTH_SIZE:
  38.452 -        val = 16;               /* or 32? */
  38.453 -        break;
  38.454 -    case SDL_GL_STENCIL_SIZE:
  38.455 -        val = 0;
  38.456 -        break;
  38.457 -    case SDL_GL_ACCUM_RED_SIZE:
  38.458 -        val = 0;
  38.459 -        break;
  38.460 -    case SDL_GL_ACCUM_GREEN_SIZE:
  38.461 -        val = 0;
  38.462 -    case SDL_GL_ACCUM_BLUE_SIZE:
  38.463 -        val = 0;
  38.464 -        break;
  38.465 -    case SDL_GL_ACCUM_ALPHA_SIZE:
  38.466 -        val = 0;
  38.467 -        break;
  38.468 -    default:
  38.469 -        return -1;
  38.470 -    }
  38.471 -    *value = val;
  38.472 -    return 0;
  38.473 -}
  38.474 -
  38.475 -static void
  38.476 -DC_GL_SwapBuffers(_THIS)
  38.477 -{
  38.478 -    glKosFinishFrame();
  38.479 -    glKosBeginFrame();
  38.480 -}
  38.481 -#endif
  38.482 -/* vi: set ts=4 sw=4 expandtab: */
    39.1 --- a/src/video/dc/SDL_dcvideo.h	Sat Sep 19 07:09:41 2009 +0000
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,44 +0,0 @@
    39.4 -/*
    39.5 -    SDL - Simple DirectMedia Layer
    39.6 -    Copyright (C) 1997-2009 Sam Lantinga
    39.7 -
    39.8 -    This library is free software; you can redistribute it and/or
    39.9 -    modify it under the terms of the GNU Lesser General Public
   39.10 -    License as published by the Free Software Foundation; either
   39.11 -    version 2.1 of the License, or (at your option) any later version.
   39.12 -
   39.13 -    This library is distributed in the hope that it will be useful,
   39.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
   39.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   39.16 -    Lesser General Public License for more details.
   39.17 -
   39.18 -    You should have received a copy of the GNU Lesser General Public
   39.19 -    License along with this library; if not, write to the Free Software
   39.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   39.21 -
   39.22 -    Sam Lantinga
   39.23 -    slouken@libsdl.org
   39.24 -*/
   39.25 -#include "SDL_config.h"
   39.26 -
   39.27 -#ifndef _SDL_dcvideo_h
   39.28 -#define _SDL_dcvideo_h
   39.29 -
   39.30 -#include "SDL_mouse.h"
   39.31 -#include "SDL_mutex.h"
   39.32 -#include "../SDL_sysvideo.h"
   39.33 -
   39.34 -/* Hidden "this" pointer for the video functions */
   39.35 -#define _THIS	SDL_VideoDevice *this
   39.36 -
   39.37 -
   39.38 -/* Private display data */
   39.39 -
   39.40 -struct SDL_PrivateVideoData
   39.41 -{
   39.42 -    int w, h;
   39.43 -    void *buffer;
   39.44 -};
   39.45 -
   39.46 -#endif /* _SDL_dcvideo_h */
   39.47 -/* vi: set ts=4 sw=4 expandtab: */