diff 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
line wrap: on
line diff
--- a/src/audio/mint/SDL_mintaudio.c	Sat Sep 16 09:15:11 2006 +0000
+++ b/src/audio/mint/SDL_mintaudio.c	Sat Sep 16 10:38:09 2006 +0000
@@ -32,6 +32,7 @@
 #include <mint/osbind.h>
 #include <mint/falcon.h>
 #include <mint/mintbind.h>
+#include <mint/cookie.h>
 
 #include "SDL_audio.h"
 #include "SDL_mintaudio.h"
@@ -46,6 +47,7 @@
 volatile unsigned short SDL_MintAudio_mutex;
 volatile unsigned long SDL_MintAudio_clocktics;
 cookie_stfa_t	*SDL_MintAudio_stfa;
+unsigned short SDL_MintAudio_hasfpu;
 
 /* MiNT thread variables */
 SDL_bool SDL_MintAudio_mint_present;
@@ -139,6 +141,26 @@
 	return MINTAUDIO_freqcount-1;
 }
 
+/* Check if FPU is present */
+void SDL_MintAudio_CheckFpu(void)
+{
+	unsigned long cookie_fpu;
+
+	SDL_MintAudio_hasfpu = 0;
+	if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
+		return;
+	}
+	switch ((cookie_fpu>>16)&0xfffe) {
+		case 2:
+		case 4:
+		case 6:
+		case 8:
+		case 16:
+			SDL_MintAudio_hasfpu = 1;
+			break;
+	}
+}
+
 /* The thread function, used under MiNT with xbios */
 int SDL_MintAudio_Thread(long param)
 {