SSBM Decomp
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
7extern "C" {
8#endif
9
10#define GXFIFO_ADDR 0xCC008000
11
25
26#if defined(__MWERKS__) && !defined(M2CTX)
28#else
29#define GXWGFifo (*(volatile PPCWGPipe *)GXFIFO_ADDR)
30#endif
31
32#if DEBUG
33
34// external functions
35
36#define FUNC_1PARAM(name, T) void name##1##T(T x);
37#define FUNC_2PARAM(name, T) void name##2##T(T x, T y);
38#define FUNC_3PARAM(name, T) void name##3##T(T x, T y, T z);
39#define FUNC_4PARAM(name, T) void name##4##T(T x, T y, T z, T w);
40#define FUNC_INDEX8(name) void name##1x8(u8 x);
41#define FUNC_INDEX16(name) void name##1x16(u16 x);
42
43#else
44
45// inline functions
46
47#define FUNC_1PARAM(name, T) \
48static inline void name##1##T(T x) { GXWGFifo.T = x; }
49
50#define FUNC_2PARAM(name, T) \
51static inline void name##2##T(T x, T y) { GXWGFifo.T = x; GXWGFifo.T = y; }
52
53#define FUNC_3PARAM(name, T) \
54static inline void name##3##T(T x, T y, T z) { GXWGFifo.T = x; GXWGFifo.T = y; GXWGFifo.T = z; }
55
56#define FUNC_4PARAM(name, T) \
57static inline void name##4##T(T x, T y, T z, T w) { GXWGFifo.T = x; GXWGFifo.T = y; GXWGFifo.T = z; GXWGFifo.T = w; }
58
59#define FUNC_INDEX8(name) \
60static inline void name##1x8(u8 x) { GXWGFifo.u8 = x; }
61
62#define FUNC_INDEX16(name) \
63static inline void name##1x16(u16 x) { GXWGFifo.u16 = x; }
64
65#endif
66
67// GXCmd
68FUNC_1PARAM(GXCmd, u8)
69FUNC_1PARAM(GXCmd, u16)
70FUNC_1PARAM(GXCmd, u32)
71
72// GXParam
73FUNC_1PARAM(GXParam, u8)
74FUNC_1PARAM(GXParam, u16)
75FUNC_1PARAM(GXParam, u32)
76FUNC_1PARAM(GXParam, s8)
77FUNC_1PARAM(GXParam, s16)
78FUNC_1PARAM(GXParam, s32)
79FUNC_1PARAM(GXParam, f32)
80FUNC_3PARAM(GXParam, f32)
81FUNC_4PARAM(GXParam, f32)
82
83// GXPosition
84FUNC_3PARAM(GXPosition, f32)
85FUNC_3PARAM(GXPosition, u8)
86FUNC_3PARAM(GXPosition, s8)
87FUNC_3PARAM(GXPosition, u16)
88FUNC_3PARAM(GXPosition, s16)
89FUNC_2PARAM(GXPosition, f32)
90FUNC_2PARAM(GXPosition, u8)
91FUNC_2PARAM(GXPosition, s8)
92FUNC_2PARAM(GXPosition, u16)
93FUNC_2PARAM(GXPosition, s16)
94FUNC_INDEX16(GXPosition)
95FUNC_INDEX8(GXPosition)
96
97// GXNormal
98FUNC_3PARAM(GXNormal, f32)
99FUNC_3PARAM(GXNormal, s16)
100FUNC_3PARAM(GXNormal, s8)
101FUNC_INDEX16(GXNormal)
102FUNC_INDEX8(GXNormal)
103
104// GXColor
111
112// GXTexCoord
113FUNC_2PARAM(GXTexCoord, f32)
114FUNC_2PARAM(GXTexCoord, s16)
115FUNC_2PARAM(GXTexCoord, u16)
116FUNC_2PARAM(GXTexCoord, s8)
117FUNC_2PARAM(GXTexCoord, u8)
118FUNC_1PARAM(GXTexCoord, f32)
119FUNC_1PARAM(GXTexCoord, s16)
120FUNC_1PARAM(GXTexCoord, u16)
121FUNC_1PARAM(GXTexCoord, s8)
122FUNC_1PARAM(GXTexCoord, u8)
123FUNC_INDEX16(GXTexCoord)
124FUNC_INDEX8(GXTexCoord)
125
126// GXMatrixIndex
127FUNC_1PARAM(GXMatrixIndex, u8)
128
129#if !defined(M2CTX) // undef not supported
130#undef FUNC_1PARAM
131#undef FUNC_2PARAM
132#undef FUNC_3PARAM
133#undef FUNC_4PARAM
134#undef FUNC_INDEX8
135#undef FUNC_INDEX16
136#endif
137
138#ifdef __cplusplus
139}
140#endif
141
142#endif
#define FUNC_2PARAM(name, T)
Definition GXVert.h:50
#define FUNC_INDEX8(name)
Definition GXVert.h:59
#define FUNC_INDEX16(name)
Definition GXVert.h:62
#define FUNC_4PARAM(name, T)
Definition GXVert.h:56
#define FUNC_3PARAM(name, T)
Definition GXVert.h:53
#define FUNC_1PARAM(name, T)
Definition GXVert.h:47
#define GXWGFifo
Definition GXVert.h:29
#define GXFIFO_ADDR
Definition GXVert.h:10
unsigned long u32
Definition types.h:9
signed short int s16
Definition types.h:6
float f32
Definition types.h:13
unsigned short int u16
Definition types.h:7
signed char s8
Definition hsd_3B2B.h:3
signed long s32
Definition hsd_3B2B.h:1
unsigned char u8
Definition hsd_3B2B.h:2
Definition GXStruct.h:29
Definition GXVert.h:13
s16 s16
Definition GXVert.h:19
s8 s8
Definition GXVert.h:18
f64 f64
Definition GXVert.h:23
f32 f32
Definition GXVert.h:22
u32 u32
Definition GXVert.h:16
u16 u16
Definition GXVert.h:15
s32 s32
Definition GXVert.h:20
s64 s64
Definition GXVert.h:21
u8 u8
Definition GXVert.h:14
u64 u64
Definition GXVert.h:17