Adapt XBIOS asm routine for Coldfire SDL-1.2
authorPatrice Mandin
Sat, 07 Nov 2009 12:20:01 +0000
branchSDL-1.2
changeset 43792da8b4494ceb
parent 4378 dae8891fae2d
child 4380 66aea42c3541
Adapt XBIOS asm routine for Coldfire
src/video/ataricommon/SDL_xbiosinterrupt.S
     1.1 --- a/src/video/ataricommon/SDL_xbiosinterrupt.S	Fri Nov 06 22:43:51 2009 +0000
     1.2 +++ b/src/video/ataricommon/SDL_xbiosinterrupt.S	Sat Nov 07 12:20:01 2009 +0000
     1.3 @@ -53,7 +53,12 @@
     1.4  	clrl	oldmousevector
     1.5  	movel	sp@(8),d0
     1.6  	beqs	no_new_mouse_vector
     1.7 +#if defined(__mcoldfire__)
     1.8 +	movel	a0@(16),d1
     1.9 +	movel	d1,oldmousevector
    1.10 +#else
    1.11  	movel	a0@(16),oldmousevector
    1.12 +#endif
    1.13  	movel	d0,a0@(16)
    1.14  no_new_mouse_vector:
    1.15  
    1.16 @@ -62,7 +67,12 @@
    1.17  	clrl	oldjoystickvector
    1.18  	movel	sp@(12),d0
    1.19  	beqs	no_new_joystick_vector
    1.20 +#if defined(__mcoldfire__)
    1.21 +	movel	a0@(24),d1
    1.22 +	movel	d1,oldjoystickvector
    1.23 +#else
    1.24  	movel	a0@(24),oldjoystickvector
    1.25 +#endif
    1.26  	movel	d0,a0@(24)
    1.27  no_new_joystick_vector:
    1.28  
    1.29 @@ -109,22 +119,43 @@
    1.30  	.ascii "LSDL"
    1.31  	.comm	oldmousevector,4*1
    1.32  _SDL_AtariXbios_MouseVector:
    1.33 +#if defined(__mcoldfire__)
    1.34 +	lea	sp@(-8),sp
    1.35 +	moveml	d0-d1,sp@
    1.36 +#else
    1.37  	movel	d0,sp@-
    1.38 +#endif
    1.39  
    1.40  	/* Mouse buttons */
    1.41  	moveb	(a0),d0
    1.42 +#if defined(__mcoldfire__)
    1.43 +	andl	#3,d0
    1.44 +#else
    1.45  	andw	#3,d0
    1.46 +#endif
    1.47  	movew	d0,_SDL_AtariXbios_mouseb
    1.48  
    1.49  	/* X movement */
    1.50  	moveb	a0@(1),d0
    1.51  	extw	d0
    1.52 +#if defined(__mcoldfire__)
    1.53 +	movew	_SDL_AtariXbios_mousex,d1
    1.54 +	addl	d1,d0
    1.55 +	movew	d0,_SDL_AtariXbios_mousex
    1.56 +#else
    1.57  	addw	d0,_SDL_AtariXbios_mousex
    1.58 +#endif
    1.59  
    1.60  	/* Y movement */
    1.61  	moveb	a0@(2),d0
    1.62  	extw	d0
    1.63 +#if defined(__mcoldfire__)
    1.64 +	movew	_SDL_AtariXbios_mousey,d1
    1.65 +	addl	d1,d0
    1.66 +	movew	d0,_SDL_AtariXbios_mousey
    1.67 +#else
    1.68  	addw	d0,_SDL_AtariXbios_mousey
    1.69 +#endif
    1.70  
    1.71  	/* Lock mouse position ? */
    1.72  	tstw	_SDL_AtariXbios_mouselock
    1.73 @@ -134,7 +165,12 @@
    1.74  no_mouse_lock:
    1.75  
    1.76  	/* Jump through old vector */
    1.77 +#if defined(__mcoldfire__)
    1.78 +	moveml	sp@,d0-d1
    1.79 +	lea	sp@(8),sp
    1.80 +#else
    1.81  	movel	sp@+,d0
    1.82 +#endif
    1.83  
    1.84  	movel	oldmousevector,sp@-
    1.85  	rts
    1.86 @@ -158,7 +194,11 @@
    1.87  
    1.88  	/* New joystick state */
    1.89  	moveb	a0@(2),d0
    1.90 +#if defined(__mcoldfire__)
    1.91 +	andl	#0x8f,d0
    1.92 +#else
    1.93  	andw	#0x8f,d0
    1.94 +#endif
    1.95  	movew	d0,_SDL_AtariXbios_joystick
    1.96  
    1.97  	/* Jump through old vector */