2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2009 Sam Lantinga
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
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 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #define _vbl_queue 0x456
34 .globl _SDL_AtariVblInstall
35 .globl _SDL_AtariVblUninstall
37 .globl _SDL_MintAudio_hasfpu
39 /*--- Vector installer ---*/
42 movel sp@(4),my_vector
46 movel _hz_200.w, _SDL_Atari_hz200
52 /* Read vbl_queue pointer */
55 /* Search a free place */
61 dbra d0,bcl_search_place
67 /* Then install ourselves */
73 /* Restart interrupts */
78 /*--- Vector uninstaller ---*/
80 _SDL_AtariVblUninstall:
91 /* Read vbl_queue pointer */
94 /* Search where we are */
103 dbra d1,bcl2_search_place
105 /* Restart interrupts */
114 movel _hz_200.w, _SDL_Atari_hz200
116 /* Verify if this is not already running */
122 moveml d0-d7/a0-a6,sp@-
124 /* Save FPU if needed */
125 tstw _SDL_MintAudio_hasfpu
126 beqs SDL_AtariVbl_nofpu1
129 fmoveml fpcr/fpsr/fpiar,sp@-
137 /* Restore FPU if needed */
138 tstw _SDL_MintAudio_hasfpu
139 beqs SDL_AtariVbl_Xbios_nofpu2
142 fmoveml sp@+,fpcr/fpsr/fpiar
145 SDL_AtariVbl_Xbios_nofpu2:
147 moveml sp@+,d0-d7/a0-a6
155 .comm _SDL_Atari_hz200,4*1