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