Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/genplus-gx32/core/z80/osd_cpu.h
2 views
1
/*******************************************************************************
2
* *
3
* Define size independent data types and operations. *
4
* *
5
* The following types must be supported by all platforms: *
6
* *
7
* UINT8 - Unsigned 8-bit Integer INT8 - Signed 8-bit integer *
8
* UINT16 - Unsigned 16-bit Integer INT16 - Signed 16-bit integer *
9
* UINT32 - Unsigned 32-bit Integer INT32 - Signed 32-bit integer *
10
* *
11
*******************************************************************************/
12
13
#ifndef OSD_CPU_H
14
#define OSD_CPU_H
15
16
#undef TRUE
17
#undef FALSE
18
#define TRUE 1
19
#define FALSE 0
20
21
typedef unsigned char UINT8;
22
typedef unsigned short UINT16;
23
typedef unsigned int UINT32;
24
typedef signed char INT8;
25
typedef signed short INT16;
26
typedef signed int INT32;
27
28
/******************************************************************************
29
* Union of UINT8, UINT16 and UINT32 in native endianess of the target
30
* This is used to access bytes and words in a machine independent manner.
31
* The upper bytes h2 and h3 normally contain zero (16 bit CPU cores)
32
* thus PAIR.d can be used to pass arguments to the memory system
33
* which expects 'int' really.
34
******************************************************************************/
35
36
typedef union {
37
#ifdef LSB_FIRST
38
struct { UINT8 l,h,h2,h3; } b;
39
struct { UINT16 l,h; } w;
40
#else
41
struct { UINT8 h3,h2,h,l; } b;
42
struct { UINT16 h,l; } w;
43
#endif
44
UINT32 d;
45
} PAIR;
46
47
#endif /* defined OSD_CPU_H */
48
49