Updated Atari port for new system headers (thanks Patrice!)
authorSam Lantinga <slouken@libsdl.org>
Sat, 07 Dec 2002 06:54:47 +0000
changeset 557 0ce5a68278fd
parent 556 08588ee79a67
child 558 2312d983e1fe
Updated Atari port for new system headers (thanks Patrice!)
README.MiNT
configure.in
src/SDL.c
src/audio/mint/SDL_mintaudio.c
src/joystick/mint/SDL_sysjoystick.c
src/timer/mint/SDL_systimer.c
src/video/ataricommon/SDL_ataric2p060.c
src/video/ataricommon/SDL_atarievents.c
src/video/gem/SDL_gemvideo.c
src/video/gem/SDL_gemvideo.h
src/video/gem/SDL_gemwm.c
src/video/xbios/SDL_xbios.c
--- a/README.MiNT	Sat Dec 07 06:51:03 2002 +0000
+++ b/README.MiNT	Sat Dec 07 06:54:47 2002 +0000
@@ -47,7 +47,7 @@
 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 @@
 
 - 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 @@
 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).
 
--- a/configure.in	Sat Dec 07 06:51:03 2002 +0000
+++ b/configure.in	Sat Dec 07 06:54:47 2002 +0000
@@ -38,8 +38,7 @@
 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 @@
         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"
--- a/src/SDL.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/SDL.c	Sat Dec 07 06:54:47 2002 +0000
@@ -28,6 +28,9 @@
 /* Initialization code for SDL */
 
 #include <stdlib.h>		/* For getenv() */
+#ifdef ENABLE_PTH
+#include <pth.h>
+#endif
 
 #include "SDL.h"
 #include "SDL_endian.h"
--- a/src/audio/mint/SDL_mintaudio.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/audio/mint/SDL_mintaudio.c	Sat Dec 07 06:54:47 2002 +0000
@@ -11,7 +11,7 @@
 /* Mint includes */
 #include <mint/osbind.h>
 #include <mint/falcon.h>
-#include <sys/cookie.h>
+#include <mint/cookie.h>
 
 #include "SDL_endian.h"
 #include "SDL_audio.h"
--- a/src/joystick/mint/SDL_sysjoystick.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/joystick/mint/SDL_sysjoystick.c	Sat Dec 07 06:54:47 2002 +0000
@@ -35,7 +35,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <sys/cookie.h>
+#include <mint/cookie.h>
 #include <mint/osbind.h>
 
 #include "SDL_types.h"
--- a/src/timer/mint/SDL_systimer.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/timer/mint/SDL_systimer.c	Sat Dec 07 06:54:47 2002 +0000
@@ -40,7 +40,7 @@
 #include <errno.h>
 
 #include <mint/osbind.h>
-#include <sysvars.h>
+#include <mint/sysvars.h>
 
 #include "SDL_error.h"
 #include "SDL_timer.h"
--- a/src/video/ataricommon/SDL_ataric2p060.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/video/ataricommon/SDL_ataric2p060.c	Sat Dec 07 06:54:47 2002 +0000
@@ -35,7 +35,7 @@
 
 #include <string.h>
 
-#include <sys/cookie.h>
+#include <mint/cookie.h>
 
 #include "SDL_ataric2p_s.h"
 
--- a/src/video/ataricommon/SDL_atarievents.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/video/ataricommon/SDL_atarievents.c	Sat Dec 07 06:54:47 2002 +0000
@@ -36,7 +36,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <sys/cookie.h>
+#include <mint/cookie.h>
 
 #include "SDL.h"
 #include "SDL_sysevents.h"
--- a/src/video/gem/SDL_gemvideo.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/video/gem/SDL_gemvideo.c	Sat Dec 07 06:54:47 2002 +0000
@@ -42,7 +42,7 @@
 #include <gem.h>
 #include <gemx.h>
 #include <mint/osbind.h>
-#include <sys/cookie.h>
+#include <mint/cookie.h>
 
 #include "SDL.h"
 #include "SDL_error.h"
@@ -105,7 +105,6 @@
 
 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 @@
 	}
 
 	/* Test if AES available */
-	ap_id = appl_init();
-	if (ap_id == -1)
+	if (appl_init() == -1)
 		return 0;
 
 	appl_exit();
@@ -374,14 +372,13 @@
 	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];
 		
--- a/src/video/gem/SDL_gemvideo.h	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/video/gem/SDL_gemvideo.h	Sat Dec 07 06:54:47 2002 +0000
@@ -56,8 +56,7 @@
 	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 @@
 #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)
--- a/src/video/gem/SDL_gemwm.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/video/gem/SDL_gemwm.c	Sat Dec 07 06:54:47 2002 +0000
@@ -96,7 +96,7 @@
 		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 @@
 	message[6] = ICONWIDTH;
 	message[7] = ICONHEIGHT;
 
-	appl_write(GEM_ap_id, sizeof(message), message);
+	appl_write(gl_apid, sizeof(message), message);
 
 	return 1;
 }
--- a/src/video/xbios/SDL_xbios.c	Sat Dec 07 06:51:03 2002 +0000
+++ b/src/video/xbios/SDL_xbios.c	Sat Dec 07 06:54:47 2002 +0000
@@ -38,7 +38,7 @@
 #include <unistd.h>
 
 /* Mint includes */
-#include <sys/cookie.h>
+#include <mint/cookie.h>
 #include <mint/osbind.h>
 #include <mint/falcon.h>