1 //  ---------------------------------------------------------------------------
2 //  This file is part of reSID, a MOS6581 SID emulator engine.
3 //  Copyright (C) 1999  Dag Lem <resid@nimrod.no>
4 //
5 //  This program is free software; you can redistribute it and/or modify
6 //  it under the terms of the GNU General Public License as published by
7 //  the Free Software Foundation; either version 2 of the License, or
8 //  (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 //  ---------------------------------------------------------------------------
19 
20 #ifndef __SIDDEFS_FP_H__
21 #define __SIDDEFS_FP_H__
22 
23 #ifndef M_PI
24 #define M_PI    3.14159265358979323846
25 #define M_PI_f  3.14159265358979323846f
26 #else
27 #define M_PI_f  ((float) M_PI)
28 #endif
29 
30 #ifndef M_LN2
31 #define M_LN2   0.69314718055994530942
32 #define M_LN2_f 0.69314718055994530942f
33 #else
34 #define M_LN2_f ((float) M_LN2)
35 #endif
36 
37 // Define bool, true, and false for C++ compilers that lack these keywords.
38 #define RESID_HAVE_BOOL 1
39 
40 #if !RESID_HAVE_BOOL
41 typedef int bool;
42 const bool true = 1;
43 const bool false = 0;
44 #endif
45 
46 // We could have used the smallest possible data type for each SID register,
47 // however this would give a slower engine because of data type conversions.
48 // An int is assumed to be at least 32 bits (necessary in the types reg24,
49 // cycle_count, and sound_sample). GNU does not support 16-bit machines
50 // (GNU Coding Standards: Portability between CPUs), so this should be
51 // a valid assumption.
52 
53 typedef unsigned int reg4;
54 typedef unsigned int reg8;
55 typedef unsigned int reg12;
56 typedef unsigned int reg16;
57 typedef unsigned int reg24;
58 
59 typedef int cycle_count;
60 
61 enum chip_model { MOS6581FP=1, MOS8580FP };
62 
63 enum sampling_method { SAMPLE_INTERPOLATE=1, SAMPLE_RESAMPLE_INTERPOLATE };
64 
65 extern "C"
66 {
67 #ifndef __VERSION_CC__
68 extern const char* resid_version_string;
69 #else
70 const char* resid_version_string = VERSION;
71 #endif
72 }
73 
74 // Inlining on/off.
75 #define RESID_INLINE inline
76 
77 #if defined(__SSE__) || (defined(_MSC_VER) && (_MSC_VER >= 1300))
78 #define RESID_USE_SSE 1
79 #else
80 #define RESID_USE_SSE 0
81 #endif
82 
83 #define HAVE_LOGF
84 #define HAVE_EXPF
85 #define HAVE_LOGF_PROTOTYPE
86 #define HAVE_EXPF_PROTOTYPE
87 
88 #endif // not __SIDDEFS_H__
89