SSBM Decomp
Toggle main menu visibility
Loading...
Searching...
No Matches
GXVert.h
Go to the documentation of this file.
1
#ifndef _DOLPHIN_GX_GXVERT_H_
2
#define _DOLPHIN_GX_GXVERT_H_
3
4
#include <
dolphin/types.h
>
5
6
#ifdef __cplusplus
7
extern
"C"
{
8
#endif
9
10
#define GXFIFO_ADDR 0xCC008000
11
12
typedef
union
{
13
u8
u8
;
14
u16
u16
;
15
u32
u32
;
16
u64
u64
;
17
s8
s8
;
18
s16
s16
;
19
s32
s32
;
20
s64
s64
;
21
f32
f32
;
22
f64
f64
;
23
}
PPCWGPipe
;
24
25
#if defined(__MWERKS__) && !defined(M2CTX)
26
volatile
PPCWGPipe
GXWGFifo
:
GXFIFO_ADDR
;
27
#else
28
#define GXWGFifo (*(volatile PPCWGPipe*) GXFIFO_ADDR)
29
#endif
30
31
#if DEBUG
32
33
// external functions
34
35
#define FUNC_1PARAM(name, T) void name##1##T(T x);
36
#define FUNC_2PARAM(name, T) void name##2##T(T x, T y);
37
#define FUNC_3PARAM(name, T) void name##3##T(T x, T y, T z);
38
#define FUNC_4PARAM(name, T) void name##4##T(T x, T y, T z, T w);
39
#define FUNC_INDEX8(name) void name##1x8(u8 x);
40
#define FUNC_INDEX16(name) void name##1x16(u16 x);
41
42
#else
43
44
// inline functions
45
46
#define FUNC_1PARAM(name, T) \
47
static inline void name##1##T(T x) \
48
{ \
49
GXWGFifo.T = x; \
50
}
51
52
#define FUNC_2PARAM(name, T) \
53
static inline void name##2##T(T x, T y) \
54
{ \
55
GXWGFifo.T = x; \
56
GXWGFifo.T = y; \
57
}
58
59
#define FUNC_3PARAM(name, T) \
60
static inline void name##3##T(T x, T y, T z) \
61
{ \
62
GXWGFifo.T = x; \
63
GXWGFifo.T = y; \
64
GXWGFifo.T = z; \
65
}
66
67
#define FUNC_4PARAM(name, T) \
68
static inline void name##4##T(T x, T y, T z, T w) \
69
{ \
70
GXWGFifo.T = x; \
71
GXWGFifo.T = y; \
72
GXWGFifo.T = z; \
73
GXWGFifo.T = w; \
74
}
75
76
#define FUNC_INDEX8(name) \
77
static inline void name##1x8(u8 x) \
78
{ \
79
GXWGFifo.u8 = x; \
80
}
81
82
#define FUNC_INDEX16(name) \
83
static inline void name##1x16(u16 x) \
84
{ \
85
GXWGFifo.u16 = x; \
86
}
87
88
#endif
89
90
// GXCmd
91
FUNC_1PARAM
(GXCmd,
u8
)
92
FUNC_1PARAM
(GXCmd,
u16
)
93
FUNC_1PARAM
(GXCmd,
u32
)
94
95
// GXParam
96
FUNC_1PARAM
(GXParam,
u8
)
97
FUNC_1PARAM
(GXParam,
u16
)
98
FUNC_1PARAM
(GXParam,
u32
)
99
FUNC_1PARAM
(GXParam,
s8
)
100
FUNC_1PARAM
(GXParam,
s16
)
101
FUNC_1PARAM
(GXParam,
s32
)
102
FUNC_1PARAM
(GXParam,
f32
)
103
FUNC_3PARAM
(GXParam,
f32
)
104
FUNC_4PARAM
(GXParam,
f32
)
105
106
// GXPosition
107
FUNC_3PARAM
(GXPosition,
f32
)
108
FUNC_3PARAM
(GXPosition,
u8
)
109
FUNC_3PARAM
(GXPosition,
s8
)
110
FUNC_3PARAM
(GXPosition,
u16
)
111
FUNC_3PARAM
(GXPosition,
s16
)
112
FUNC_2PARAM
(GXPosition,
f32
)
113
FUNC_2PARAM
(GXPosition,
u8
)
114
FUNC_2PARAM
(GXPosition,
s8
)
115
FUNC_2PARAM
(GXPosition,
u16
)
116
FUNC_2PARAM
(GXPosition,
s16
)
117
FUNC_INDEX16
(GXPosition)
118
FUNC_INDEX8
(GXPosition)
119
120
// GXNormal
121
FUNC_3PARAM
(GXNormal,
f32
)
122
FUNC_3PARAM
(GXNormal,
s16
)
123
FUNC_3PARAM
(GXNormal,
s8
)
124
FUNC_INDEX16
(GXNormal)
125
FUNC_INDEX8
(GXNormal)
126
127
// GXColor
128
FUNC_4PARAM
(
GXColor
,
u8
)
129
FUNC_1PARAM
(
GXColor
,
u32
)
130
FUNC_3PARAM
(
GXColor
,
u8
)
131
FUNC_1PARAM
(
GXColor
,
u16
)
132
FUNC_INDEX16
(
GXColor
)
133
FUNC_INDEX8
(
GXColor
)
134
135
// GXTexCoord
136
FUNC_2PARAM
(GXTexCoord,
f32
)
137
FUNC_2PARAM
(GXTexCoord,
s16
)
138
FUNC_2PARAM
(GXTexCoord,
u16
)
139
FUNC_2PARAM
(GXTexCoord,
s8
)
140
FUNC_2PARAM
(GXTexCoord,
u8
)
141
FUNC_1PARAM
(GXTexCoord,
f32
)
142
FUNC_1PARAM
(GXTexCoord,
s16
)
143
FUNC_1PARAM
(GXTexCoord,
u16
)
144
FUNC_1PARAM
(GXTexCoord,
s8
)
145
FUNC_1PARAM
(GXTexCoord,
u8
)
146
FUNC_INDEX16
(GXTexCoord)
147
FUNC_INDEX8
(GXTexCoord)
148
149
// GXMatrixIndex
150
FUNC_1PARAM
(GXMatrixIndex,
u8
)
151
152
#if !defined(M2CTX)
// undef not supported
153
#undef FUNC_1PARAM
154
#undef FUNC_2PARAM
155
#undef FUNC_3PARAM
156
#undef FUNC_4PARAM
157
#undef FUNC_INDEX8
158
#undef FUNC_INDEX16
159
#endif
160
161
#ifdef __cplusplus
162
}
163
#endif
164
165
#endif
FUNC_2PARAM
#define FUNC_2PARAM(name, T)
Definition
GXVert.h:52
FUNC_INDEX8
#define FUNC_INDEX8(name)
Definition
GXVert.h:76
FUNC_INDEX16
#define FUNC_INDEX16(name)
Definition
GXVert.h:82
FUNC_4PARAM
#define FUNC_4PARAM(name, T)
Definition
GXVert.h:67
FUNC_3PARAM
#define FUNC_3PARAM(name, T)
Definition
GXVert.h:59
FUNC_1PARAM
#define FUNC_1PARAM(name, T)
Definition
GXVert.h:46
GXWGFifo
#define GXWGFifo
Definition
GXVert.h:28
GXFIFO_ADDR
#define GXFIFO_ADDR
Definition
GXVert.h:10
types.h
s32
signed int s32
Definition
types.h:12
u32
unsigned int u32
Definition
types.h:13
s8
signed char s8
Definition
types.h:4
s16
signed short int s16
Definition
types.h:6
f32
float f32
Definition
types.h:18
u16
unsigned short int u16
Definition
types.h:7
u8
unsigned char u8
Definition
types.h:5
GXColor
Definition
GXStruct.h:27
PPCWGPipe
Definition
GXVert.h:12
PPCWGPipe::s16
s16 s16
Definition
GXVert.h:18
PPCWGPipe::s8
s8 s8
Definition
GXVert.h:17
PPCWGPipe::f64
f64 f64
Definition
GXVert.h:22
PPCWGPipe::f32
f32 f32
Definition
GXVert.h:21
PPCWGPipe::u32
u32 u32
Definition
GXVert.h:15
PPCWGPipe::u16
u16 u16
Definition
GXVert.h:14
PPCWGPipe::s32
s32 s32
Definition
GXVert.h:19
PPCWGPipe::s64
s64 s64
Definition
GXVert.h:20
PPCWGPipe::u8
u8 u8
Definition
GXVert.h:13
PPCWGPipe::u64
u64 u64
Definition
GXVert.h:16
libs
dolphin
include
dolphin
gx
GXVert.h
Generated by
1.17.0