comparison src/audio/mint/SDL_mintaudio.c @ 3865:e958a003b69b SDL-1.2

Add function to check FPU presence
author Patrice Mandin <patmandin@gmail.com>
date Sat, 16 Sep 2006 10:38:09 +0000
parents 63a45a87a57e
children a1b03ba2fcd0
comparison
equal deleted inserted replaced
3864:ea2a327b92d7 3865:e958a003b69b
30 #include <unistd.h> 30 #include <unistd.h>
31 31
32 #include <mint/osbind.h> 32 #include <mint/osbind.h>
33 #include <mint/falcon.h> 33 #include <mint/falcon.h>
34 #include <mint/mintbind.h> 34 #include <mint/mintbind.h>
35 #include <mint/cookie.h>
35 36
36 #include "SDL_audio.h" 37 #include "SDL_audio.h"
37 #include "SDL_mintaudio.h" 38 #include "SDL_mintaudio.h"
38 #include "SDL_mintaudio_stfa.h" 39 #include "SDL_mintaudio_stfa.h"
39 40
44 unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ 45 unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
45 volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */ 46 volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
46 volatile unsigned short SDL_MintAudio_mutex; 47 volatile unsigned short SDL_MintAudio_mutex;
47 volatile unsigned long SDL_MintAudio_clocktics; 48 volatile unsigned long SDL_MintAudio_clocktics;
48 cookie_stfa_t *SDL_MintAudio_stfa; 49 cookie_stfa_t *SDL_MintAudio_stfa;
50 unsigned short SDL_MintAudio_hasfpu;
49 51
50 /* MiNT thread variables */ 52 /* MiNT thread variables */
51 SDL_bool SDL_MintAudio_mint_present; 53 SDL_bool SDL_MintAudio_mint_present;
52 SDL_bool SDL_MintAudio_quit_thread; 54 SDL_bool SDL_MintAudio_quit_thread;
53 SDL_bool SDL_MintAudio_thread_finished; 55 SDL_bool SDL_MintAudio_thread_finished;
135 } 137 }
136 } 138 }
137 139
138 /* Not in the array, give the latest */ 140 /* Not in the array, give the latest */
139 return MINTAUDIO_freqcount-1; 141 return MINTAUDIO_freqcount-1;
142 }
143
144 /* Check if FPU is present */
145 void SDL_MintAudio_CheckFpu(void)
146 {
147 unsigned long cookie_fpu;
148
149 SDL_MintAudio_hasfpu = 0;
150 if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
151 return;
152 }
153 switch ((cookie_fpu>>16)&0xfffe) {
154 case 2:
155 case 4:
156 case 6:
157 case 8:
158 case 16:
159 SDL_MintAudio_hasfpu = 1;
160 break;
161 }
140 } 162 }
141 163
142 /* The thread function, used under MiNT with xbios */ 164 /* The thread function, used under MiNT with xbios */
143 int SDL_MintAudio_Thread(long param) 165 int SDL_MintAudio_Thread(long param)
144 { 166 {