annotate src/video/ataricommon/SDL_xbiosinterrupt.S @ 4392:2b8c1aea633b SDL-1.2

Fixed bug #898 Jeremiah Morris 2009-12-09 16:07:17 PST No-op GlobalToLocal translations in fullscreen mode On my MacBook Pro running 10.6, I noticed a small upward bias on mouse movement in a fullscreen SDL application. The app uses WarpCursor and GetMouseState in a loop to measure relative movement. I tracked it down to NSWindow's convertBaseToScreen: routine, which added a 2-pixel offset on the Y coordinate instead of the expected (+0,+0) translation. In fullscreen mode, QZ_PrivateWarpCursor() does not translate the desired position through QZ_PrivateGlobalToLocal() before passing it to the Core Graphics system. However, QZ_GetMouseLocation() does call the reverse QZ_PrivateLocalToGlobal() even in fullscreen mode. This asymmetry caused problems each time the mouse was moved.
author Sam Lantinga <slouken@libsdl.org>
date Fri, 11 Dec 2009 15:31:37 +0000
parents 2da8b4494ceb
children
rev   line source
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 /*
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
4159
a1b03ba2fcd0 Updated copyright date
Sam Lantinga <slouken@libsdl.org>
parents: 3857
diff changeset
3 Copyright (C) 1997-2009 Sam Lantinga
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1063
diff changeset
6 modify it under the terms of the GNU Lesser General Public
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1063
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1063
diff changeset
13 Lesser General Public License for more details.
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
1312
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1063
diff changeset
15 You should have received a copy of the GNU Lesser General Public
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1063
diff changeset
16 License along with this library; if not, write to the Free Software
c9b51268668f Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents: 1063
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 Sam Lantinga
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 slouken@libsdl.org
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23 /*
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 * XBIOS mouse & joystick vectors
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 *
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26 * Patrice Mandin
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27 */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29 .text
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
30
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
31 .globl _SDL_AtariXbios_Install
820
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
32 .globl _SDL_AtariXbios_Restore
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33 .globl _SDL_AtariXbios_MouseVector
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 .globl _SDL_AtariXbios_JoystickVector
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35
3857
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
36 .globl _SDL_AtariXbios_mouselock
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
37 .globl _SDL_AtariXbios_mouseb
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
38 .globl _SDL_AtariXbios_mousex
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
39 .globl _SDL_AtariXbios_mousey
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
40 .globl _SDL_AtariXbios_joystick
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
41
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
42 /*--- Vector installer ---*/
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44 _SDL_AtariXbios_Install:
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 movel sp@(4),a0
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47 /* Stop interrupts */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49 movew #0x2700,sr
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51 /* Save old mouse vector, set our routine */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52
820
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
53 clrl oldmousevector
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
54 movel sp@(8),d0
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
55 beqs no_new_mouse_vector
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
56 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
57 movel a0@(16),d1
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
58 movel d1,oldmousevector
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
59 #else
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 movel a0@(16),oldmousevector
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
61 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 movel d0,a0@(16)
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
63 no_new_mouse_vector:
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
64
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
65 /* Save old joystick vector, set our routine */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
66
820
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
67 clrl oldjoystickvector
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 movel sp@(12),d0
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
69 beqs no_new_joystick_vector
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
70 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
71 movel a0@(24),d1
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
72 movel d1,oldjoystickvector
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
73 #else
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 movel a0@(24),oldjoystickvector
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
75 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 movel d0,a0@(24)
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 no_new_joystick_vector:
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
79 /* Restart interrupts */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
81 movew #0x2300,sr
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 rts
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84
820
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
85 /*--- Vector restorer ---*/
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
86
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
87 _SDL_AtariXbios_Restore:
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
88 movel sp@(4),a0
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
89
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
90 /* Stop interrupts */
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
91
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
92 movew #0x2700,sr
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
93
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
94 /* Restore mouse vector */
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
95
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
96 movel oldmousevector,d0
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
97 beqs no_restore_mouse
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
98 movel d0,a0@(16)
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
99 no_restore_mouse:
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
100
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
101 /* Restore joystick vector */
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
102
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
103 movel oldjoystickvector,d0
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
104 beqs no_restore_joystick
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
105 movel d0,a0@(24)
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
106 no_restore_joystick:
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
107
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
108 /* Restart interrupts */
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
109
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
110 movew #0x2300,sr
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
111
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
112 rts
0b9b4bf3c1e7 Important crash fix: system vectors for mouse/joystick were not restored
Patrice Mandin <patmandin@gmail.com>
parents: 305
diff changeset
113
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
114 /*--- Our mouse vector ---*/
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
115
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
116 .text
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
117 .even
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
118 .ascii "XBRA"
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
119 .ascii "LSDL"
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
120 .comm oldmousevector,4*1
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
121 _SDL_AtariXbios_MouseVector:
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
122 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
123 lea sp@(-8),sp
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
124 moveml d0-d1,sp@
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
125 #else
987
d9f3b5bb7870 Do not use registers when not necessary
Patrice Mandin <patmandin@gmail.com>
parents: 820
diff changeset
126 movel d0,sp@-
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
127 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
128
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
129 /* Mouse buttons */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
130 moveb (a0),d0
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
131 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
132 andl #3,d0
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
133 #else
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
134 andw #3,d0
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
135 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
136 movew d0,_SDL_AtariXbios_mouseb
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
137
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
138 /* X movement */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
139 moveb a0@(1),d0
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
140 extw d0
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
141 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
142 movew _SDL_AtariXbios_mousex,d1
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
143 addl d1,d0
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
144 movew d0,_SDL_AtariXbios_mousex
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
145 #else
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
146 addw d0,_SDL_AtariXbios_mousex
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
147 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
148
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
149 /* Y movement */
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
150 moveb a0@(2),d0
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
151 extw d0
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
152 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
153 movew _SDL_AtariXbios_mousey,d1
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
154 addl d1,d0
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
155 movew d0,_SDL_AtariXbios_mousey
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
156 #else
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
157 addw d0,_SDL_AtariXbios_mousey
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
158 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
159
3857
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
160 /* Lock mouse position ? */
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
161 tstw _SDL_AtariXbios_mouselock
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
162 beq.s no_mouse_lock
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
163 clrb a0@(1)
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
164 clrb a0@(2)
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
165 no_mouse_lock:
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
166
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
167 /* Jump through old vector */
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
168 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
169 moveml sp@,d0-d1
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
170 lea sp@(8),sp
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
171 #else
987
d9f3b5bb7870 Do not use registers when not necessary
Patrice Mandin <patmandin@gmail.com>
parents: 820
diff changeset
172 movel sp@+,d0
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
173 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
174
987
d9f3b5bb7870 Do not use registers when not necessary
Patrice Mandin <patmandin@gmail.com>
parents: 820
diff changeset
175 movel oldmousevector,sp@-
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
176 rts
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
177
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
178 .data
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
179 .even
3857
be01e0b82dca Allow mouse to be locked when grabbed with GEM driver
Patrice Mandin <patmandin@gmail.com>
parents: 1312
diff changeset
180 .comm _SDL_AtariXbios_mouselock,2*1
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
181 .comm _SDL_AtariXbios_mousex,2*1
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
182 .comm _SDL_AtariXbios_mousey,2*1
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
183 .comm _SDL_AtariXbios_mouseb,2*1
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
184
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
185 /*--- Our joystick vector ---*/
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
186
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
187 .text
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
188 .even
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
189 .ascii "XBRA"
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
190 .ascii "LSDL"
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
191 .comm oldjoystickvector,4*1
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
192 _SDL_AtariXbios_JoystickVector:
987
d9f3b5bb7870 Do not use registers when not necessary
Patrice Mandin <patmandin@gmail.com>
parents: 820
diff changeset
193 movel d0,sp@-
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
194
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
195 /* New joystick state */
1063
0fb50bfaea7f Used wrong offset in joystick packet
Patrice Mandin <patmandin@gmail.com>
parents: 987
diff changeset
196 moveb a0@(2),d0
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
197 #if defined(__mcoldfire__)
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
198 andl #0x8f,d0
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
199 #else
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
200 andw #0x8f,d0
4379
2da8b4494ceb Adapt XBIOS asm routine for Coldfire
Patrice Mandin <patmandin@gmail.com>
parents: 4159
diff changeset
201 #endif
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
202 movew d0,_SDL_AtariXbios_joystick
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
203
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
204 /* Jump through old vector */
987
d9f3b5bb7870 Do not use registers when not necessary
Patrice Mandin <patmandin@gmail.com>
parents: 820
diff changeset
205 movel sp@+,d0
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
206
987
d9f3b5bb7870 Do not use registers when not necessary
Patrice Mandin <patmandin@gmail.com>
parents: 820
diff changeset
207 movel oldjoystickvector,sp@-
305
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
208 rts
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
209
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
210 .data
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
211 .even
9c6613983e85 Atari port cleanups from Patrice
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
212 .comm _SDL_AtariXbios_joystick,2*1