PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
standard.h
1
/*
2
------------------------------------------------------------------------------
3
Standard definitions and types, Bob Jenkins
4
------------------------------------------------------------------------------
5
*/
6
#ifndef STANDARD
7
# define STANDARD
8
# ifndef STDIO
9
# include <
stdio.h
>
10
# define STDIO
11
# endif
12
# ifndef STDDEF
13
# include <stddef.h>
14
# define STDDEF
15
# endif
16
#define UB8MAXVAL 0xffffffffffffffffLL
17
#define UB8BITS 64
18
#define SB8MAXVAL 0x7fffffffffffffffLL
19
#define UB4MAXVAL 0xffffffff
20
#define UB4BITS 32
21
#define SB4MAXVAL 0x7fffffff
22
#define UB2MAXVAL 0xffff
23
#define UB2BITS 16
24
#define SB2MAXVAL 0x7fff
25
#define UB1MAXVAL 0xff
26
#define UB1BITS 8
27
#define SB1MAXVAL 0x7f
28
#ifdef _EE
29
#include <
tamtypes.h
>
30
typedef
u64 ub8;
31
typedef
s64 sb8;
32
typedef
u32 ub4;
33
typedef
s32 sb4;
34
typedef
u16 ub2;
35
typedef
s16 sb2;
36
typedef
u8 ub1;
37
typedef
s8 sb1;
38
#else
39
typedef
unsigned
long
long
ub8;
40
typedef
signed
long
long
sb8;
41
typedef
unsigned
long
int
ub4;
/* unsigned 4-byte quantities */
42
typedef
signed
long
int
sb4;
43
typedef
unsigned
short
int
ub2;
44
typedef
signed
short
int
sb2;
45
typedef
unsigned
char
ub1;
46
typedef
signed
char
sb1;
/* signed 1-byte quantities */
47
#endif
48
typedef
int
word;
/* fastest type available */
49
50
#define bis(target,mask) ((target) |= (mask))
51
#define bic(target,mask) ((target) &= ~(mask))
52
#define bit(target,mask) ((target) & (mask))
53
#ifndef min
54
# define min(a,b) (((a)<(b)) ? (a) : (b))
55
#endif
/* min */
56
#ifndef max
57
# define max(a,b) (((a)<(b)) ? (b) : (a))
58
#endif
/* max */
59
#ifndef align
60
# define align(a) (((ub4)a+(sizeof(void *)-1))&(~(sizeof(void *)-1)))
61
#endif
/* align */
62
#ifndef abs
63
# define abs(a) (((a)>0) ? (a) : -(a))
64
#endif
65
#define TRUE 1
66
#define FALSE 0
67
#define SUCCESS 0
/* 1 on VAX */
68
69
#endif
/* STANDARD */
stdio.h
tamtypes.h
ee
erl
include
standard.h
Generated on Thu Nov 14 2024 05:25:24 for PS2SDK by
1.9.8