From 82478ed0c09f51e2807035e911c50bde8b868260 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 7 Dec 2002 06:54:47 +0000 Subject: [PATCH] Updated Atari port for new system headers (thanks Patrice!) --- README.MiNT | 18 ++++++++++++------ configure.in | 13 ++++++++----- src/SDL.c | 3 +++ src/audio/mint/SDL_mintaudio.c | 2 +- src/joystick/mint/SDL_sysjoystick.c | 2 +- src/timer/mint/SDL_systimer.c | 2 +- src/video/ataricommon/SDL_ataric2p060.c | 2 +- src/video/ataricommon/SDL_atarievents.c | 2 +- src/video/gem/SDL_gemvideo.c | 11 ++++------- src/video/gem/SDL_gemvideo.h | 5 ++--- src/video/gem/SDL_gemwm.c | 4 ++-- src/video/xbios/SDL_xbios.c | 2 +- 12 files changed, 37 insertions(+), 29 deletions(-) diff --git a/README.MiNT b/README.MiNT index 4a573f2da..47ba057aa 100644 --- a/README.MiNT +++ b/README.MiNT @@ -47,7 +47,7 @@ IV. What is supported: Keyboard (GEMDOS, BIOS, GEM, Ikbd) Mouse (XBIOS, GEM, Ikbd) Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen)) -Timer (VBL vector) +Timer (VBL vector, GNU pth library) Joystick and joypad support (Ikbd, Hardware) Audio support (Hardware, XBIOS, GSXB, /dev/audio if threads enabled) Threads support (Multitasking OS only via GNU pth library) @@ -57,14 +57,17 @@ CDROM support (Metados, /dev/cdrom) - Driver combinations: Video Kbd Mouse Timer Jstick Joypads -xbios ikbd ikbd vbl ikbd hardware -xbios gemdos xbios vbl xbios hardware -xbios bios xbios vbl xbios hardware -gem gem gem(*) vbl xbios hardware +xbios ikbd ikbd vbl(2) ikbd hardware +xbios gemdos xbios vbl(2) xbios hardware +xbios bios xbios vbl(2) xbios hardware +gem gem gem(1) vbl(2) xbios hardware -(*) GEM does not report relative mouse motion, so xbios mouse driver is used +(1) GEM does not report relative mouse motion, so xbios mouse driver is used to report this type event. +(2) If you build SDL with threads using the GNU pth library, timers are +supported via the pth library. + ============================================================================== V. Environment variables: @@ -154,6 +157,9 @@ Mouse and joystick xbios driver: Joypad driver: Available if _MCH cookie is STE or Falcon. +PTH timer driver: + Available with multitasking OS. + VBL timer driver: Available on all machines (I think). diff --git a/configure.in b/configure.in index ad8fb7c34..748414259 100644 --- a/configure.in +++ b/configure.in @@ -38,8 +38,7 @@ AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) dnl Detect the canonical host and target build environment -AC_CANONICAL_HOST -AC_CANONICAL_TARGET +AC_CANONICAL_SYSTEM dnl Setup for automake AM_INIT_AUTOMAKE(SDL, $SDL_VERSION) @@ -2437,9 +2436,13 @@ case "$target" in 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) + if test x$enable_threads = xyes -a x$enable_pth = xyes; then + COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c) + else + 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 fi # MiNT does not define "unix" CFLAGS="$CFLAGS -Dunix" diff --git a/src/SDL.c b/src/SDL.c index 4609acf69..e1a65297e 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -28,6 +28,9 @@ static char rcsid = /* Initialization code for SDL */ #include /* For getenv() */ +#ifdef ENABLE_PTH +#include +#endif #include "SDL.h" #include "SDL_endian.h" diff --git a/src/audio/mint/SDL_mintaudio.c b/src/audio/mint/SDL_mintaudio.c index e2d6a9f1c..abec45412 100644 --- a/src/audio/mint/SDL_mintaudio.c +++ b/src/audio/mint/SDL_mintaudio.c @@ -11,7 +11,7 @@ /* Mint includes */ #include #include -#include +#include #include "SDL_endian.h" #include "SDL_audio.h" diff --git a/src/joystick/mint/SDL_sysjoystick.c b/src/joystick/mint/SDL_sysjoystick.c index 88291037c..f2d117199 100644 --- a/src/joystick/mint/SDL_sysjoystick.c +++ b/src/joystick/mint/SDL_sysjoystick.c @@ -35,7 +35,7 @@ static char rcsid = #include #include -#include +#include #include #include "SDL_types.h" diff --git a/src/timer/mint/SDL_systimer.c b/src/timer/mint/SDL_systimer.c index 8e0c4204c..7f29ccd89 100644 --- a/src/timer/mint/SDL_systimer.c +++ b/src/timer/mint/SDL_systimer.c @@ -40,7 +40,7 @@ static char rcsid = #include #include -#include +#include #include "SDL_error.h" #include "SDL_timer.h" diff --git a/src/video/ataricommon/SDL_ataric2p060.c b/src/video/ataricommon/SDL_ataric2p060.c index d8aa0dd9d..e4511d8a3 100644 --- a/src/video/ataricommon/SDL_ataric2p060.c +++ b/src/video/ataricommon/SDL_ataric2p060.c @@ -35,7 +35,7 @@ static char rcsid = #include -#include +#include #include "SDL_ataric2p_s.h" diff --git a/src/video/ataricommon/SDL_atarievents.c b/src/video/ataricommon/SDL_atarievents.c index c0bc9a651..77e4aef16 100644 --- a/src/video/ataricommon/SDL_atarievents.c +++ b/src/video/ataricommon/SDL_atarievents.c @@ -36,7 +36,7 @@ static char rcsid = #include #include -#include +#include #include "SDL.h" #include "SDL_sysevents.h" diff --git a/src/video/gem/SDL_gemvideo.c b/src/video/gem/SDL_gemvideo.c index 3a761a1a1..23a5f0266 100644 --- a/src/video/gem/SDL_gemvideo.c +++ b/src/video/gem/SDL_gemvideo.c @@ -42,7 +42,7 @@ static char rcsid = #include #include #include -#include +#include #include "SDL.h" #include "SDL_error.h" @@ -105,7 +105,6 @@ static void refresh_window(_THIS, int winhandle, short *rect); static int GEM_Available(void) { - short ap_id; const char *envr = getenv("SDL_VIDEODRIVER"); /* Check if user asked a different video driver */ @@ -114,8 +113,7 @@ static int GEM_Available(void) } /* Test if AES available */ - ap_id = appl_init(); - if (ap_id == -1) + if (appl_init() == -1) return 0; appl_exit(); @@ -374,14 +372,13 @@ int GEM_VideoInit(_THIS, SDL_PixelFormat *vformat) short work_in[12], work_out[272], dummy; /* Open AES (Application Environment Services) */ - GEM_ap_id = appl_init(); - if (GEM_ap_id == -1) { + if (appl_init() == -1) { fprintf(stderr,"Can not open AES\n"); return 1; } /* Read version and features */ - GEM_version = aes_global[0]; + GEM_version = aes_params.global[0]; if (GEM_version >= 0x0400) { short ap_gout[4]; diff --git a/src/video/gem/SDL_gemvideo.h b/src/video/gem/SDL_gemvideo.h index 029690013..2d5f97cc5 100644 --- a/src/video/gem/SDL_gemvideo.h +++ b/src/video/gem/SDL_gemvideo.h @@ -56,8 +56,7 @@ struct SDL_PrivateVideoData { Uint32 screensize; MFDB src_mfdb, dst_mfdb; /* VDI MFDB for bitblt */ short blit_coords[8]; /* Coordinates for bitblt */ - /* Gem infos */ - short ap_id; /* AES handle */ + /* GEM infos */ short desk_x, desk_y; /* Desktop properties */ short desk_w, desk_h; short win_handle; /* Our window handle */ @@ -92,7 +91,7 @@ struct SDL_PrivateVideoData { #define VDI_src_mfdb (this->hidden->src_mfdb) #define VDI_dst_mfdb (this->hidden->dst_mfdb) #define VDI_blit_coords (this->hidden->blit_coords) -#define GEM_ap_id (this->hidden->ap_id) + #define GEM_desk_x (this->hidden->desk_x) #define GEM_desk_y (this->hidden->desk_y) #define GEM_desk_w (this->hidden->desk_w) diff --git a/src/video/gem/SDL_gemwm.c b/src/video/gem/SDL_gemwm.c index 9eb1210cf..4878fa9af 100644 --- a/src/video/gem/SDL_gemwm.c +++ b/src/video/gem/SDL_gemwm.c @@ -96,7 +96,7 @@ int GEM_IconifyWindow(_THIS) return 0; message[0] = WM_ICONIFY; - message[1] = GEM_ap_id; + message[1] = gl_apid; message[2] = 0; message[3] = GEM_handle; message[4] = 0; @@ -104,7 +104,7 @@ int GEM_IconifyWindow(_THIS) message[6] = ICONWIDTH; message[7] = ICONHEIGHT; - appl_write(GEM_ap_id, sizeof(message), message); + appl_write(gl_apid, sizeof(message), message); return 1; } diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c index 7f3894a6f..98dd2ba01 100644 --- a/src/video/xbios/SDL_xbios.c +++ b/src/video/xbios/SDL_xbios.c @@ -38,7 +38,7 @@ static char rcsid = #include /* Mint includes */ -#include +#include #include #include