Mercurial > sdl-ios-xcode
comparison src/audio/mint/SDL_mintaudio_it.S @ 2027:d48ead2d2ba5
Save/restore FPU registers in interrupt
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Sat, 16 Sep 2006 16:59:46 +0000 |
parents | c83fa1c650dd |
children | 29e07f91bc1f |
comparison
equal
deleted
inserted
replaced
2026:a5d0758f88d8 | 2027:d48ead2d2ba5 |
---|---|
38 .globl _SDL_MintAudio_mutex | 38 .globl _SDL_MintAudio_mutex |
39 .globl _SDL_MintAudio_audiobuf | 39 .globl _SDL_MintAudio_audiobuf |
40 .globl _SDL_MintAudio_numbuf | 40 .globl _SDL_MintAudio_numbuf |
41 .globl _SDL_MintAudio_audiosize | 41 .globl _SDL_MintAudio_audiosize |
42 .globl _SDL_MintAudio_clocktics | 42 .globl _SDL_MintAudio_clocktics |
43 .globl _SDL_MintAudio_hasfpu | |
43 | 44 |
44 .globl _SDL_MintAudio_stfa | 45 .globl _SDL_MintAudio_stfa |
45 | 46 |
46 /* | 47 /* |
47 How it works: | 48 How it works: |
83 /* Swap buffers */ | 84 /* Swap buffers */ |
84 eorw #1,_SDL_MintAudio_numbuf | 85 eorw #1,_SDL_MintAudio_numbuf |
85 | 86 |
86 moveml d0-d7/a0-a6,sp@- | 87 moveml d0-d7/a0-a6,sp@- |
87 | 88 |
89 /* Save FPU if needed */ | |
90 tstw _SDL_MintAudio_hasfpu | |
91 beqs SDL_MintAudio_Xbios_nofpu1 | |
92 .chip 68060 | |
93 fsave sp@- | |
94 fmoveml fpcr/fpsr/fpiar,sp@- | |
95 fmovemx fp0-fp7,sp@- | |
96 .chip 68000 | |
97 SDL_MintAudio_Xbios_nofpu1: | |
98 | |
88 /* Callback */ | 99 /* Callback */ |
89 jsr _SDL_MintAudio_Callback | 100 jsr _SDL_MintAudio_Callback |
101 | |
102 /* Restore FPU if needed */ | |
103 tstw _SDL_MintAudio_hasfpu | |
104 beqs SDL_MintAudio_Xbios_nofpu2 | |
105 .chip 68060 | |
106 fmovemx sp@+,fp0-fp7 | |
107 fmoveml sp@+,fpcr/fpsr/fpiar | |
108 frestore sp@+ | |
109 .chip 68000 | |
110 SDL_MintAudio_Xbios_nofpu2: | |
90 | 111 |
91 /* Reserve space for registers */ | 112 /* Reserve space for registers */ |
92 subl #savamt,savptr | 113 subl #savamt,savptr |
93 | 114 |
94 /* Set new buffer */ | 115 /* Set new buffer */ |
135 notw _SDL_MintAudio_mutex | 156 notw _SDL_MintAudio_mutex |
136 | 157 |
137 /* Swap buffers */ | 158 /* Swap buffers */ |
138 eorw #1,_SDL_MintAudio_numbuf | 159 eorw #1,_SDL_MintAudio_numbuf |
139 | 160 |
140 moveml d0-d7/a0-a6,sp@- | 161 moveml d0-d1/a0-a1,sp@- |
162 | |
163 /* Save FPU if needed */ | |
164 tstw _SDL_MintAudio_hasfpu | |
165 beqs SDL_MintAudio_Dma8_nofpu1 | |
166 .chip 68060 | |
167 fsave sp@- | |
168 fmoveml fpcr/fpsr/fpiar,sp@- | |
169 fmovemx fp0-fp7,sp@- | |
170 .chip 68000 | |
171 SDL_MintAudio_Dma8_nofpu1: | |
141 | 172 |
142 /* Callback */ | 173 /* Callback */ |
143 jsr _SDL_MintAudio_Callback | 174 jsr _SDL_MintAudio_Callback |
175 | |
176 /* Restore FPU if needed */ | |
177 tstw _SDL_MintAudio_hasfpu | |
178 beqs SDL_MintAudio_Dma8_nofpu2 | |
179 .chip 68060 | |
180 fmovemx sp@+,fp0-fp7 | |
181 fmoveml sp@+,fpcr/fpsr/fpiar | |
182 frestore sp@+ | |
183 .chip 68000 | |
184 SDL_MintAudio_Dma8_nofpu2: | |
144 | 185 |
145 /* Set new buffer */ | 186 /* Set new buffer */ |
146 | 187 |
147 moveq #0,d0 | 188 moveq #0,d0 |
148 | 189 |
167 rorl #8,d1 | 208 rorl #8,d1 |
168 moveb d1,a0@(0x11) | 209 moveb d1,a0@(0x11) |
169 rorl #8,d1 | 210 rorl #8,d1 |
170 moveb d1,a0@(0x0f) | 211 moveb d1,a0@(0x0f) |
171 | 212 |
172 moveml sp@+,d0-d7/a0-a6 | 213 moveml sp@+,d0-d1/a0-a1 |
173 | 214 |
174 clrw _SDL_MintAudio_mutex | 215 clrw _SDL_MintAudio_mutex |
175 SDL_MintAudio_Dma8End: | 216 SDL_MintAudio_Dma8End: |
176 rte | 217 rte |
177 | 218 |
193 /* Swap buffers */ | 234 /* Swap buffers */ |
194 eorw #1,_SDL_MintAudio_numbuf | 235 eorw #1,_SDL_MintAudio_numbuf |
195 | 236 |
196 moveml d0-d7/a0-a6,sp@- | 237 moveml d0-d7/a0-a6,sp@- |
197 | 238 |
239 /* Save FPU if needed */ | |
240 tstw _SDL_MintAudio_hasfpu | |
241 beqs SDL_MintAudio_Stfa_nofpu1 | |
242 .chip 68060 | |
243 fsave sp@- | |
244 fmoveml fpcr/fpsr/fpiar,sp@- | |
245 fmovemx fp0-fp7,sp@- | |
246 .chip 68000 | |
247 SDL_MintAudio_Stfa_nofpu1: | |
248 | |
198 /* Callback */ | 249 /* Callback */ |
199 jsr _SDL_MintAudio_Callback | 250 jsr _SDL_MintAudio_Callback |
251 | |
252 /* Restore FPU if needed */ | |
253 tstw _SDL_MintAudio_hasfpu | |
254 beqs SDL_MintAudio_Stfa_nofpu2 | |
255 .chip 68060 | |
256 fmovemx sp@+,fp0-fp7 | |
257 fmoveml sp@+,fpcr/fpsr/fpiar | |
258 frestore sp@+ | |
259 .chip 68000 | |
260 SDL_MintAudio_Stfa_nofpu2: | |
200 | 261 |
201 /* Set new buffer */ | 262 /* Set new buffer */ |
202 | 263 |
203 moveq #0,d0 | 264 moveq #0,d0 |
204 movel _SDL_MintAudio_stfa,a1 | 265 movel _SDL_MintAudio_stfa,a1 |