Call old interrupt when receiving MIDI stuff
authorPatrice Mandin <patmandin@gmail.com>
Wed, 29 Jun 2005 16:18:46 +0000
changeset 1081369dcdb52d70
parent 1080 1988b04af19b
child 1082 48436ffdf677
Call old interrupt when receiving MIDI stuff
src/video/ataricommon/SDL_ikbdinterrupt.S
     1.1 --- a/src/video/ataricommon/SDL_ikbdinterrupt.S	Wed Jun 29 16:18:08 2005 +0000
     1.2 +++ b/src/video/ataricommon/SDL_ikbdinterrupt.S	Wed Jun 29 16:18:46 2005 +0000
     1.3 @@ -121,11 +121,11 @@
     1.4  	movel	sp@+,a0
     1.5  	rts
     1.6  
     1.7 -	.data
     1.8 +	.bss
     1.9 +
    1.10  	.even
    1.11 -	.comm	ikbd_ierb,4*1
    1.12 -	.even
    1.13 -	.comm	ikbd_imrb,4*1
    1.14 +	.comm	ikbd_ierb,1
    1.15 +	.comm	ikbd_imrb,1
    1.16  
    1.17  /*--- Our custom IKBD vector ---*/
    1.18  
    1.19 @@ -135,31 +135,36 @@
    1.20  	.ascii	"LSDL"
    1.21  	.comm	old_ikbd,4*1
    1.22  ikbd:
    1.23 +	| Check if source is IKBD or MIDI
    1.24 +	
    1.25 +	btst	#0,0xfffffc00.w
    1.26 +	beqs	ikbd_oldmidi
    1.27 +
    1.28  	moveml	d0-d1/a0,sp@-
    1.29  	moveb	0xfffffc02:w,d0
    1.30  
    1.31 -	| paquet joystick ?
    1.32 +	| Joystick packet ?
    1.33  	
    1.34  	cmpb	#0xff,d0
    1.35 -	beq	ikbd_yes_joystick
    1.36 +	beqs	ikbd_yes_joystick
    1.37  
    1.38 -	| paquet souris ?
    1.39 +	| Mouse packet ?
    1.40  
    1.41  	cmpb	#0xf8,d0
    1.42 -	bmi	ikbd_no_mouse
    1.43 +	bmis	ikbd_no_mouse
    1.44  	cmpb	#0xfc,d0
    1.45 -	bpl	ikbd_no_mouse
    1.46 +	bpls	ikbd_no_mouse
    1.47  
    1.48  ikbd_yes_mouse:
    1.49  	andw	#3,d0
    1.50  	movew	d0,_SDL_AtariIkbd_mouseb
    1.51  
    1.52  	movel	#ikbd_mousex,0x118:w
    1.53 -	bra	ikbd_endit
    1.54 +	bras	ikbd_endit_stack
    1.55  
    1.56  ikbd_yes_joystick:
    1.57  	movel	#ikbd_joystick,0x118:w
    1.58 -	bra	ikbd_endit
    1.59 +	bras	ikbd_endit_stack
    1.60  
    1.61  ikbd_no_mouse:
    1.62  	moveb	d0,d1
    1.63 @@ -167,60 +172,77 @@
    1.64  	andl	#0x7f,d1
    1.65  	tas	d0
    1.66  	spl	a0@(0,d1:w)
    1.67 -ikbd_fin:
    1.68  
    1.69 -	| Fin interruption
    1.70 +	| End of interrupt
    1.71  
    1.72 +ikbd_endit_stack:
    1.73 +	moveml	sp@+,d0-d1/a0
    1.74  ikbd_endit:
    1.75 -	moveml	sp@+,d0-d1/a0
    1.76  	bclr	#6,0xfffffa11:w
    1.77  	rte
    1.78  
    1.79 +	| Call old MIDI interrupt
    1.80 +
    1.81 +ikbd_oldmidi:
    1.82 +	movel	old_ikbd,sp@-
    1.83 +	rts
    1.84 +
    1.85  ikbd_mousex:
    1.86 -	movel	d0,sp@-
    1.87 +	| Check if source is IKBD or MIDI
    1.88 +	
    1.89 +	btst	#0,0xfffffc00.w
    1.90 +	beqs	ikbd_oldmidi
    1.91 +
    1.92 +	movew	d0,sp@-
    1.93  
    1.94  	moveb	0xfffffc02:w,d0
    1.95  	extw	d0
    1.96  	addw	d0,_SDL_AtariIkbd_mousex
    1.97  
    1.98 -	movel	sp@+,d0
    1.99 +	movew	sp@+,d0
   1.100  
   1.101  	movel	#ikbd_mousey,0x118:w
   1.102 -	bclr	#6,0xfffffa11:w
   1.103 -	rte
   1.104 +	bras	ikbd_endit
   1.105  
   1.106  ikbd_mousey:
   1.107 -	movel	d0,sp@-
   1.108 +	| Check if source is IKBD or MIDI
   1.109 +	
   1.110 +	btst	#0,0xfffffc00.w
   1.111 +	beqs	ikbd_oldmidi
   1.112 +
   1.113 +	movew	d0,sp@-
   1.114  
   1.115  	moveb	0xfffffc02:w,d0
   1.116  	extw	d0
   1.117  	addw	d0,_SDL_AtariIkbd_mousey
   1.118  
   1.119 -	movel	sp@+,d0
   1.120 +	movew	sp@+,d0
   1.121  
   1.122  	movel	#ikbd,0x118:w
   1.123 -	bclr	#6,0xfffffa11:w
   1.124 -	rte
   1.125 +	bras	ikbd_endit
   1.126  
   1.127  ikbd_joystick:
   1.128 +	| Check if source is IKBD or MIDI
   1.129 +	
   1.130 +	btst	#0,0xfffffc00.w
   1.131 +	beqs	ikbd_oldmidi
   1.132 +
   1.133  	moveb	0xfffffc02:w,_SDL_AtariIkbd_joystick+1
   1.134  
   1.135  	movel	#ikbd,0x118:w
   1.136 -	bclr	#6,0xfffffa11:w
   1.137 -	rte
   1.138 +	bras	ikbd_endit
   1.139  
   1.140  	.data
   1.141  	
   1.142  	.even
   1.143  _SDL_AtariIkbd_enabled:
   1.144  	.word	0
   1.145 +
   1.146 +	.bss
   1.147 +
   1.148  	.even
   1.149  	.comm	_SDL_AtariIkbd_keyboard,128
   1.150 -	.even
   1.151 -	.comm	_SDL_AtariIkbd_mousex,2*1
   1.152 -	.even
   1.153 -	.comm	_SDL_AtariIkbd_mousey,2*1
   1.154 -	.even
   1.155 -	.comm	_SDL_AtariIkbd_mouseb,2*1
   1.156 -	.even
   1.157 -	.comm	_SDL_AtariIkbd_joystick,2*1
   1.158 +	.comm	_SDL_AtariIkbd_mousex,2
   1.159 +	.comm	_SDL_AtariIkbd_mousey,2
   1.160 +	.comm	_SDL_AtariIkbd_mouseb,2
   1.161 +	.comm	_SDL_AtariIkbd_joystick,2