src/video/ataricommon/SDL_xbiosmouseinterrupt.S
author Sam Lantinga <slouken@libsdl.org>
Wed, 27 Feb 2002 16:15:34 +0000
changeset 287 e4bd0cf95506
parent 281 c5010ab8ba35
child 297 f6ffac90895c
permissions -rw-r--r--
From: Patrice Mandin <pmandin@caramail.com>
Subject: [SDL] [PATCH] Little cleanups for Atari port
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Library General Public
     7     License as published by the Free Software Foundation; either
     8     version 2 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Library General Public License for more details.
    14 
    15     You should have received a copy of the GNU Library General Public
    16     License along with this library; if not, write to the Free
    17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 
    23 #ifdef SAVE_RCSID
    24 static char rcsid =
    25  "@(#) $Id$";
    26 #endif
    27 
    28 /*
    29  *	IKBD 6301 mouse vector
    30  *
    31  *	Patrice Mandin
    32  */
    33 
    34 	.text
    35 
    36 	.globl	_SDL_AtariXbiosMouseInstall
    37 	.globl	_SDL_AtariXbiosMouseVector
    38 
    39 	.globl	_SDL_AtariXbios_mouseb
    40 	.globl	_SDL_AtariXbios_mousex
    41 	.globl	_SDL_AtariXbios_mousey
    42 
    43 /*--- Vector installer ---*/
    44 
    45 _SDL_AtariXbiosMouseInstall:
    46 	movel	sp@(4),a0
    47 	movel	sp@(8),a1
    48 
    49 	/* Stop interrupts */
    50 
    51 	movew	#0x2700,sr
    52 
    53 	/* Save old vector */
    54 
    55 	movel	a0@(16),oldvector
    56 
    57 	/* Set our routine */
    58 
    59 	movel	a1,a0@(16)
    60 
    61 	/* Restart interrupts */
    62 
    63 	movew	#0x2300,sr
    64 
    65 	rts
    66 
    67 /*--- Our mouse vector ---*/
    68 
    69 	.text
    70 	.even
    71 	.ascii "XBRA"
    72 	.ascii "LSDL"
    73 	.comm	oldvector,4*1
    74 _SDL_AtariXbiosMouseVector:
    75 	moveml	d0/a1,sp@-
    76 
    77 	/* Mouse buttons */
    78 	moveb	(a0),d0
    79 	andw	#3,d0
    80 	movew	d0,_SDL_AtariXbios_mouseb
    81 
    82 	/* X movement */
    83 	moveb	a0@(1),d0
    84 	extw	d0
    85 	addw	d0,_SDL_AtariXbios_mousex
    86 
    87 	/* Y movement */
    88 	moveb	a0@(2),d0
    89 	extw	d0
    90 	addw	d0,_SDL_AtariXbios_mousey
    91 
    92 	/* Jump through old vector */
    93 	movel	oldvector,a1
    94 	jsr	(a1)
    95 
    96 	moveml	sp@+,d0/a1
    97 	rts
    98 
    99 	.data
   100 	.even
   101 	.comm	_SDL_AtariXbios_mousex,2*1
   102 	.even
   103 	.comm	_SDL_AtariXbios_mousey,2*1
   104 	.even
   105 	.comm	_SDL_AtariXbios_mouseb,2*1
   106