PVSnesLib  4.3.0
Documentation to code in C or ASM for the Nintendo SNES
snestypes.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------------
2 
3  snestypes.h -- Common types (and a few useful macros)
4 
5  Copyright (C) 2012-2013
6  Alekmaul
7 
8  This software is provided 'as-is', without any express or implied
9  warranty. In no event will the authors be held liable for any
10  damages arising from the use of this software.
11 
12  Permission is granted to anyone to use this software for any
13  purpose, including commercial applications, and to alter it and
14  redistribute it freely, subject to the following restrictions:
15 
16  1. The origin of this software must not be misrepresented; you
17  must not claim that you wrote the original software. If you use
18  this software in a product, an acknowledgment in the product
19  documentation would be appreciated but is not required.
20  2. Altered source versions must be plainly marked as such, and
21  must not be misrepresented as being the original software.
22  3. This notice may not be removed or altered from any source
23  distribution.
24 
25 ---------------------------------------------------------------------------------*/
30 #ifndef _SNESTYPES_INCLUDE
31 #define _SNESTYPES_INCLUDE
32 
34 #define BIT(n) (1 << n)
35 
37 typedef signed char s8;
38 typedef unsigned char u8;
39 typedef signed short s16;
40 typedef unsigned short u16;
41 typedef signed long long s32;
42 typedef unsigned long long u32;
43 
44 typedef volatile unsigned char vuint8;
45 typedef volatile unsigned short vuint16;
46 typedef volatile unsigned long long vuint32;
47 typedef volatile char vint8;
48 typedef volatile short vint16;
49 typedef volatile long long vint32;
50 
51 // Handy function pointer typedefs
53 typedef void (*VoidFn)(void);
54 
56 typedef unsigned char bool;
57 #define FALSE 0
58 #define TRUE 0xff
59 #define false 0
60 #define true 0xff
61 
62 // stdio definitions
63 #define NULL 0
64 
65 #endif
signed char s8
8 bit volatile unsigned integer.
Definition: snestypes.h:37
void(* VoidFn)(void)
a function pointer that takes no arguments and doesn't return anything.
Definition: snestypes.h:53
unsigned char bool
boolean definitions
Definition: snestypes.h:56