| 1 | // ---------------------------------------------------------------------------cxx . . $ `<file>/src/resid/siddefs.h`/ |
| 2 | // This file is part of reSID, a MOS6581 SID emulator engine. |
| 3 | // Copyright (C) 1999 Dag Lem <[email protected]> |
| 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_H__ |
| 21 | #define __SIDDEFS_H__cxx . . $ `src/resid/siddefs.h:21:9`! |
| 22 | |
| 23 | // From math.h |
| 24 | #define M_LN2cxx . . $ `src/resid/siddefs.h:24:9`! 0.69314718055994530942 /* log_e 2 */ |
| 25 | #define M_PIcxx . . $ `src/resid/siddefs.h:25:9`! 3.14159265358979323846 /* pi */ |
| 26 | |
| 27 | // Define bool, true, and false for C++ compilers that lack these keywords. |
| 28 | #define RESID_HAVE_BOOLcxx . . $ `src/resid/siddefs.h:28:9`! 1 |
| 29 | |
| 30 | #if !RESID_HAVE_BOOLcxx . . $ `src/resid/siddefs.h:28:9`! |
| 31 | typedef int bool; |
| 32 | const bool true = 1; |
| 33 | const bool false = 0; |
| 34 | #endif |
| 35 | |
| 36 | // We could have used the smallest possible data type for each SID register, |
| 37 | // however this would give a slower engine because of data type conversions. |
| 38 | // An int is assumed to be at least 32 bits (necessary in the types reg24, |
| 39 | // cycle_count, and sound_sample). GNU does not support 16-bit machines |
| 40 | // (GNU Coding Standards: Portability between CPUs), so this should be |
| 41 | // a valid assumption. |
| 42 | |
| 43 | typedef unsigned int reg4cxx . . $ reg4#; |
| 44 | typedef unsigned int reg8cxx . . $ reg8#; |
| 45 | typedef unsigned int reg12cxx . . $ reg12#; |
| 46 | typedef unsigned int reg16cxx . . $ reg16#; |
| 47 | typedef unsigned int reg24cxx . . $ reg24#; |
| 48 | typedef unsigned int reg32cxx . . $ reg32#; |
| 49 | |
| 50 | typedef int cycle_countcxx . . $ cycle_count#; |
| 51 | typedef int sound_samplecxx . . $ sound_sample#; |
| 52 | typedef sound_samplecxx . . $ sound_sample# fc_pointcxx . . $ fc_point#[2]; |
| 53 | |
| 54 | enum chip_modelcxx . . $ chip_model# { MOS6581cxx . . $ MOS6581. = 1, MOS8580cxx . . $ MOS8580. }; |
| 55 | |
| 56 | enum sampling_methodcxx . . $ sampling_method# { SAMPLE_FASTcxx . . $ SAMPLE_FAST., SAMPLE_INTERPOLATEcxx . . $ SAMPLE_INTERPOLATE., |
| 57 | SAMPLE_RESAMPLE_INTERPOLATEcxx . . $ SAMPLE_RESAMPLE_INTERPOLATE., SAMPLE_RESAMPLE_FASTcxx . . $ SAMPLE_RESAMPLE_FAST. }; |
| 58 | |
| 59 | extern "C" |
| 60 | { |
| 61 | #ifndef __VERSION_CC__ |
| 62 | extern const char* resid_version_string; |
| 63 | #else |
| 64 | const char* resid_version_string = VERSION; |
| 65 | #endif |
| 66 | } |
| 67 | |
| 68 | // Inlining on/off. |
| 69 | #define RESID_INLININGcxx . . $ `src/resid/siddefs.h:69:9`! 1 |
| 70 | #define RESID_INLINEcxx . . $ `src/resid/siddefs.h:70:9`! inline |
| 71 | |
| 72 | #endif // not __SIDDEFS_H__ |