Loading [MathJax]/extensions/MathMenu.js
Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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#include <dolphin/os.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define GXFIFO_ADDR 0xCC008000
12
25
26#ifdef __MWERKS__
27volatile PPCWGPipe GXWGFifo AT_ADDRESS(GXFIFO_ADDR);
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(const T x);
37#define FUNC_2PARAM(name, T) void name##2##T(const T x, const T y);
38#define FUNC_3PARAM(name, T) void name##3##T(const T x, const T y, const T z);
39#define FUNC_4PARAM(name, T) void name##4##T(const T x, const T y, const T z, const T w);
40#define FUNC_INDEX8(name) void name##1x8(const u8 x);
41#define FUNC_INDEX16(name) void name##1x16(const u16 x);
42
43#else
44
45// inline functions
46
47#define FUNC_1PARAM(name, T) \
48static inline void name##1##T(const T x) { GXWGFifo.T = x; }
49
50#define FUNC_2PARAM(name, T) \
51static inline void name##2##T(const T x, const T y) { GXWGFifo.T = x; GXWGFifo.T = y; }
52
53#define FUNC_3PARAM(name, T) \
54static inline void name##3##T(const T x, const T y, const T z) { GXWGFifo.T = x; GXWGFifo.T = y; GXWGFifo.T = z; }
55
56#define FUNC_4PARAM(name, T) \
57static 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; }
58
59#define FUNC_INDEX8(name) \
60static inline void name##1x8(const u8 x) { GXWGFifo.u8 = x; }
61
62#define FUNC_INDEX16(name) \
63static inline void name##1x16(const u16 x) { GXWGFifo.u16 = x; }
64
65#endif
66
67// GXCmd
69FUNC_1PARAM(GXCmd, u16)
71
72// GXParam
73FUNC_1PARAM(GXParam, u8)
75FUNC_1PARAM(GXParam, u32)
76FUNC_1PARAM(GXParam, s8)
77FUNC_1PARAM(GXParam, s16)
79FUNC_1PARAM(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)
102FUNC_INDEX8(GXNormal)
103
104// GXColor
105FUNC_4PARAM(GXColor, u8)
110FUNC_INDEX8(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#undef FUNC_1PARAM
130#undef FUNC_2PARAM
131#undef FUNC_3PARAM
132#undef FUNC_4PARAM
133#undef FUNC_INDEX8
134#undef FUNC_INDEX16
135
136#ifdef __cplusplus
137}
138#endif
139
140#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
Definition d_menu_dmap_map.cpp:90
signed char s8
Definition types.h:4
unsigned long u32
Definition types.h:9
signed short int s16
Definition types.h:6
signed long long int s64
Definition types.h:10
float f32
Definition types.h:22
double f64
Definition types.h:23
unsigned short int u16
Definition types.h:7
unsigned long long int u64
Definition types.h:11
signed long s32
Definition types.h:8
unsigned char u8
Definition types.h:5
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