From 09352e206c9e34926a4895d01435de93fc974d92 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 17 Feb 2002 19:54:28 +0000 Subject: [PATCH] Added initial support for Atari (thanks Patrice!) --- CREDITS | 6 +- Makefile.am | 1 + README | 4 +- README.MiNT | 80 ++ configure.in | 99 ++ docs.html | 1 + src/timer/Makefile.am | 5 + src/timer/mint/SDL_systimer.c | 149 +++ src/timer/mint/SDL_vbltimer.S | 137 +++ src/timer/mint/SDL_vbltimer_s.h | 37 + src/video/Makefile.am | 3 +- src/video/SDL_sysvideo.h | 6 + src/video/SDL_video.c | 6 + src/video/ataricommon/Makefile.am | 31 + src/video/ataricommon/SDL_ataric2p.S | 377 ++++++ src/video/ataricommon/SDL_ataric2p060.c | 203 ++++ src/video/ataricommon/SDL_ataric2p060_c.h | 67 ++ src/video/ataricommon/SDL_ataric2p_s.h | 95 ++ src/video/ataricommon/SDL_atarieddi.S | 47 + src/video/ataricommon/SDL_atarieddi_s.h | 58 + src/video/ataricommon/SDL_atarievents.c | 126 ++ src/video/ataricommon/SDL_atarievents_c.h | 47 + src/video/ataricommon/SDL_atarikeys.h | 145 +++ src/video/ataricommon/SDL_atarimxalloc.c | 56 + src/video/ataricommon/SDL_atarimxalloc_c.h | 49 + src/video/ataricommon/SDL_biosevents.c | 187 +++ src/video/ataricommon/SDL_biosevents_c.h | 46 + src/video/ataricommon/SDL_gemdosevents.c | 192 +++ src/video/ataricommon/SDL_gemdosevents_c.h | 46 + src/video/ataricommon/SDL_ikbdevents.c | 241 ++++ src/video/ataricommon/SDL_ikbdevents_c.h | 46 + src/video/ataricommon/SDL_ikbdinterrupt.S | 220 ++++ src/video/ataricommon/SDL_ikbdinterrupt_s.h | 53 + src/video/ataricommon/SDL_xbiosmouseevents.c | 127 ++ .../ataricommon/SDL_xbiosmouseevents_c.h | 46 + .../ataricommon/SDL_xbiosmouseinterrupt.S | 109 ++ .../ataricommon/SDL_xbiosmouseinterrupt_s.h | 52 + src/video/gem/Makefile.am | 16 + src/video/gem/SDL_gemevents.c | 322 +++++ src/video/gem/SDL_gemevents_c.h | 37 + src/video/gem/SDL_gemmouse.c | 158 +++ src/video/gem/SDL_gemmouse_c.h | 37 + src/video/gem/SDL_gemvideo.c | 1064 +++++++++++++++++ src/video/gem/SDL_gemvideo.h | 112 ++ src/video/gem/SDL_gemwm.c | 115 ++ src/video/gem/SDL_gemwm_c.h | 41 + src/video/xbios/Makefile.am | 10 + src/video/xbios/SDL_xbios.c | 757 ++++++++++++ src/video/xbios/SDL_xbios.h | 127 ++ 49 files changed, 5991 insertions(+), 5 deletions(-) create mode 100644 README.MiNT create mode 100644 src/timer/mint/SDL_systimer.c create mode 100644 src/timer/mint/SDL_vbltimer.S create mode 100644 src/timer/mint/SDL_vbltimer_s.h create mode 100644 src/video/ataricommon/Makefile.am create mode 100644 src/video/ataricommon/SDL_ataric2p.S create mode 100644 src/video/ataricommon/SDL_ataric2p060.c create mode 100644 src/video/ataricommon/SDL_ataric2p060_c.h create mode 100644 src/video/ataricommon/SDL_ataric2p_s.h create mode 100644 src/video/ataricommon/SDL_atarieddi.S create mode 100644 src/video/ataricommon/SDL_atarieddi_s.h create mode 100644 src/video/ataricommon/SDL_atarievents.c create mode 100644 src/video/ataricommon/SDL_atarievents_c.h create mode 100644 src/video/ataricommon/SDL_atarikeys.h create mode 100644 src/video/ataricommon/SDL_atarimxalloc.c create mode 100644 src/video/ataricommon/SDL_atarimxalloc_c.h create mode 100644 src/video/ataricommon/SDL_biosevents.c create mode 100644 src/video/ataricommon/SDL_biosevents_c.h create mode 100644 src/video/ataricommon/SDL_gemdosevents.c create mode 100644 src/video/ataricommon/SDL_gemdosevents_c.h create mode 100644 src/video/ataricommon/SDL_ikbdevents.c create mode 100644 src/video/ataricommon/SDL_ikbdevents_c.h create mode 100644 src/video/ataricommon/SDL_ikbdinterrupt.S create mode 100644 src/video/ataricommon/SDL_ikbdinterrupt_s.h create mode 100644 src/video/ataricommon/SDL_xbiosmouseevents.c create mode 100644 src/video/ataricommon/SDL_xbiosmouseevents_c.h create mode 100644 src/video/ataricommon/SDL_xbiosmouseinterrupt.S create mode 100644 src/video/ataricommon/SDL_xbiosmouseinterrupt_s.h create mode 100644 src/video/gem/Makefile.am create mode 100644 src/video/gem/SDL_gemevents.c create mode 100644 src/video/gem/SDL_gemevents_c.h create mode 100644 src/video/gem/SDL_gemmouse.c create mode 100644 src/video/gem/SDL_gemmouse_c.h create mode 100644 src/video/gem/SDL_gemvideo.c create mode 100644 src/video/gem/SDL_gemvideo.h create mode 100644 src/video/gem/SDL_gemwm.c create mode 100644 src/video/gem/SDL_gemwm_c.h create mode 100644 src/video/xbios/Makefile.am create mode 100644 src/video/xbios/SDL_xbios.c create mode 100644 src/video/xbios/SDL_xbios.h diff --git a/CREDITS b/CREDITS index 2db981e57..aa3530689 100644 --- a/CREDITS +++ b/CREDITS @@ -19,11 +19,13 @@ Thanks to everyone who made this possible, including: * Patrick Trainor and Jim Boucher, for the QNX Neutrino port -* Hannu Viitala for the EPOC port +* Carsten Griwodz for the AIX port * Gabriele Greco, for the Amiga port -* Carsten Griwodz for the AIX port +* Patrice Mandin, for the Atari port + +* Hannu Viitala for the EPOC port * Peter Valchev for nagging me about the OpenBSD port until I got it right. :) diff --git a/Makefile.am b/Makefile.am index 560dbde19..b7cfacae1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,6 +28,7 @@ EXTRA_DIST = \ README.Epoc \ README.MacOS \ README.MacOSX \ + README.MiNT \ README.NanoX \ README.OpenBSD \ README.QNX \ diff --git a/README b/README index 617cd7e22..11a1c0ecf 100644 --- a/README +++ b/README @@ -17,8 +17,8 @@ several other languages, including Ada, Eiffel, ML, Perl, and Python. The current version supports Linux, Windows, BeOS, MacOS, MacOS X, FreeBSD, BSD/OS, Solaris, and IRIX. The code contains support for -Windows CE, OpenBSD, NetBSD, AIX, OSF/Tru64, and QNX, but these are -not yet officially supported. +Atari, Windows CE, OpenBSD, NetBSD, AIX, OSF/Tru64, and QNX, but these +are not yet officially supported. This library is distributed under GNU LGPL version 2, which can be found in the file "COPYING". This license allows you to use SDL diff --git a/README.MiNT b/README.MiNT new file mode 100644 index 000000000..410d84110 --- /dev/null +++ b/README.MiNT @@ -0,0 +1,80 @@ + +============================================================================== +Using the Simple DirectMedia Layer on Atari +============================================================================== + +============================================================================== +I. Building the Simple DirectMedia Layer libraries: + (This step isn't necessary if you have the SDL binary distribution) + + Do the classic configure, with --disable-shared --enable-static and: + + Tos version (should run everywhere): + --disable-audio --disable-threads + Tos does not support threads, so can not support audio, maybe in a future + version audio support will be added via interrupts. + + MiNT version (maybe Magic, only for multitasking OS): + --disable-pthreads --enable-pth + Mint and Magic may supports threads, so audio can be used with current + devices, like Sun audio, or disk-writing support. Like Tos, interrupt + audio without threads is more suited for Atari machines. + + Then you can make ; make install it. + +============================================================================== +II. Building the Simple DirectMedia Layer test programs: + + Do the classic configure, then make. + + Run them ! + +============================================================================== +III. Enjoy! :) + + If you have a project you'd like me to know about, or want to ask questions, + go ahead and join the SDL developer's mailing list by sending e-mail to: + + sdl-request@libsdl.org + + and put "subscribe" into the subject of the message. Or alternatively you + can use the web interface: + + http://www.libsdl.org/mailman/listinfo/sdl + +============================================================================== +IV. What is supported: + +Keyboard (GEMDOS, BIOS, Ikbd) +Mouse (XBIOS, GEM, Ikbd) +Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen)) +Timer (VBL vector) + +- What is missing: +Audio support (TOS) +CDROM support (Metados, /dev/cdrom) +Joystick and joypad support (Hardware) +Threads support (TOS) + +- Driver combinations: +Video Kbd Mouse Timer +xbios ikbd ikbd vbl +xbios gemdos xbios vbl +xbios bios xbios vbl +gem gem gem vbl + +============================================================================== +V. Environment variables: + +SDL_ATARI_EVENTSDRIVER + Set to 'ikbd' to force IKBD 6301 keyboard driver + Set to 'gemdos' to force gemdos keyboard driver + Set to 'bios' to force bios keyboard driver + +SDL_VIDEODRIVER: + Set to 'xbios' to force xbios video driver + Set to 'gem' to force gem video driver + +-- +Patrice Mandin +http://www.multimania.com/pmandin diff --git a/configure.in b/configure.in index 2fdef7c4a..516dcaa26 100644 --- a/configure.in +++ b/configure.in @@ -909,6 +909,49 @@ CheckAAlib() fi } +dnl Set up the Atari Xbios driver +CheckAtariXbiosVideo() +{ + AC_ARG_ENABLE(xbios, +[ --enable-video-xbios use Atari Xbios video driver [default=yes]], + , enable_video_xbios=yes) + video_xbios=no + if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then + video_xbios=yes + CFLAGS="$CFLAGS -DENABLE_XBIOS" + VIDEO_SUBDIRS="$VIDEO_SUBDIRS xbios" + VIDEO_DRIVERS="$VIDEO_DRIVERS xbios/libvideo_xbios.la" + fi +} + +dnl Set up the Atari Gem driver +CheckAtariGemVideo() +{ + AC_ARG_ENABLE(gem, +[ --enable-video-gem use Atari Gem video driver [default=yes]], + , enable_video_gem=yes) + if test x$enable_video = xyes -a x$enable_video_gem = xyes; then + video_gem=no + AC_CHECK_HEADER(gem.h, have_gem_hdr=yes) + AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes) + if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then + video_gem=yes + CFLAGS="$CFLAGS -DENABLE_GEM" + SYSTEM_LIBS="$SYSTEM_LIBS -lgem" + VIDEO_SUBDIRS="$VIDEO_SUBDIRS gem" + VIDEO_DRIVERS="$VIDEO_DRIVERS gem/libvideo_gem.la" + fi + fi +} + +dnl Set up the Atari Bios keyboard driver +CheckAtariBiosEvent() +{ + CFLAGS="$CFLAGS -I\$(top_srcdir)/src/video/ataricommon" + VIDEO_SUBDIRS="$VIDEO_SUBDIRS ataricommon" + VIDEO_DRIVERS="$VIDEO_DRIVERS ataricommon/libvideo_ataricommon.la" +} + dnl rcg04172001 Set up the Null video driver. CheckDummyVideo() { @@ -2165,6 +2208,57 @@ case "$target" in SDL_CFLAGS="$SDL_CFLAGS -F/System/Library/Frameworks/Carbon.framework -F/System/Library/Frameworks/Cocoa.framework" SDL_LIBS="-lSDLmain $SDL_LIBS -framework Carbon -framework Cocoa" ;; + *-*-mint*) + ARCH=mint + CheckDummyVideo + CheckDiskAudio + CheckAtariBiosEvent + CheckAtariXbiosVideo + CheckAtariGemVideo + CheckPTH + # Set up files for the main() stub + COPY_ARCH_SRC(src/main, linux, SDL_main.c) + # Set up files for the audio library + if test x$enable_audio = xyes; then + AUDIO_SUBDIRS="$AUDIO_SUBDIRS sun" + AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la" + fi + # Set up files for the joystick library + # (No joystick support yet) + if test x$enable_joystick = xyes; then + JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy" + JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la" + fi + # Set up files for the cdrom library + if test x$enable_cdrom = xyes; then + CDROM_SUBDIRS="$CDROM_SUBDIRS dummy" + CDROM_DRIVERS="$CDROM_DRIVERS dummy/libcdrom_dummy.la" + fi + # Set up files for the thread library + if test x$enable_threads = xyes; then + if test x$enable_pth = xyes; then + COPY_ARCH_SRC(src/thread, pth, SDL_systhread.c) + COPY_ARCH_SRC(src/thread, pth, SDL_systhread_c.h) + else + COPY_ARCH_SRC(src/thread, generic, SDL_systhread.c) + COPY_ARCH_SRC(src/thread, generic, SDL_systhread_c.h) + fi + COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex.c) + COPY_ARCH_SRC(src/thread, generic, SDL_sysmutex_c.h) + COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c) + COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h) + COPY_ARCH_SRC(src/thread, generic, SDL_syscond.c) + COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h) + fi + # Set up files for the timer library + if test x$enable_timers = xyes; then + COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c) + COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S) + COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h) + fi + # MiNT does not define "unix" + CFLAGS="$CFLAGS -Dunix" + ;; *) AC_MSG_ERROR(Unsupported target: Please add to configure.in) ;; @@ -2185,6 +2279,7 @@ AM_CONDITIONAL(TARGET_BEOS, test $ARCH = beos) AM_CONDITIONAL(TARGET_MACOS, test $ARCH = macos) AM_CONDITIONAL(TARGET_MACOSX, test $ARCH = macosx) AM_CONDITIONAL(TARGET_QNX, test $ARCH = qnx) +AM_CONDITIONAL(TARGET_MINT, test $ARCH = mint) # Set conditional variables for shared and static library selection. # These are not used in any Makefile.am but in sdl-config.in. @@ -2318,10 +2413,14 @@ src/video/bwindow/Makefile src/video/photon/Makefile src/video/epoc/Makefile src/video/dummy/Makefile +src/video/ataricommon/Makefile +src/video/xbios/Makefile +src/video/gem/Makefile src/events/Makefile src/joystick/Makefile src/joystick/amigaos/Makefile src/joystick/beos/Makefile +src/joystick/bsd/Makefile src/joystick/darwin/Makefile src/joystick/dummy/Makefile src/joystick/linux/Makefile diff --git a/docs.html b/docs.html index d1ba67d19..c3861de65 100644 --- a/docs.html +++ b/docs.html @@ -16,6 +16,7 @@

Major changes since SDL 1.0.0: