-
Notifications
You must be signed in to change notification settings - Fork 1
/
YmTypes.h
113 lines (87 loc) · 4.05 KB
/
YmTypes.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/*-----------------------------------------------------------------------------
ST-Sound ( YM files player library )
Define YM types for multi-platform compilation.
Change that file depending of your platform. Please respect the right size
for each type.
-----------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------
* ST-Sound, ATARI-ST Music Emulator
* Copyright (c) 1995-1999 Arnaud Carre ( http://leonard.oxg.free.fr )
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
-----------------------------------------------------------------------------*/
#ifndef __YMTYPES__
#define __YMTYPES__
//#define YM_INTEGER_ONLY
//-----------------------------------------------------------
// Platform specific stuff
//-----------------------------------------------------------
#ifdef _WIN32
// These settings are ok for Windows 32bits platform.
#ifdef YM_INTEGER_ONLY
#ifdef _MSC_VER
typedef _int64 yms64;
#else
typedef long long yms64;
#endif
typedef float ymfloat; // Float are always need for init, but not for heavy calculation.
#else
typedef float ymfloat;
#endif
typedef signed char yms8; // 8 bits signed integer
typedef signed short yms16; // 16 bits signed integer
typedef signed long yms32; // 32 bits signed integer
typedef unsigned char ymu8; // 8 bits unsigned integer
typedef unsigned short ymu16; // 16 bits unsigned integer
typedef unsigned long ymu32; // 32 bits unsigned integer
typedef int ymint; // Native "int" for speed purpose. StSound suppose int is signed and at least 32bits. If not, change it to match to yms32
typedef char ymchar; // 8 bits char character (used for null terminated strings)
#else
#include <stdint.h>
#ifdef YM_INTEGER_ONLY
typedef int64_t yms64;
typedef float ymfloat; // Float are always need for init, but not for heavy calculation.
#else
typedef float ymfloat;
#endif
typedef int8_t yms8; // 8 bits signed integer
typedef int16_t yms16; // 16 bits signed integer
typedef int32_t yms32; // 32 bits signed integer
typedef uint8_t ymu8; // 8 bits unsigned integer
typedef uint16_t ymu16; // 16 bits unsigned integer
typedef uint32_t ymu32; // 32 bits unsigned integer
typedef int_fast32_t ymint; // The fastest type of at least 32 bits and signed.
typedef char ymchar; // 8 bits char character (used for null terminated strings)
#endif
#ifndef NULL
#define NULL (0L)
#endif
//-----------------------------------------------------------
// Multi-platform
//-----------------------------------------------------------
typedef int ymbool; // boolean ( theorically nothing is assumed for its size in StSound,so keep using int)
typedef yms16 ymsample; // StSound emulator render mono 16bits signed PCM samples
#define YMFALSE (0)
#define YMTRUE (!YMFALSE)
#endif