Commit 232c7472 authored by Sam Lantinga's avatar Sam Lantinga

Removed outdated Dreamcast support

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403813
parent 6ecdaa1f
#GL=1
CC = sh-elf-gcc
AR = sh-elf-ar
ifdef GL
DEFS += -DSDL_VIDEO_OPENGL=1
TARGET = libSDL_gl.a
else
TARGET = libSDL.a
endif
CFLAGS=$(KOS_CFLAGS) $(DEFS) -Iinclude
SRCS = \
src/audio/dc/SDL_dcaudio.c \
src/audio/dc/aica.c \
src/audio/dummy/SDL_dummyaudio.c \
src/audio/SDL_audio.c \
src/audio/SDL_audiocvt.c \
src/audio/SDL_audiodev.c \
src/audio/SDL_mixer.c \
src/audio/SDL_wave.c \
src/cdrom/dc/SDL_syscdrom.c \
src/cdrom/SDL_cdrom.c \
src/events/SDL_active.c \
src/events/SDL_events.c \
src/events/SDL_expose.c \
src/events/SDL_keyboard.c \
src/events/SDL_mouse.c \
src/events/SDL_quit.c \
src/events/SDL_resize.c \
src/file/SDL_rwops.c \
src/power/SDL_power.c \
src/joystick/dc/SDL_sysjoystick.c \
src/joystick/SDL_joystick.c \
src/loadso/dummy/SDL_sysloadso.c \
src/SDL.c \
src/SDL_error.c \
src/SDL_fatal.c \
src/stdlib/SDL_getenv.c \
src/stdlib/SDL_iconv.c \
src/stdlib/SDL_malloc.c \
src/stdlib/SDL_qsort.c \
src/stdlib/SDL_stdlib.c \
src/stdlib/SDL_string.c \
src/thread/dc/SDL_syscond.c \
src/thread/dc/SDL_sysmutex.c \
src/thread/dc/SDL_syssem.c \
src/thread/dc/SDL_systhread.c \
src/thread/SDL_thread.c \
src/timer/dc/SDL_systimer.c \
src/timer/SDL_timer.c \
src/video/dc/SDL_dcevents.c \
src/video/dc/SDL_dcvideo.c \
src/video/dummy/SDL_nullevents.c \
src/video/dummy/SDL_nullmouse.c \
src/video/dummy/SDL_nullvideo.c \
src/video/glsdl/SDL_glsdl.c \
src/video/SDL_blit.c \
src/video/SDL_blit_0.c \
src/video/SDL_blit_1.c \
src/video/SDL_blit_A.c \
src/video/SDL_blit_N.c \
src/video/SDL_bmp.c \
src/video/SDL_cursor.c \
src/video/SDL_gamma.c \
src/video/SDL_pixels.c \
src/video/SDL_RLEaccel.c \
src/video/SDL_stretch.c \
src/video/SDL_surface.c \
src/video/SDL_video.c \
src/video/SDL_yuv.c \
src/video/SDL_yuv_sw.c \
OBJS = $(SRCS:.c=.o)
TEST = \
test/checkkeys.c \
test/graywin.c \
test/loopwave.c \
test/testalpha.c \
test/testbitmap.c \
test/testcdrom.c \
test/testerror.c \
test/testgamma.c \
test/testgl.c \
test/testhread.c \
test/testjoystick.c \
test/testkeys.c \
test/testlock.c \
test/testoverlay.c \
test/testpalette.c \
test/testsem.c \
test/testsprite.c \
test/testtimer.c \
test/testtypes.c \
test/testver.c \
test/testvidinfo.c \
test/testwin.c \
test/testwm.c \
test/threadwin.c \
test/torturethread.c \
$(TARGET): copy_config \
$(OBJS)
$(AR) rcs $(TARGET) $(OBJS)
copy_config:
@cp include/SDL_config.h.default include/SDL_config.h
clean:
rm -f include/SDL_config.h $(OBJS)
...@@ -45,7 +45,7 @@ SPU_GCC = @SPU_GCC@ ...@@ -45,7 +45,7 @@ SPU_GCC = @SPU_GCC@
EMBEDSPU = @EMBEDSPU@ EMBEDSPU = @EMBEDSPU@
#include $(srcdir)/src/video/ps3/spulibs/Makefile #include $(srcdir)/src/video/ps3/spulibs/Makefile
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 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
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 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
......
...@@ -14,8 +14,8 @@ and 2D framebuffer across multiple platforms. ...@@ -14,8 +14,8 @@ and 2D framebuffer across multiple platforms.
The current version supports Linux, Windows, Windows CE, BeOS, MacOS, The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, The code contains support for Atari, AIX, OSF/Tru64, RISC OS, and
RISC OS, SymbianOS, but these are not officially supported. SymbianOS, but these are not officially supported.
SDL is written in C, but works with C++ natively, and has bindings to SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
......
SDL for Dreamcast (beta2)
BERO
berobero@users.sourceforge.net
http://www.geocities.co.jp/Playtown/2004/
this work with kos-newlib
http://sourceforge.net/projects/dcquake/
compile
- source environ.sh (from the KOS distribution)
- make -f Makefile.dc
compile with gl support
- install latest libgl from http://sourceforge.net/projects/dcquake/
- uncomment GL=1 in Makefile.dc
- make -f Makefile.dc clean
- make -f Makefile.dc
install
- copy include/*.h and libSDL.a or libSDL_gl.a for your enviroment
changelog:
beta2
- OpenGL support
- Hardware page flip support
beta
- thread, timer don't tested so much.
- not support OpenGL
...@@ -1518,10 +1518,8 @@ DEP_CPP_SDL_W=\ ...@@ -1518,10 +1518,8 @@ DEP_CPP_SDL_W=\
{$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
{$(INCLUDE)}"..\..\include\SDL_config.h"\ {$(INCLUDE)}"..\..\include\SDL_config.h"\
{$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\ {$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\
{$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\
{$(INCLUDE)}"..\..\include\SDL_config_macos.h"\ {$(INCLUDE)}"..\..\include\SDL_config_macos.h"\
{$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\ {$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\
{$(INCLUDE)}"..\..\include\SDL_config_os2.h"\
{$(INCLUDE)}"..\..\include\SDL_config_win32.h"\ {$(INCLUDE)}"..\..\include\SDL_config_win32.h"\
{$(INCLUDE)}"..\..\include\SDL_config_wince.h"\ {$(INCLUDE)}"..\..\include\SDL_config_wince.h"\
{$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\ {$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\
...@@ -1556,10 +1554,8 @@ DEP_CPP_SDL_W=\ ...@@ -1556,10 +1554,8 @@ DEP_CPP_SDL_W=\
{$(INCLUDE)}"..\..\include\SDL_cdrom.h"\ {$(INCLUDE)}"..\..\include\SDL_cdrom.h"\
{$(INCLUDE)}"..\..\include\SDL_config.h"\ {$(INCLUDE)}"..\..\include\SDL_config.h"\
{$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\ {$(INCLUDE)}"..\..\include\SDL_config_amiga.h"\
{$(INCLUDE)}"..\..\include\SDL_config_dreamcast.h"\
{$(INCLUDE)}"..\..\include\SDL_config_macos.h"\ {$(INCLUDE)}"..\..\include\SDL_config_macos.h"\
{$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\ {$(INCLUDE)}"..\..\include\SDL_config_macosx.h"\
{$(INCLUDE)}"..\..\include\SDL_config_os2.h"\
{$(INCLUDE)}"..\..\include\SDL_config_win32.h"\ {$(INCLUDE)}"..\..\include\SDL_config_win32.h"\
{$(INCLUDE)}"..\..\include\SDL_config_wince.h"\ {$(INCLUDE)}"..\..\include\SDL_config_wince.h"\
{$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\ {$(INCLUDE)}"..\..\include\SDL_cpuinfo.h"\
......
...@@ -359,10 +359,8 @@ NODEP_CPP_LOOPW=\ ...@@ -359,10 +359,8 @@ NODEP_CPP_LOOPW=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
...@@ -399,10 +397,8 @@ NODEP_CPP_LOOPW=\ ...@@ -399,10 +397,8 @@ NODEP_CPP_LOOPW=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
...@@ -439,10 +435,8 @@ NODEP_CPP_LOOPW=\ ...@@ -439,10 +435,8 @@ NODEP_CPP_LOOPW=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
...@@ -479,10 +473,8 @@ NODEP_CPP_LOOPW=\ ...@@ -479,10 +473,8 @@ NODEP_CPP_LOOPW=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
......
...@@ -392,10 +392,8 @@ DEP_CPP_TESTA=\ ...@@ -392,10 +392,8 @@ DEP_CPP_TESTA=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -430,10 +428,8 @@ DEP_CPP_TESTA=\ ...@@ -430,10 +428,8 @@ DEP_CPP_TESTA=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -468,10 +464,8 @@ DEP_CPP_TESTA=\ ...@@ -468,10 +464,8 @@ DEP_CPP_TESTA=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -506,10 +500,8 @@ DEP_CPP_TESTA=\ ...@@ -506,10 +500,8 @@ DEP_CPP_TESTA=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -546,10 +538,8 @@ NODEP_CPP_TESTA=\ ...@@ -546,10 +538,8 @@ NODEP_CPP_TESTA=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
...@@ -586,10 +576,8 @@ NODEP_CPP_TESTA=\ ...@@ -586,10 +576,8 @@ NODEP_CPP_TESTA=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
......
...@@ -531,10 +531,8 @@ NODEP_CPP_TESTT=\ ...@@ -531,10 +531,8 @@ NODEP_CPP_TESTT=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
"..\include\SDL_endian.h"\ "..\include\SDL_endian.h"\
...@@ -570,10 +568,8 @@ NODEP_CPP_TESTT=\ ...@@ -570,10 +568,8 @@ NODEP_CPP_TESTT=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
"..\include\SDL_endian.h"\ "..\include\SDL_endian.h"\
...@@ -607,10 +603,8 @@ DEP_CPP_TESTT=\ ...@@ -607,10 +603,8 @@ DEP_CPP_TESTT=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -644,10 +638,8 @@ DEP_CPP_TESTT=\ ...@@ -644,10 +638,8 @@ DEP_CPP_TESTT=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -683,10 +675,8 @@ NODEP_CPP_TESTT=\ ...@@ -683,10 +675,8 @@ NODEP_CPP_TESTT=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
"..\include\SDL_endian.h"\ "..\include\SDL_endian.h"\
...@@ -722,10 +712,8 @@ NODEP_CPP_TESTT=\ ...@@ -722,10 +712,8 @@ NODEP_CPP_TESTT=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
"..\include\SDL_endian.h"\ "..\include\SDL_endian.h"\
...@@ -771,10 +759,8 @@ DEP_CPP_TESTT=\ ...@@ -771,10 +759,8 @@ DEP_CPP_TESTT=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -808,10 +794,8 @@ DEP_CPP_TESTT=\ ...@@ -808,10 +794,8 @@ DEP_CPP_TESTT=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
......
...@@ -394,10 +394,8 @@ DEP_CPP_TESTW=\ ...@@ -394,10 +394,8 @@ DEP_CPP_TESTW=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -431,10 +429,8 @@ DEP_CPP_TESTW=\ ...@@ -431,10 +429,8 @@ DEP_CPP_TESTW=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -468,10 +464,8 @@ DEP_CPP_TESTW=\ ...@@ -468,10 +464,8 @@ DEP_CPP_TESTW=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -505,10 +499,8 @@ DEP_CPP_TESTW=\ ...@@ -505,10 +499,8 @@ DEP_CPP_TESTW=\
"..\..\include\SDL_cdrom.h"\ "..\..\include\SDL_cdrom.h"\
"..\..\include\SDL_config.h"\ "..\..\include\SDL_config.h"\
"..\..\include\SDL_config_amiga.h"\ "..\..\include\SDL_config_amiga.h"\
"..\..\include\SDL_config_dreamcast.h"\
"..\..\include\SDL_config_macos.h"\ "..\..\include\SDL_config_macos.h"\
"..\..\include\SDL_config_macosx.h"\ "..\..\include\SDL_config_macosx.h"\
"..\..\include\SDL_config_os2.h"\
"..\..\include\SDL_config_win32.h"\ "..\..\include\SDL_config_win32.h"\
"..\..\include\SDL_cpuinfo.h"\ "..\..\include\SDL_cpuinfo.h"\
"..\..\include\SDL_endian.h"\ "..\..\include\SDL_endian.h"\
...@@ -544,10 +536,8 @@ NODEP_CPP_TESTW=\ ...@@ -544,10 +536,8 @@ NODEP_CPP_TESTW=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
...@@ -584,10 +574,8 @@ NODEP_CPP_TESTW=\ ...@@ -584,10 +574,8 @@ NODEP_CPP_TESTW=\
"..\include\SDL_cdrom.h"\ "..\include\SDL_cdrom.h"\
"..\include\SDL_config.h"\ "..\include\SDL_config.h"\
"..\include\SDL_config_amiga.h"\ "..\include\SDL_config_amiga.h"\
"..\include\SDL_config_dreamcast.h"\
"..\include\SDL_config_macos.h"\ "..\include\SDL_config_macos.h"\
"..\include\SDL_config_macosx.h"\ "..\include\SDL_config_macosx.h"\
"..\include\SDL_config_os2.h"\
"..\include\SDL_config_win32.h"\ "..\include\SDL_config_win32.h"\
"..\include\SDL_config_wince.h"\ "..\include\SDL_config_wince.h"\
"..\include\SDL_cpuinfo.h"\ "..\include\SDL_cpuinfo.h"\
......
...@@ -84,8 +84,8 @@ Known Issues: ...@@ -84,8 +84,8 @@ Known Issues:
there are new public headers. But also as a result of these changes, there are there are new public headers. But also as a result of these changes, there are
also new headers that qualify as "PrivateHeaders". Private Headers are headers also new headers that qualify as "PrivateHeaders". Private Headers are headers
that must be exported because a public header includes them, but users shouldn't that must be exported because a public header includes them, but users shouldn't
directly invoke these. SDL_config_macosx.h and SDL_config_dreamcast.h are directly invoke these. SDL_config_macosx.h is an example of this.
examples of this. We have considered marking these headers as Private, but it We have considered marking these headers as Private, but it
requires that the public headers invoke them via framework conventions, i.e. requires that the public headers invoke them via framework conventions, i.e.
#include <FrameworkName/Header.h> #include <FrameworkName/Header.h>
e.g. e.g.
......
...@@ -38,8 +38,8 @@ and 2D framebuffer across multiple platforms. ...@@ -38,8 +38,8 @@ and 2D framebuffer across multiple platforms.
The current version supports Linux, Windows, Windows CE, BeOS, MacOS, The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
The code contains support for Dreamcast, Atari, AIX, OSF/Tru64, The code contains support for Atari, AIX, OSF/Tru64, RISC OS, and
RISC OS, SymbianOS, but these are not officially supported. SymbianOS, but these are not officially supported.
SDL is written in C, but works with C++ natively, and has bindings to SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
/* Add any platform that doesn't build using the configure system */ /* Add any platform that doesn't build using the configure system */
#if defined(__NINTENDODS__) #if defined(__NINTENDODS__)
#include "SDL_config_nintendods.h" #include "SDL_config_nintendods.h"
#elif defined(__DREAMCAST__)
#include "SDL_config_dreamcast.h"
#elif defined(__IPHONEOS__) #elif defined(__IPHONEOS__)
#include "SDL_config_iphoneos.h" #include "SDL_config_iphoneos.h"
#elif defined(__MACOSX__) #elif defined(__MACOSX__)
......
...@@ -182,7 +182,6 @@ ...@@ -182,7 +182,6 @@
#undef SDL_AUDIO_DRIVER_BSD #undef SDL_AUDIO_DRIVER_BSD
#undef SDL_AUDIO_DRIVER_COREAUDIO #undef SDL_AUDIO_DRIVER_COREAUDIO
#undef SDL_AUDIO_DRIVER_DART #undef SDL_AUDIO_DRIVER_DART
#undef SDL_AUDIO_DRIVER_DC
#undef SDL_AUDIO_DRIVER_DISK #undef SDL_AUDIO_DRIVER_DISK
#undef SDL_AUDIO_DRIVER_DUMMY #undef SDL_AUDIO_DRIVER_DUMMY
#undef SDL_AUDIO_DRIVER_DMEDIA #undef SDL_AUDIO_DRIVER_DMEDIA
...@@ -207,7 +206,6 @@ ...@@ -207,7 +206,6 @@
#undef SDL_INPUT_LINUXEV #undef SDL_INPUT_LINUXEV
#undef SDL_INPUT_TSLIB #undef SDL_INPUT_TSLIB
#undef SDL_JOYSTICK_BEOS #undef SDL_JOYSTICK_BEOS
#undef SDL_JOYSTICK_DC
#undef SDL_JOYSTICK_DINPUT #undef SDL_JOYSTICK_DINPUT
#undef SDL_JOYSTICK_DUMMY #undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT #undef SDL_JOYSTICK_IOKIT
...@@ -233,7 +231,6 @@ ...@@ -233,7 +231,6 @@
/* Enable various threading systems */ /* Enable various threading systems */
#undef SDL_THREAD_BEOS #undef SDL_THREAD_BEOS
#undef SDL_THREAD_DC
#undef SDL_THREAD_NDS #undef SDL_THREAD_NDS
#undef SDL_THREAD_PTH #undef SDL_THREAD_PTH
#undef SDL_THREAD_PTHREAD #undef SDL_THREAD_PTHREAD
...@@ -244,7 +241,6 @@ ...@@ -244,7 +241,6 @@
/* Enable various timer systems */ /* Enable various timer systems */
#undef SDL_TIMER_BEOS #undef SDL_TIMER_BEOS
#undef SDL_TIMER_DC
#undef SDL_TIMER_DUMMY #undef SDL_TIMER_DUMMY
#undef SDL_TIMER_MINT #undef SDL_TIMER_MINT
#undef SDL_TIMER_NDS #undef SDL_TIMER_NDS
...@@ -256,7 +252,6 @@ ...@@ -256,7 +252,6 @@
/* Enable various video drivers */ /* Enable various video drivers */
#undef SDL_VIDEO_DRIVER_BWINDOW #undef SDL_VIDEO_DRIVER_BWINDOW
#undef SDL_VIDEO_DRIVER_COCOA #undef SDL_VIDEO_DRIVER_COCOA
#undef SDL_VIDEO_DRIVER_DC
#undef SDL_VIDEO_DRIVER_DIRECTFB #undef SDL_VIDEO_DRIVER_DIRECTFB
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
#undef SDL_VIDEO_DRIVER_DUMMY #undef SDL_VIDEO_DRIVER_DUMMY
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#ifndef _SDL_config_dreamcast_h
#define _SDL_config_dreamcast_h
#include "SDL_platform.h"
/* This is a set of defines to configure the SDL features */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#define SIZEOF_VOIDP 4
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STRING_H 1
#define HAVE_CTYPE_H 1
/* C library functions */
#define HAVE_MALLOC 1
#define HAVE_CALLOC 1
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_QSORT 1
#define HAVE_ABS 1
#define HAVE_BCOPY 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMCMP 1
#define HAVE_STRLEN 1
#define HAVE_STRDUP 1
#define HAVE_INDEX 1
#define HAVE_RINDEX 1
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRICMP 1
#define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
#define HAVE_VSNPRINTF 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DC 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_DUMMY 1
/* Enable various input drivers */
#define SDL_JOYSTICK_DC 1
#define SDL_HAPTIC_DUMMY 1
/* Enable various shared object loading systems */
#define SDL_LOADSO_DUMMY 1
/* Enable various threading systems */
#define SDL_THREAD_DC 1
/* Enable various timer systems */
#define SDL_TIMER_DC 1
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DC 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_POWER_HARDWIRED 1
#endif /* _SDL_config_dreamcast_h */
...@@ -140,9 +140,6 @@ static const AudioBootStrap *const bootstrap[] = { ...@@ -140,9 +140,6 @@ static const AudioBootStrap *const bootstrap[] = {
#if SDL_AUDIO_DRIVER_DUMMY #if SDL_AUDIO_DRIVER_DUMMY
&DUMMYAUD_bootstrap, &DUMMYAUD_bootstrap,
#endif #endif
#if SDL_AUDIO_DRIVER_DC
&DCAUD_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_MMEAUDIO #if SDL_AUDIO_DRIVER_MMEAUDIO
&MMEAUDIO_bootstrap, &MMEAUDIO_bootstrap,
#endif #endif
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* Output dreamcast aica */
#include "SDL_timer.h"
#include "SDL_audio.h"
#include "../SDL_audiomem.h"
#include "../SDL_audio_c.h"
#include "SDL_dcaudio.h"
#include "aica.h"
#include <dc/spu.h>
#define SPU_RAM_BASE 0xa0800000
static void
spu_memload_stereo8(int leftpos, int rightpos, void *src0, size_t size)
{
uint8 *src = src0;
uint32 *left = (uint32 *) (leftpos + SPU_RAM_BASE);
uint32 *right = (uint32 *) (rightpos + SPU_RAM_BASE);
size = (size + 7) / 8;
while (size--) {
unsigned lval, rval;
lval = *src++;
rval = *src++;
lval |= (*src++) << 8;
rval |= (*src++) << 8;
lval |= (*src++) << 16;
rval |= (*src++) << 16;
lval |= (*src++) << 24;
rval |= (*src++) << 24;
g2_write_32(left++, lval);
g2_write_32(right++, rval);
g2_fifo_wait();
}
}
static void
spu_memload_stereo16(int leftpos, int rightpos, void *src0, size_t size)
{
uint16 *src = src0;
uint32 *left = (uint32 *) (leftpos + SPU_RAM_BASE);
uint32 *right = (uint32 *) (rightpos + SPU_RAM_BASE);
size = (size + 7) / 8;
while (size--) {
unsigned lval, rval;
lval = *src++;
rval = *src++;
lval |= (*src++) << 16;
rval |= (*src++) << 16;
g2_write_32(left++, lval);
g2_write_32(right++, rval);
g2_fifo_wait();
}
}
static void
DCAUD_PlayDevice(_THIS)
{
SDL_AudioSpec *spec = &this->spec;
unsigned int offset;
if (this->hidden->playing) {
/* wait */
while (aica_get_pos(0) / spec->samples == this->hidden->nextbuf) {
thd_pass();
}
}
offset = this->hidden->nextbuf * spec->size;
this->hidden->nextbuf ^= 1;
/* Write the audio data, checking for EAGAIN on broken audio drivers */
if (spec->channels == 1) {
spu_memload(this->hidden->leftpos + offset, this->hidden->mixbuf,
this->hidden->mixlen);
} else {
offset /= 2;
if ((this->spec.format & 255) == 8) {
spu_memload_stereo8(this->hidden->leftpos + offset,
this->hidden->rightpos + offset,
this->hidden->mixbuf, this->hidden->mixlen);
} else {
spu_memload_stereo16(this->hidden->leftpos + offset,
this->hidden->rightpos + offset,
this->hidden->mixbuf, this->hidden->mixlen);
}
}
if (!this->hidden->playing) {
int mode;
this->hidden->playing = 1;
mode = (spec->format == AUDIO_S8) ? SM_8BIT : SM_16BIT;
if (spec->channels == 1) {
aica_play(0, mode, this->hidden->leftpos, 0,
spec->samples * 2, spec->freq, 255, 128, 1);
} else {
aica_play(0, mode, this->hidden->leftpos, 0,
spec->samples * 2, spec->freq, 255, 0, 1);
aica_play(1, mode, this->hidden->rightpos, 0,
spec->samples * 2, spec->freq, 255, 255, 1);
}
}
}
static Uint8 *
DCAUD_GetDeviceBuf(_THIS)
{
return (this->hidden->mixbuf);
}
/* This function waits until it is possible to write a full sound buffer */
static void
DCAUD_WaitDevice(_THIS)
{
if (this->hidden->playing) {
/* wait */
while (aica_get_pos(0) / this->spec.samples == this->hidden->nextbuf) {
thd_pass();
}
}
}
static void
DCAUD_CloseDevice(_THIS)
{
if (this->hidden != NULL) {
aica_stop(0);
if (this->spec.channels == 2) {
aica_stop(1);
}
if (this->hidden->mixbuf != NULL) {
SDL_FreeAudioMem(this->hidden->mixbuf);
this->hidden->mixbuf = NULL;
}
SDL_free(this->hidden);
this->hidden = NULL;
/* !!! FIXME: is there a reverse of spu_init()? */
}
}
static int
DCAUD_OpenDevice(_THIS, SDL_AudioSpec * spec)
{
SDL_AudioFormat test_format = SDL_FirstAudioFormat(spec->format);
int valid_datatype = 0;
/* Initialize all variables that we clean on shutdown */
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc((sizeof *this->hidden));
if (this->hidden == NULL) {
SDL_OutOfMemory();
return 0;
}
SDL_memset(this->hidden, 0, (sizeof *this->hidden));
spu_init();
while ((!valid_datatype) && (test_format)) {
spec->format = test_format;
switch (test_format) {
/* only formats Dreamcast accepts... */
case AUDIO_S8:
case AUDIO_S16LSB:
valid_datatype = 1;
break;
default:
test_format = SDL_NextAudioFormat();
break;
}
}
if (!valid_datatype) { /* shouldn't happen, but just in case... */
DCAUD_CloseDevice(this);
SDL_SetError("Unsupported audio format");
return 0;
}
if (spec->channels > 2)
spec->channels = 2; /* no more than stereo on the Dreamcast. */
/* Update the fragment size as size in bytes */
SDL_CalculateAudioSpec(spec);
/* Allocate mixing buffer */
this->hidden->mixlen = spec->size;
this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->hidden->mixlen);
if (this->hidden->mixbuf == NULL) {
DCAUD_CloseDevice(this);
SDL_OutOfMemory();
return 0;
}
SDL_memset(this->hidden->mixbuf, spec->silence, spec->size);
this->hidden->leftpos = 0x11000;
this->hidden->rightpos = 0x11000 + spec->size;
this->hidden->playing = 0;
this->hidden->nextbuf = 0;
/* We're ready to rock and roll. :-) */
return 1;
}
static int
DCAUD_Init(SDL_AudioDriverImpl * impl)
{
/* Set the function pointers */
impl->OpenDevice = DCAUD_OpenDevice;
impl->PlayDevice = DCAUD_PlayDevice;
impl->WaitDevice = DCAUD_WaitDevice;
impl->GetDeviceBuf = DCAUD_GetDeviceBuf;
impl->CloseDevice = DCAUD_CloseDevice;
impl->OnlyHasDefaultOutputDevice = 1;
return 1;
}
AudioBootStrap DCAUD_bootstrap = {
"dcaudio", "Dreamcast AICA audio", DCAUD_Init, 0
};
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_dcaudio_h
#define _SDL_dcaudio_h
#include "../SDL_sysaudio.h"
/* Hidden "this" pointer for the audio functions */
#define _THIS SDL_AudioDevice *this
struct SDL_PrivateAudioData
{
/* The file descriptor for the audio device */
Uint8 *mixbuf;
Uint32 mixlen;
int playing;
int leftpos, rightpos;
int nextbuf;
};
#endif /* _SDL_dcaudio_h */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _AICA_H_
#define _AICA_H_
#define AICA_MEM 0xa0800000
#define SM_8BIT 1
#define SM_16BIT 0
#define SM_ADPCM 2
void aica_play(int ch, int mode, unsigned long smpptr, int looptst,
int loopend, int freq, int vol, int pan, int loopflag);
void aica_stop(int ch);
void aica_vol(int ch, int vol);
void aica_pan(int ch, int pan);
void aica_freq(int ch, int freq);
int aica_get_pos(int ch);
#endif
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_JOYSTICK_DC
#include "SDL_events.h"
#include "SDL_joystick.h"
#include "../SDL_sysjoystick.h"
#include "../SDL_joystick_c.h"
#include <dc/maple.h>
#include <dc/maple/controller.h>
#define MAX_JOYSTICKS 8 /* only 2 are supported in the multimedia API */
#define MAX_AXES 6 /* each joystick can have up to 6 axes */
#define MAX_BUTTONS 8 /* and 8 buttons */
#define MAX_HATS 2
#define JOYNAMELEN 8
/* array to hold joystick ID values */
static uint8 SYS_Joystick_addr[MAX_JOYSTICKS];
/* The private structure used to keep track of a joystick */
struct joystick_hwdata
{
cont_cond_t prev_cond;
int prev_buttons;
};
/* Function to scan the system for joysticks.
* This function should set SDL_numjoysticks to the number of available
* joysticks. Joystick 0 should be the system default joystick.
* It should return 0, or -1 on an unrecoverable fatal error.
*/
int
SDL_SYS_JoystickInit(void)
{
int numdevs;
int p, u;
numdevs = 0;
for (p = 0; p < MAPLE_PORT_COUNT; p++) {
for (u = 0; u < MAPLE_UNIT_COUNT; u++) {
if (maple_device_func(p, u) & MAPLE_FUNC_CONTROLLER) {
SYS_Joystick_addr[numdevs] = maple_addr(p, u);
numdevs++;
}
}
}
return (numdevs);
}
/* Function to get the device-dependent name of a joystick */
const char *
SDL_SYS_JoystickName(int index)
{
maple_device_t *dev;
if (maple_compat_resolve
(SYS_Joystick_addr[index], &dev, MAPLE_FUNC_CONTROLLER) != 0)
return NULL;
return dev->info.product_name;
}
/* Function to open a joystick for use.
The joystick to open is specified by the index field of the joystick.
This should fill the nbuttons and naxes fields of the joystick structure.
It returns 0, or -1 if there is an error.
*/
int
SDL_SYS_JoystickOpen(SDL_Joystick * joystick)
{
/* allocate memory for system specific hardware data */
joystick->hwdata =
(struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
if (joystick->hwdata == NULL) {
SDL_OutOfMemory();
return (-1);
}
SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
/* fill nbuttons, naxes, and nhats fields */
joystick->nbuttons = MAX_BUTTONS;
joystick->naxes = MAX_AXES;
joystick->nhats = MAX_HATS;
return (0);
}
/* Function to update the state of a joystick - called as a device poll.
* This function shouldn't update the joystick structure directly,
* but instead should call SDL_PrivateJoystick*() to deliver events
* and update joystick device state.
*/
void
SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
{
const int sdl_buttons[] = {
CONT_C,
CONT_B,
CONT_A,
CONT_START,
CONT_Z,
CONT_Y,
CONT_X,
CONT_D
};
uint8 addr;
cont_cond_t cond, *prev_cond;
int buttons, prev_buttons, i, changed;
addr = SYS_Joystick_addr[joystick->index];
if (cont_get_cond(addr, &cond) < 0)
return;
buttons = cond.buttons;
prev_buttons = joystick->hwdata->prev_buttons;
changed = buttons ^ prev_buttons;
if ((changed) &
(CONT_DPAD_UP | CONT_DPAD_DOWN | CONT_DPAD_LEFT | CONT_DPAD_RIGHT)) {
int hat = SDL_HAT_CENTERED;
if (buttons & CONT_DPAD_UP)
hat |= SDL_HAT_UP;
if (buttons & CONT_DPAD_DOWN)
hat |= SDL_HAT_DOWN;
if (buttons & CONT_DPAD_LEFT)
hat |= SDL_HAT_LEFT;
if (buttons & CONT_DPAD_RIGHT)
hat |= SDL_HAT_RIGHT;
SDL_PrivateJoystickHat(joystick, 0, hat);
}
if ((changed) &
(CONT_DPAD2_UP | CONT_DPAD2_DOWN | CONT_DPAD2_LEFT |
CONT_DPAD2_RIGHT)) {
int hat = SDL_HAT_CENTERED;
if (buttons & CONT_DPAD2_UP)
hat |= SDL_HAT_UP;
if (buttons & CONT_DPAD2_DOWN)
hat |= SDL_HAT_DOWN;
if (buttons & CONT_DPAD2_LEFT)
hat |= SDL_HAT_LEFT;
if (buttons & CONT_DPAD2_RIGHT)
hat |= SDL_HAT_RIGHT;
SDL_PrivateJoystickHat(joystick, 1, hat);
}
for (i = 0; i < sizeof(sdl_buttons) / sizeof(sdl_buttons[0]); i++) {
if (changed & sdl_buttons[i]) {
SDL_PrivateJoystickButton(joystick, i,
(buttons & sdl_buttons[i]) ?
SDL_PRESSED : SDL_RELEASED);
}
}
prev_cond = &joystick->hwdata->prev_cond;
if (cond.joyx != prev_cond->joyx)
SDL_PrivateJoystickAxis(joystick, 0, cond.joyx - 128);
if (cond.joyy != prev_cond->joyy)
SDL_PrivateJoystickAxis(joystick, 1, cond.joyy - 128);
if (cond.rtrig != prev_cond->rtrig)
SDL_PrivateJoystickAxis(joystick, 2, cond.rtrig);
if (cond.ltrig != prev_cond->ltrig)
SDL_PrivateJoystickAxis(joystick, 3, cond.ltrig);
if (cond.joy2x != prev_cond->joy2x)
SDL_PrivateJoystickAxis(joystick, 4, cond.joy2x - 128);
if (cond.joy2y != prev_cond->joy2y)
SDL_PrivateJoystickAxis(joystick, 5, cond.joy2y - 128);
joystick->hwdata->prev_buttons = buttons;
joystick->hwdata->prev_cond = cond;
}
/* Function to close a joystick after use */
void
SDL_SYS_JoystickClose(SDL_Joystick * joystick)
{
if (joystick->hwdata != NULL) {
/* free system specific hardware data */
SDL_free(joystick->hwdata);
}
}
/* Function to perform any system-specific joystick related cleanup */
void
SDL_SYS_JoystickQuit(void)
{
return;
}
#endif /* SDL_JOYSTICK_DC */
/* vi: set ts=4 sw=4 expandtab: */
...@@ -39,7 +39,7 @@ SDL_bool SDL_GetPowerInfo_NintendoDS(SDL_PowerState *, int *, int *); ...@@ -39,7 +39,7 @@ SDL_bool SDL_GetPowerInfo_NintendoDS(SDL_PowerState *, int *, int *);
#ifndef SDL_POWER_DISABLED #ifndef SDL_POWER_DISABLED
#ifdef SDL_POWER_HARDWIRED #ifdef SDL_POWER_HARDWIRED
/* This is for things that _never_ have a battery, like the Dreamcast, etc. */ /* This is for things that _never_ have a battery */
static SDL_bool static SDL_bool
SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent) SDL_GetPowerInfo_Hardwired(SDL_PowerState * state, int *seconds, int *percent)
{ {
......
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
#include "generic/SDL_systhread_c.h" #include "generic/SDL_systhread_c.h"
#elif SDL_THREAD_BEOS #elif SDL_THREAD_BEOS
#include "beos/SDL_systhread_c.h" #include "beos/SDL_systhread_c.h"
#elif SDL_THREAD_DC
#include "dc/SDL_systhread_c.h"
#elif SDL_THREAD_EPOC #elif SDL_THREAD_EPOC
#include "epoc/SDL_systhread_c.h" #include "epoc/SDL_systhread_c.h"
#elif SDL_THREAD_PTH #elif SDL_THREAD_PTH
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* An implementation of condition variables using semaphores and mutexes */
/*
This implementation borrows heavily from the BeOS condition variable
implementation, written by Christopher Tate and Owen Smith. Thanks!
*/
#include "SDL_thread.h"
struct SDL_cond
{
SDL_mutex *lock;
int waiting;
int signals;
SDL_sem *wait_sem;
SDL_sem *wait_done;
};
/* Create a condition variable */
SDL_cond *
SDL_CreateCond(void)
{
SDL_cond *cond;
cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
if (cond) {
cond->lock = SDL_CreateMutex();
cond->wait_sem = SDL_CreateSemaphore(0);
cond->wait_done = SDL_CreateSemaphore(0);
cond->waiting = cond->signals = 0;
if (!cond->lock || !cond->wait_sem || !cond->wait_done) {
SDL_DestroyCond(cond);
cond = NULL;
}
} else {
SDL_OutOfMemory();
}
return (cond);
}
/* Destroy a condition variable */
void
SDL_DestroyCond(SDL_cond * cond)
{
if (cond) {
if (cond->wait_sem) {
SDL_DestroySemaphore(cond->wait_sem);
}
if (cond->wait_done) {
SDL_DestroySemaphore(cond->wait_done);
}
if (cond->lock) {
SDL_DestroyMutex(cond->lock);
}
SDL_free(cond);
}
}
/* Restart one of the threads that are waiting on the condition variable */
int
SDL_CondSignal(SDL_cond * cond)
{
if (!cond) {
SDL_SetError("Passed a NULL condition variable");
return -1;
}
/* If there are waiting threads not already signalled, then
signal the condition and wait for the thread to respond.
*/
SDL_LockMutex(cond->lock);
if (cond->waiting > cond->signals) {
++cond->signals;
SDL_SemPost(cond->wait_sem);
SDL_UnlockMutex(cond->lock);
SDL_SemWait(cond->wait_done);
} else {
SDL_UnlockMutex(cond->lock);
}
return 0;
}
/* Restart all threads that are waiting on the condition variable */
int
SDL_CondBroadcast(SDL_cond * cond)
{
if (!cond) {
SDL_SetError("Passed a NULL condition variable");
return -1;
}
/* If there are waiting threads not already signalled, then
signal the condition and wait for the thread to respond.
*/
SDL_LockMutex(cond->lock);
if (cond->waiting > cond->signals) {
int i, num_waiting;
num_waiting = (cond->waiting - cond->signals);
cond->signals = cond->waiting;
for (i = 0; i < num_waiting; ++i) {
SDL_SemPost(cond->wait_sem);
}
/* Now all released threads are blocked here, waiting for us.
Collect them all (and win fabulous prizes!) :-)
*/
SDL_UnlockMutex(cond->lock);
for (i = 0; i < num_waiting; ++i) {
SDL_SemWait(cond->wait_done);
}
} else {
SDL_UnlockMutex(cond->lock);
}
return 0;
}
/* Wait on the condition variable for at most 'ms' milliseconds.
The mutex must be locked before entering this function!
The mutex is unlocked during the wait, and locked again after the wait.
Typical use:
Thread A:
SDL_LockMutex(lock);
while ( ! condition ) {
SDL_CondWait(cond);
}
SDL_UnlockMutex(lock);
Thread B:
SDL_LockMutex(lock);
...
condition = true;
...
SDL_UnlockMutex(lock);
*/
int
SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
{
int retval;
if (!cond) {
SDL_SetError("Passed a NULL condition variable");
return -1;
}
/* Obtain the protection mutex, and increment the number of waiters.
This allows the signal mechanism to only perform a signal if there
are waiting threads.
*/
SDL_LockMutex(cond->lock);
++cond->waiting;
SDL_UnlockMutex(cond->lock);
/* Unlock the mutex, as is required by condition variable semantics */
SDL_UnlockMutex(mutex);
/* Wait for a signal */
if (ms == SDL_MUTEX_MAXWAIT) {
retval = SDL_SemWait(cond->wait_sem);
} else {
retval = SDL_SemWaitTimeout(cond->wait_sem, ms);
}
/* Let the signaler know we have completed the wait, otherwise
the signaler can race ahead and get the condition semaphore
if we are stopped between the mutex unlock and semaphore wait,
giving a deadlock. See the following URL for details:
http://www-classic.be.com/aboutbe/benewsletter/volume_III/Issue40.html
*/
SDL_LockMutex(cond->lock);
if (cond->signals > 0) {
/* If we timed out, we need to eat a condition signal */
if (retval > 0) {
SDL_SemWait(cond->wait_sem);
}
/* We always notify the signal thread that we are done */
SDL_SemPost(cond->wait_done);
/* Signal handshake complete */
--cond->signals;
}
--cond->waiting;
SDL_UnlockMutex(cond->lock);
/* Lock the mutex, as is required by condition variable semantics */
SDL_LockMutex(mutex);
return retval;
}
/* Wait on the condition variable forever */
int
SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
{
return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT);
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* An implementation of mutexes using semaphores */
#include "SDL_thread.h"
#include "SDL_systhread_c.h"
#include <arch/spinlock.h>
struct SDL_mutex
{
int recursive;
Uint32 owner;
spinlock_t mutex;
};
/* Create a mutex */
SDL_mutex *
SDL_CreateMutex(void)
{
SDL_mutex *mutex;
/* Allocate mutex memory */
mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
if (mutex) {
spinlock_init(&mutex->mutex);
mutex->recursive = 0;
mutex->owner = 0;
} else {
SDL_OutOfMemory();
}
return mutex;
}
/* Free the mutex */
void
SDL_DestroyMutex(SDL_mutex * mutex)
{
if (mutex) {
SDL_free(mutex);
}
}
/* Lock the semaphore */
int
SDL_mutexP(SDL_mutex * mutex)
{
#if SDL_THREADS_DISABLED
return SDL_arraysize(return), 0;
#else
Uint32 this_thread;
if (mutex == NULL) {
SDL_SetError("Passed a NULL mutex");
return -1;
}
this_thread = SDL_ThreadID();
if (mutex->owner == this_thread) {
++mutex->recursive;
} else {
/* The order of operations is important.
We set the locking thread id after we obtain the lock
so unlocks from other threads will fail.
*/
spinlock_lock(&mutex->mutex);
mutex->owner = this_thread;
mutex->recursive = 0;
}
return 0;
#endif /* SDL_THREADS_DISABLED */
}
/* Unlock the mutex */
int
SDL_mutexV(SDL_mutex * mutex)
{
#if SDL_THREADS_DISABLED
return 0;
#else
if (mutex == NULL) {
SDL_SetError("Passed a NULL mutex");
return -1;
}
/* If we don't own the mutex, we can't unlock it */
if (SDL_ThreadID() != mutex->owner) {
SDL_SetError("mutex not owned by this thread");
return -1;
}
if (mutex->recursive) {
--mutex->recursive;
} else {
/* The order of operations is important.
First reset the owner so another thread doesn't lock
the mutex and set the ownership before we reset it,
then release the lock semaphore.
*/
mutex->owner = 0;
spinlock_unlock(&mutex->mutex);
}
return 0;
#endif /* SDL_THREADS_DISABLED */
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* An implementation of semaphores using mutexes and condition variables */
#include "SDL_timer.h"
#include "SDL_thread.h"
#include "SDL_systhread_c.h"
#if SDL_THREADS_DISABLED
SDL_sem *
SDL_CreateSemaphore(Uint32 initial_value)
{
SDL_SetError("SDL not configured with thread support");
return (SDL_sem *) 0;
}
void
SDL_DestroySemaphore(SDL_sem * sem)
{
return;
}
int
SDL_SemTryWait(SDL_sem * sem)
{
SDL_SetError("SDL not configured with thread support");
return -1;
}
int
SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
{
SDL_SetError("SDL not configured with thread support");
return -1;
}
int
SDL_SemWait(SDL_sem * sem)
{
SDL_SetError("SDL not configured with thread support");
return -1;
}
Uint32
SDL_SemValue(SDL_sem * sem)
{
return 0;
}
int
SDL_SemPost(SDL_sem * sem)
{
SDL_SetError("SDL not configured with thread support");
return -1;
}
#else
#include <kos/sem.h>
struct SDL_semaphore
{
semaphore_t sem;
};
SDL_sem *
SDL_CreateSemaphore(Uint32 initial_value)
{
return (SDL_sem *) sem_create(initial_value);
}
/* WARNING:
You cannot call this function when another thread is using the semaphore.
*/
void
SDL_DestroySemaphore(SDL_sem * sem)
{
if (!sem) {
SDL_SetError("Passed a NULL semaphore");
return;
}
sem_destroy(&sem->sem);
}
int
SDL_SemTryWait(SDL_sem * sem)
{
int retval;
if (!sem) {
SDL_SetError("Passed a NULL semaphore");
return -1;
}
retval = sem_trywait(&sem->sem);
if (retval == 0)
return 0;
else
return SDL_MUTEX_TIMEDOUT;
return retval;
}
int
SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
{
int retval;
if (!sem) {
SDL_SetError("Passed a NULL semaphore");
return -1;
}
/* A timeout of 0 is an easy case */
if (timeout == 0) {
return SDL_SemTryWait(sem);
}
retval = sem_wait_timed(&sem->sem, timeout);
if (retval == -1)
retval = SDL_MUTEX_TIMEDOUT;
return retval;
}
int
SDL_SemWait(SDL_sem * sem)
{
if (!sem) {
SDL_SetError("Passed a NULL semaphore");
return -1;
}
sem_wait(&sem->sem);
return 0;
}
Uint32
SDL_SemValue(SDL_sem * sem)
{
if (!sem) {
SDL_SetError("Passed a NULL semaphore");
return -1;
}
return sem_count(&sem->sem);
}
int
SDL_SemPost(SDL_sem * sem)
{
if (!sem) {
SDL_SetError("Passed a NULL semaphore");
return -1;
}
sem_signal(&sem->sem);
return 0;
}
#endif /* SDL_THREADS_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* Thread management routines for SDL */
#include "SDL_thread.h"
#include "../SDL_thread_c.h"
#include "../SDL_systhread.h"
#include <kos/thread.h>
int
SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
{
thread->handle = thd_create(SDL_RunThread, args);
if (thread->handle == NULL) {
SDL_SetError("Not enough resources to create thread");
return (-1);
}
return (0);
}
void
SDL_SYS_SetupThread(void)
{
return;
}
Uint32
SDL_ThreadID(void)
{
return (Uint32) thd_get_current();
}
void
SDL_SYS_WaitThread(SDL_Thread * thread)
{
thd_wait(thread->handle);
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
typedef struct kthread *SYS_ThreadHandle;
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_TIMER_DC
#include <kos.h>
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "../SDL_timer_c.h"
static unsigned start;
/*
jif = ms * HZ /1000
ms = jif * 1000/HZ
*/
void
SDL_StartTicks(void)
{
/* Set first ticks value */
start = jiffies;
}
Uint32
SDL_GetTicks(void)
{
return ((jiffies - start) * 1000 / HZ);
}
void
SDL_Delay(Uint32 ms)
{
thd_sleep(ms);
}
/* Data to handle a single periodic alarm */
static int timer_alive = 0;
static SDL_Thread *timer = NULL;
static int
RunTimer(void *unused)
{
while (timer_alive) {
if (SDL_timer_running) {
SDL_ThreadedTimerCheck();
}
SDL_Delay(10);
}
return (0);
}
/* This is only called if the event thread is not running */
int
SDL_SYS_TimerInit(void)
{
timer_alive = 1;
timer = SDL_CreateThread(RunTimer, NULL);
if (timer == NULL)
return (-1);
return (SDL_SetTimerThreaded(1));
}
void
SDL_SYS_TimerQuit(void)
{
timer_alive = 0;
if (timer) {
SDL_WaitThread(timer, NULL);
timer = NULL;
}
}
int
SDL_SYS_StartTimer(void)
{
SDL_SetError("Internal logic error: DC uses threaded timer");
return (-1);
}
void
SDL_SYS_StopTimer(void)
{
return;
}
#endif /* SDL_TIMER_DC */
/* vi: set ts=4 sw=4 expandtab: */
...@@ -389,9 +389,6 @@ extern VideoBootStrap XBIOS_bootstrap; ...@@ -389,9 +389,6 @@ extern VideoBootStrap XBIOS_bootstrap;
#if SDL_VIDEO_DRIVER_GEM #if SDL_VIDEO_DRIVER_GEM
extern VideoBootStrap GEM_bootstrap; extern VideoBootStrap GEM_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_DC
extern VideoBootStrap DC_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_RISCOS #if SDL_VIDEO_DRIVER_RISCOS
extern VideoBootStrap RISCOS_bootstrap; extern VideoBootStrap RISCOS_bootstrap;
#endif #endif
......
...@@ -103,9 +103,6 @@ static VideoBootStrap *bootstrap[] = { ...@@ -103,9 +103,6 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_GEM #if SDL_VIDEO_DRIVER_GEM
&GEM_bootstrap, &GEM_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_DC
&DC_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_RISCOS #if SDL_VIDEO_DRIVER_RISCOS
&RISCOS_bootstrap, &RISCOS_bootstrap,
#endif #endif
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "../../events/SDL_sysevents.h"
#include "../../events/SDL_events_c.h"
#include "SDL_dcvideo.h"
#include "SDL_dcevents_c.h"
#include <dc/maple.h>
#include <dc/maple/mouse.h>
#include <dc/maple/keyboard.h>
const static unsigned short sdl_key[] = {
/*0 */ 0, 0, 0, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z',
/*1e */ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
/*28 */ SDLK_RETURN, SDLK_ESCAPE, SDLK_BACKSPACE, SDLK_TAB, SDLK_SPACE,
SDLK_MINUS, SDLK_PLUS, SDLK_LEFTBRACKET,
SDLK_RIGHTBRACKET, SDLK_BACKSLASH, 0, SDLK_SEMICOLON, SDLK_QUOTE,
/*35 */ '~', SDLK_COMMA, SDLK_PERIOD, SDLK_SLASH, SDLK_CAPSLOCK,
SDLK_F1, SDLK_F2, SDLK_F3, SDLK_F4, SDLK_F5, SDLK_F6, SDLK_F7, SDLK_F8,
SDLK_F9, SDLK_F10, SDLK_F11, SDLK_F12,
/*46 */ SDLK_PRINT, SDLK_SCROLLOCK, SDLK_PAUSE, SDLK_INSERT, SDLK_HOME,
SDLK_PAGEUP, SDLK_DELETE, SDLK_END, SDLK_PAGEDOWN, SDLK_RIGHT,
SDLK_LEFT, SDLK_DOWN, SDLK_UP,
/*53 */ SDLK_NUMLOCK, SDLK_KP_DIVIDE, SDLK_KP_MULTIPLY, SDLK_KP_MINUS,
SDLK_KP_PLUS, SDLK_KP_ENTER,
SDLK_KP1, SDLK_KP2, SDLK_KP3, SDLK_KP4, SDLK_KP5, SDLK_KP6,
/*5f */ SDLK_KP7, SDLK_KP8, SDLK_KP9, SDLK_KP0, SDLK_KP_PERIOD, 0
/* S3 */
};
const static unsigned short sdl_shift[] = {
SDLK_LCTRL, SDLK_LSHIFT, SDLK_LALT, 0 /* S1 */ ,
SDLK_RCTRL, SDLK_RSHIFT, SDLK_RALT, 0 /* S2 */ ,
};
#define MOUSE_WHEELUP (1<<4)
#define MOUSE_WHEELDOWN (1<<5)
static void
mouse_update(void)
{
const static char sdl_mousebtn[] = {
MOUSE_LEFTBUTTON,
MOUSE_RIGHTBUTTON,
MOUSE_SIDEBUTTON,
MOUSE_WHEELUP,
MOUSE_WHEELDOWN
};
uint8 addr;
mouse_cond_t cond;
static int prev_buttons;
int buttons, changed;
int i;
if ((addr = maple_first_mouse()) == 0 || mouse_get_cond(addr, &cond) < 0)
return;
buttons = cond.buttons ^ 0xff;
if (cond.dz < 0)
buttons |= MOUSE_WHEELUP;
if (cond.dz > 0)
buttons |= MOUSE_WHEELDOWN;
if (cond.dx || cond.dy)
SDL_PrivateMouseMotion(0, 1, cond.dx, cond.dy);
changed = buttons ^ prev_buttons;
for (i = 0; i < sizeof(sdl_mousebtn); i++) {
if (changed & sdl_mousebtn[i]) {
SDL_PrivateMouseButton((buttons & sdl_mousebtn[i]) ?
SDL_PRESSED : SDL_RELEASED, i, 0, 0);
}
}
prev_buttons = buttons;
}
static void
keyboard_update(void)
{
static kbd_state_t old_state;
static uint8 old_addr;
kbd_state_t *state;
uint8 addr;
int port, unit;
int shiftkeys;
SDL_keysym keysym;
int i;
addr = maple_first_kb();
if (addr == 0)
return;
if (addr != old_addr) {
old_addr = addr;
SDL_memset(&old_state, 0, sizeof(old_state));
}
maple_raddr(addr, &port, &unit);
state = maple_dev_state(port, unit);
if (!state)
return;
shiftkeys = state->shift_keys ^ old_state.shift_keys;
for (i = 0; i < sizeof(sdl_shift); i++) {
if ((shiftkeys >> i) & 1) {
keysym.sym = sdl_shift[i];
SDL_PrivateKeyboard(((state->shift_keys >> i) & 1) ? SDL_PRESSED :
SDL_RELEASED, &keysym);
}
}
for (i = 0; i < sizeof(sdl_key); i++) {
if (state->matrix[i] != old_state.matrix[i]) {
int key = sdl_key[i];
if (key) {
keysym.sym = key;
SDL_PrivateKeyboard(state->matrix[i] ? SDL_PRESSED :
SDL_RELEASED, &keysym);
}
}
}
old_state = *state;
}
void
DC_PumpEvents(_THIS)
{
keyboard_update();
mouse_update();
}
void
DC_InitOSKeymap(_THIS)
{
/* do nothing. */
}
/* end of SDL_dcevents.c ... */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_dcvideo.h"
/* Variables and functions exported by SDL_sysevents.c to other parts
of the native video subsystem (SDL_sysvideo.c)
*/
extern void DC_InitOSKeymap(_THIS);
extern void DC_PumpEvents(_THIS);
/* end of SDL_dcevents_c.h ... */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include <stdio.h>
#include "SDL_mouse.h"
#include "../../events/SDL_events_c.h"
#include "SDL_dcmouse_c.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor
{
int unused;
};
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#include "SDL_dcvideo.h"
/* Functions to be exported */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_dcvideo_h
#define _SDL_dcvideo_h
#include "SDL_mouse.h"
#include "SDL_mutex.h"
#include "../SDL_sysvideo.h"
/* Hidden "this" pointer for the video functions */
#define _THIS SDL_VideoDevice *this
/* Private display data */
struct SDL_PrivateVideoData
{
int w, h;
void *buffer;
};
#endif /* _SDL_dcvideo_h */
/* vi: set ts=4 sw=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment