f16spec.cpp File Reference

(r1785/r1282)

#include "camtypes.h"
#include "f16spec.h"
#include <math.h>

Go to the source code of this file.

Defines

#define TORADIANS(x)   ((x)/180.0*PI)
#define PENTIUM_TEST   0

Functions

 DECLARE_SOURCE ("$Revision: 1282 $")
BOOL IsMathCoprocInstalled ()
 Gives a hint to those that need to know things about FPU performance.
BOOL InitMaths ()
 Initialises the maths class. Windows version tests for maths coprocessor. Also sets up maths exception vectors.

Variables

static BOOL MathCoprocInstalled = FALSE
 Flag used to determine if there is a maths coprocessor present. Its default setting is FALSE i.e. there is no coprocessor installed. This is mainly used to hint GDraw how to do things most efficiently.


Define Documentation

#define PENTIUM_TEST   0
 

Definition at line 134 of file f16spec.cpp.

#define TORADIANS  )     ((x)/180.0*PI)
 

Definition at line 113 of file f16spec.cpp.


Function Documentation

DECLARE_SOURCE "$Revision: 1282 $"   ) 
 

BOOL InitMaths  ) 
 

Initialises the maths class. Windows version tests for maths coprocessor. Also sets up maths exception vectors.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/4/93
Parameters:
None. [INPUTS]
None [OUTPUTS]
Returns:
A Boolean if initialisation was ok.

Errors: None.

Definition at line 249 of file f16spec.cpp.

00250 {
00251 
00252     MathCoprocInstalled = IsMathCoprocInstalled();
00253 
00254     #if PENTIUM_TEST
00255     // now check for faulty Pentium
00256     if ( !IsFloatingPointBugFree() )
00257     {
00258         Error::SetError( _R(IDE_BAD_PENTIUM) );
00259         InformError();
00260     }
00261     #endif
00262 
00263     return TRUE;
00264 }          

BOOL IsMathCoprocInstalled  ) 
 

Gives a hint to those that need to know things about FPU performance.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/1/95
Returns:
TRUE if the hardware supports a real FPU, FALSE if emulated.

Errors: None.

Definition at line 213 of file f16spec.cpp.

00214 {
00215 #if defined(__WXMSW__)
00216     // the theoretically proper way to detect an FPU is to delve into the reigstry thus:
00217     // NT  entry lives at HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\FloatingPointProcessor\0
00218     // W95 entry lives at HKEY_LOCAL_MACHINE\Enum\Root\*PNP0C01\0000NDP (M7 liable to change)
00219     // W32s is only available by thunking to WinFlags() (ug).
00220     // Instead, we use a tiny bit of .asm, as suggested by Mr-Asm himself, Gavin
00221 
00222     WORD RegCR0;
00223     _asm
00224     {
00225         smsw    RegCR0                  // bit 2 of CR0 is the EM bit, set for emulation
00226     }
00227 
00228     return (RegCR0 & 4) ? FALSE : TRUE;
00229 #else
00230     return TRUE;
00231 #endif
00232 }


Variable Documentation

BOOL MathCoprocInstalled = FALSE [static]
 

Flag used to determine if there is a maths coprocessor present. Its default setting is FALSE i.e. there is no coprocessor installed. This is mainly used to hint GDraw how to do things most efficiently.

Author:
Mario_Shamtani (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/6/93
See also:
InitMaths()
Returns:
Errors: None.

Definition at line 131 of file f16spec.cpp.


Generated on Sat Nov 10 03:49:08 2007 for Camelot by  doxygen 1.4.4