comparison src/timer/mint/SDL_vbltimer.S @ 2116:b42abf0a50bc

Avoid switch to supervisor mode in SDL_GetTicks, by updating system counter from vbl interrupt
author Patrice Mandin <patmandin@gmail.com>
date Sat, 09 Jun 2007 19:58:41 +0000
parents eb5e61b72da3
children 99210400e8b9
comparison
equal deleted inserted replaced
2115:502ae1f2a577 2116:b42abf0a50bc
25 * 25 *
26 * Patrice Mandin 26 * Patrice Mandin
27 */ 27 */
28 28
29 #define _vbl_queue 0x456 29 #define _vbl_queue 0x456
30 #define _hz_200 0x4ba
30 31
31 .text 32 .text
32 33
33 .globl _SDL_AtariVblInstall 34 .globl _SDL_AtariVblInstall
34 .globl _SDL_AtariVblUninstall 35 .globl _SDL_AtariVblUninstall
40 _SDL_AtariVblInstall: 41 _SDL_AtariVblInstall:
41 movel sp@(4),my_vector 42 movel sp@(4),my_vector
42 lea _my_vbl,a0 43 lea _my_vbl,a0
43 44
44 clrw vbl_mutex 45 clrw vbl_mutex
46 movel _hz_200.w, _SDL_Atari_hz200
45 47
46 /* Stop interrupts */ 48 /* Stop interrupts */
47 49
48 movew #0x2700,sr 50 movew #0x2700,sr
49 51
106 rts 108 rts
107 109
108 /*--- Our vbl ---*/ 110 /*--- Our vbl ---*/
109 111
110 _my_vbl: 112 _my_vbl:
113 /* Update _hz_200 */
114 movel _hz_200.w, _SDL_Atari_hz200
115
111 /* Verify if this is not already running */ 116 /* Verify if this is not already running */
112 117
113 tstw vbl_mutex 118 tstw vbl_mutex
114 bnes vbl_end 119 bnes vbl_end
115 notw vbl_mutex 120 notw vbl_mutex
145 vbl_end: 150 vbl_end:
146 rts 151 rts
147 152
148 .data 153 .data
149 .even 154 .even
155 .comm _SDL_Atari_hz200,4*1
156 .even
150 .comm vbl_mutex,2*1 157 .comm vbl_mutex,2*1
151 .even 158 .even
152 .comm my_vector,4*1 159 .comm my_vector,4*1