src/video/ataricommon/SDL_xbiosinterrupt.S
changeset 305 9c6613983e85
child 820 0b9b4bf3c1e7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/video/ataricommon/SDL_xbiosinterrupt.S	Sun Mar 10 03:33:59 2002 +0000
     1.3 @@ -0,0 +1,141 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002  Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +
    1.26 +#ifdef SAVE_RCSID
    1.27 +static char rcsid =
    1.28 + "@(#) $Id$";
    1.29 +#endif
    1.30 +
    1.31 +/*
    1.32 + *	XBIOS mouse & joystick vectors
    1.33 + *
    1.34 + *	Patrice Mandin
    1.35 + */
    1.36 +
    1.37 +	.text
    1.38 +
    1.39 +	.globl	_SDL_AtariXbios_Install
    1.40 +	.globl	_SDL_AtariXbios_MouseVector
    1.41 +	.globl	_SDL_AtariXbios_JoystickVector
    1.42 +
    1.43 +	.globl	_SDL_AtariXbios_mouseb
    1.44 +	.globl	_SDL_AtariXbios_mousex
    1.45 +	.globl	_SDL_AtariXbios_mousey
    1.46 +	.globl	_SDL_AtariXbios_joystick
    1.47 +
    1.48 +/*--- Vector installer ---*/
    1.49 +
    1.50 +_SDL_AtariXbios_Install:
    1.51 +	movel	sp@(4),a0
    1.52 +
    1.53 +	/* Stop interrupts */
    1.54 +
    1.55 +	movew	#0x2700,sr
    1.56 +
    1.57 +	/* Save old mouse vector, set our routine */
    1.58 +
    1.59 +	movel	sp@(8),d0
    1.60 +	beqs	no_new_mouse_vector
    1.61 +	movel	a0@(16),oldmousevector
    1.62 +	movel	d0,a0@(16)
    1.63 +no_new_mouse_vector:
    1.64 +
    1.65 +	/* Save old joystick vector, set our routine */
    1.66 +
    1.67 +	movel	sp@(12),d0
    1.68 +	beqs	no_new_joystick_vector
    1.69 +	movel	a0@(24),oldjoystickvector
    1.70 +	movel	d0,a0@(24)
    1.71 +no_new_joystick_vector:
    1.72 +
    1.73 +	/* Restart interrupts */
    1.74 +
    1.75 +	movew	#0x2300,sr
    1.76 +
    1.77 +	rts
    1.78 +
    1.79 +/*--- Our mouse vector ---*/
    1.80 +
    1.81 +	.text
    1.82 +	.even
    1.83 +	.ascii "XBRA"
    1.84 +	.ascii "LSDL"
    1.85 +	.comm	oldmousevector,4*1
    1.86 +_SDL_AtariXbios_MouseVector:
    1.87 +	moveml	d0/a1,sp@-
    1.88 +
    1.89 +	/* Mouse buttons */
    1.90 +	moveb	(a0),d0
    1.91 +	andw	#3,d0
    1.92 +	movew	d0,_SDL_AtariXbios_mouseb
    1.93 +
    1.94 +	/* X movement */
    1.95 +	moveb	a0@(1),d0
    1.96 +	extw	d0
    1.97 +	addw	d0,_SDL_AtariXbios_mousex
    1.98 +
    1.99 +	/* Y movement */
   1.100 +	moveb	a0@(2),d0
   1.101 +	extw	d0
   1.102 +	addw	d0,_SDL_AtariXbios_mousey
   1.103 +
   1.104 +	/* Jump through old vector */
   1.105 +	movel	oldmousevector,a1
   1.106 +	jsr	(a1)
   1.107 +
   1.108 +	moveml	sp@+,d0/a1
   1.109 +	rts
   1.110 +
   1.111 +	.data
   1.112 +	.even
   1.113 +	.comm	_SDL_AtariXbios_mousex,2*1
   1.114 +	.even
   1.115 +	.comm	_SDL_AtariXbios_mousey,2*1
   1.116 +	.even
   1.117 +	.comm	_SDL_AtariXbios_mouseb,2*1
   1.118 +
   1.119 +/*--- Our joystick vector ---*/
   1.120 +
   1.121 +	.text
   1.122 +	.even
   1.123 +	.ascii "XBRA"
   1.124 +	.ascii "LSDL"
   1.125 +	.comm	oldjoystickvector,4*1
   1.126 +_SDL_AtariXbios_JoystickVector:
   1.127 +	moveml	d0/a1,sp@-
   1.128 +
   1.129 +	/* New joystick state */
   1.130 +	moveb	a0@(1),d0
   1.131 +	andw	#0x8f,d0
   1.132 +	movew	d0,_SDL_AtariXbios_joystick
   1.133 +
   1.134 +	/* Jump through old vector */
   1.135 +	movel	oldjoystickvector,a1
   1.136 +	jsr	(a1)
   1.137 +
   1.138 +	moveml	sp@+,d0/a1
   1.139 +	rts
   1.140 +
   1.141 +	.data
   1.142 +	.even
   1.143 +	.comm	_SDL_AtariXbios_joystick,2*1
   1.144 +