Updated Atari port for new system headers (thanks Patrice!)
authorSam Lantinga <slouken@libsdl.org>
Sat, 07 Dec 2002 06:54:47 +0000
changeset 5570ce5a68278fd
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
     1.1 --- a/README.MiNT	Sat Dec 07 06:51:03 2002 +0000
     1.2 +++ b/README.MiNT	Sat Dec 07 06:54:47 2002 +0000
     1.3 @@ -47,7 +47,7 @@
     1.4  Keyboard (GEMDOS, BIOS, GEM, Ikbd)
     1.5  Mouse (XBIOS, GEM, Ikbd)
     1.6  Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen))
     1.7 -Timer (VBL vector)
     1.8 +Timer (VBL vector, GNU pth library)
     1.9  Joystick and joypad support (Ikbd, Hardware)
    1.10  Audio support (Hardware, XBIOS, GSXB, /dev/audio if threads enabled)
    1.11  Threads support (Multitasking OS only via GNU pth library)
    1.12 @@ -57,14 +57,17 @@
    1.13  
    1.14  - Driver combinations:
    1.15  Video	Kbd	Mouse	Timer	Jstick	Joypads
    1.16 -xbios	ikbd	ikbd	vbl	ikbd	hardware
    1.17 -xbios	gemdos	xbios	vbl	xbios	hardware
    1.18 -xbios	bios	xbios	vbl	xbios	hardware
    1.19 -gem	gem	gem(*)	vbl	xbios	hardware
    1.20 +xbios	ikbd	ikbd	vbl(2)	ikbd	hardware
    1.21 +xbios	gemdos	xbios	vbl(2)	xbios	hardware
    1.22 +xbios	bios	xbios	vbl(2)	xbios	hardware
    1.23 +gem	gem	gem(1)	vbl(2)	xbios	hardware
    1.24  
    1.25 -(*) GEM does not report relative mouse motion, so xbios mouse driver is used
    1.26 +(1) GEM does not report relative mouse motion, so xbios mouse driver is used
    1.27  to report this type event.
    1.28  
    1.29 +(2) If you build SDL with threads using the GNU pth library, timers are
    1.30 +supported via the pth library.
    1.31 +
    1.32  ==============================================================================
    1.33  V.  Environment variables:
    1.34  
    1.35 @@ -154,6 +157,9 @@
    1.36  Joypad driver:
    1.37  	Available if _MCH cookie is STE or Falcon.
    1.38  
    1.39 +PTH timer driver:
    1.40 +	Available with multitasking OS.
    1.41 +
    1.42  VBL timer driver:
    1.43  	Available on all machines (I think).
    1.44  
     2.1 --- a/configure.in	Sat Dec 07 06:51:03 2002 +0000
     2.2 +++ b/configure.in	Sat Dec 07 06:54:47 2002 +0000
     2.3 @@ -38,8 +38,7 @@
     2.4  AC_SUBST(LT_AGE)
     2.5  
     2.6  dnl Detect the canonical host and target build environment
     2.7 -AC_CANONICAL_HOST
     2.8 -AC_CANONICAL_TARGET
     2.9 +AC_CANONICAL_SYSTEM
    2.10  
    2.11  dnl Setup for automake
    2.12  AM_INIT_AUTOMAKE(SDL, $SDL_VERSION)
    2.13 @@ -2437,9 +2436,13 @@
    2.14          fi
    2.15          # Set up files for the timer library
    2.16          if test x$enable_timers = xyes; then
    2.17 -            COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
    2.18 -            COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S)
    2.19 -            COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h)
    2.20 +            if test x$enable_threads = xyes -a x$enable_pth = xyes; then
    2.21 +                COPY_ARCH_SRC(src/timer, linux, SDL_systimer.c)
    2.22 +            else
    2.23 +                COPY_ARCH_SRC(src/timer, mint, SDL_systimer.c)
    2.24 +                COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer.S)
    2.25 +                COPY_ARCH_SRC(src/timer, mint, SDL_vbltimer_s.h)
    2.26 +            fi
    2.27          fi
    2.28          # MiNT does not define "unix"
    2.29          CFLAGS="$CFLAGS -Dunix"
     3.1 --- a/src/SDL.c	Sat Dec 07 06:51:03 2002 +0000
     3.2 +++ b/src/SDL.c	Sat Dec 07 06:54:47 2002 +0000
     3.3 @@ -28,6 +28,9 @@
     3.4  /* Initialization code for SDL */
     3.5  
     3.6  #include <stdlib.h>		/* For getenv() */
     3.7 +#ifdef ENABLE_PTH
     3.8 +#include <pth.h>
     3.9 +#endif
    3.10  
    3.11  #include "SDL.h"
    3.12  #include "SDL_endian.h"
     4.1 --- a/src/audio/mint/SDL_mintaudio.c	Sat Dec 07 06:51:03 2002 +0000
     4.2 +++ b/src/audio/mint/SDL_mintaudio.c	Sat Dec 07 06:54:47 2002 +0000
     4.3 @@ -11,7 +11,7 @@
     4.4  /* Mint includes */
     4.5  #include <mint/osbind.h>
     4.6  #include <mint/falcon.h>
     4.7 -#include <sys/cookie.h>
     4.8 +#include <mint/cookie.h>
     4.9  
    4.10  #include "SDL_endian.h"
    4.11  #include "SDL_audio.h"
     5.1 --- a/src/joystick/mint/SDL_sysjoystick.c	Sat Dec 07 06:51:03 2002 +0000
     5.2 +++ b/src/joystick/mint/SDL_sysjoystick.c	Sat Dec 07 06:54:47 2002 +0000
     5.3 @@ -35,7 +35,7 @@
     5.4  #include <stdlib.h>
     5.5  #include <string.h>
     5.6  
     5.7 -#include <sys/cookie.h>
     5.8 +#include <mint/cookie.h>
     5.9  #include <mint/osbind.h>
    5.10  
    5.11  #include "SDL_types.h"
     6.1 --- a/src/timer/mint/SDL_systimer.c	Sat Dec 07 06:51:03 2002 +0000
     6.2 +++ b/src/timer/mint/SDL_systimer.c	Sat Dec 07 06:54:47 2002 +0000
     6.3 @@ -40,7 +40,7 @@
     6.4  #include <errno.h>
     6.5  
     6.6  #include <mint/osbind.h>
     6.7 -#include <sysvars.h>
     6.8 +#include <mint/sysvars.h>
     6.9  
    6.10  #include "SDL_error.h"
    6.11  #include "SDL_timer.h"
     7.1 --- a/src/video/ataricommon/SDL_ataric2p060.c	Sat Dec 07 06:51:03 2002 +0000
     7.2 +++ b/src/video/ataricommon/SDL_ataric2p060.c	Sat Dec 07 06:54:47 2002 +0000
     7.3 @@ -35,7 +35,7 @@
     7.4  
     7.5  #include <string.h>
     7.6  
     7.7 -#include <sys/cookie.h>
     7.8 +#include <mint/cookie.h>
     7.9  
    7.10  #include "SDL_ataric2p_s.h"
    7.11  
     8.1 --- a/src/video/ataricommon/SDL_atarievents.c	Sat Dec 07 06:51:03 2002 +0000
     8.2 +++ b/src/video/ataricommon/SDL_atarievents.c	Sat Dec 07 06:54:47 2002 +0000
     8.3 @@ -36,7 +36,7 @@
     8.4  #include <stdlib.h>
     8.5  #include <string.h>
     8.6  
     8.7 -#include <sys/cookie.h>
     8.8 +#include <mint/cookie.h>
     8.9  
    8.10  #include "SDL.h"
    8.11  #include "SDL_sysevents.h"
     9.1 --- a/src/video/gem/SDL_gemvideo.c	Sat Dec 07 06:51:03 2002 +0000
     9.2 +++ b/src/video/gem/SDL_gemvideo.c	Sat Dec 07 06:54:47 2002 +0000
     9.3 @@ -42,7 +42,7 @@
     9.4  #include <gem.h>
     9.5  #include <gemx.h>
     9.6  #include <mint/osbind.h>
     9.7 -#include <sys/cookie.h>
     9.8 +#include <mint/cookie.h>
     9.9  
    9.10  #include "SDL.h"
    9.11  #include "SDL_error.h"
    9.12 @@ -105,7 +105,6 @@
    9.13  
    9.14  static int GEM_Available(void)
    9.15  {
    9.16 -	short ap_id;
    9.17  	const char *envr = getenv("SDL_VIDEODRIVER");
    9.18  
    9.19  	/* Check if user asked a different video driver */
    9.20 @@ -114,8 +113,7 @@
    9.21  	}
    9.22  
    9.23  	/* Test if AES available */
    9.24 -	ap_id = appl_init();
    9.25 -	if (ap_id == -1)
    9.26 +	if (appl_init() == -1)
    9.27  		return 0;
    9.28  
    9.29  	appl_exit();
    9.30 @@ -374,14 +372,13 @@
    9.31  	short work_in[12], work_out[272], dummy;
    9.32  
    9.33  	/* Open AES (Application Environment Services) */
    9.34 -	GEM_ap_id = appl_init();
    9.35 -	if (GEM_ap_id == -1) {
    9.36 +	if (appl_init() == -1) {
    9.37  		fprintf(stderr,"Can not open AES\n");
    9.38  		return 1;
    9.39  	}
    9.40  
    9.41  	/* Read version and features */
    9.42 -	GEM_version = aes_global[0];
    9.43 +	GEM_version = aes_params.global[0];
    9.44  	if (GEM_version >= 0x0400) {
    9.45  		short ap_gout[4];
    9.46  		
    10.1 --- a/src/video/gem/SDL_gemvideo.h	Sat Dec 07 06:51:03 2002 +0000
    10.2 +++ b/src/video/gem/SDL_gemvideo.h	Sat Dec 07 06:54:47 2002 +0000
    10.3 @@ -56,8 +56,7 @@
    10.4  	Uint32 screensize;
    10.5  	MFDB	src_mfdb, dst_mfdb;	/* VDI MFDB for bitblt */
    10.6  	short	blit_coords[8];		/* Coordinates for bitblt */
    10.7 -	/* Gem infos */
    10.8 -	short ap_id;				/* AES handle */
    10.9 +	/* GEM infos */
   10.10  	short desk_x, desk_y;		/* Desktop properties */
   10.11  	short desk_w, desk_h;
   10.12  	short win_handle;			/* Our window handle */
   10.13 @@ -92,7 +91,7 @@
   10.14  #define VDI_src_mfdb		(this->hidden->src_mfdb)
   10.15  #define VDI_dst_mfdb		(this->hidden->dst_mfdb)
   10.16  #define VDI_blit_coords		(this->hidden->blit_coords)
   10.17 -#define GEM_ap_id			(this->hidden->ap_id)
   10.18 +
   10.19  #define GEM_desk_x			(this->hidden->desk_x)
   10.20  #define GEM_desk_y			(this->hidden->desk_y)
   10.21  #define GEM_desk_w			(this->hidden->desk_w)
    11.1 --- a/src/video/gem/SDL_gemwm.c	Sat Dec 07 06:51:03 2002 +0000
    11.2 +++ b/src/video/gem/SDL_gemwm.c	Sat Dec 07 06:54:47 2002 +0000
    11.3 @@ -96,7 +96,7 @@
    11.4  		return 0;
    11.5  
    11.6  	message[0] = WM_ICONIFY;
    11.7 -	message[1] = GEM_ap_id;
    11.8 +	message[1] = gl_apid;
    11.9  	message[2] = 0;
   11.10  	message[3] = GEM_handle;
   11.11  	message[4] = 0;
   11.12 @@ -104,7 +104,7 @@
   11.13  	message[6] = ICONWIDTH;
   11.14  	message[7] = ICONHEIGHT;
   11.15  
   11.16 -	appl_write(GEM_ap_id, sizeof(message), message);
   11.17 +	appl_write(gl_apid, sizeof(message), message);
   11.18  
   11.19  	return 1;
   11.20  }
    12.1 --- a/src/video/xbios/SDL_xbios.c	Sat Dec 07 06:51:03 2002 +0000
    12.2 +++ b/src/video/xbios/SDL_xbios.c	Sat Dec 07 06:54:47 2002 +0000
    12.3 @@ -38,7 +38,7 @@
    12.4  #include <unistd.h>
    12.5  
    12.6  /* Mint includes */
    12.7 -#include <sys/cookie.h>
    12.8 +#include <mint/cookie.h>
    12.9  #include <mint/osbind.h>
   12.10  #include <mint/falcon.h>
   12.11