Files
wii-ipl/libs/RVL_SDK/include/revolution/gx/GXVert.h
2026-03-15 13:32:23 +00:00

125 lines
6.1 KiB
C

#ifndef REVOLUTION_GX_VERT_H
#define REVOLUTION_GX_VERT_H
#include <revolution/types.h>
#include <revolution/base/PPCWGPipe.h>
#ifdef __cplusplus
extern "C" {
#endif
#define GXFIFO_ADDR 0xCC008000
volatile PPCWGPipe GXWGFifo ADDRESS(GXFIFO_ADDR);
#define GX_INLINE_VERT_FUNC_1PARAM(name, T) \
static inline void name##1##T(T x) { \
GXWGFifo.T = x; \
}
#define GX_INLINE_VERT_FUNC_2PARAM(name, T) \
static inline void name##2##T(T x, T y) { \
GXWGFifo.T = x; \
GXWGFifo.T = y; \
}
#define GX_INLINE_VERT_FUNC_3PARAM(name, T) \
static inline void name##3##T(T x, T y, T z) { \
GXWGFifo.T = x; \
GXWGFifo.T = y; \
GXWGFifo.T = z; \
}
#define GX_INLINE_VERT_FUNC_4PARAM(name, T) \
static 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; \
}
#define GX_INLINE_VERT_FUNC_INDEX8(name) \
static inline void name##1x8(u8 x) { \
GXWGFifo.u8 = x; \
}
#define GX_INLINE_VERT_FUNC_INDEX16(name) \
static inline void name##1x16(u16 x) { \
GXWGFifo.u16 = x; \
}
// GXCmd
GX_INLINE_VERT_FUNC_1PARAM(GXCmd, u8)
GX_INLINE_VERT_FUNC_1PARAM(GXCmd, u16)
GX_INLINE_VERT_FUNC_1PARAM(GXCmd, u32)
// GXParam
GX_INLINE_VERT_FUNC_1PARAM(GXParam, u8)
GX_INLINE_VERT_FUNC_1PARAM(GXParam, u16)
GX_INLINE_VERT_FUNC_1PARAM(GXParam, u32)
GX_INLINE_VERT_FUNC_1PARAM(GXParam, s8)
GX_INLINE_VERT_FUNC_1PARAM(GXParam, s16)
GX_INLINE_VERT_FUNC_1PARAM(GXParam, s32)
GX_INLINE_VERT_FUNC_1PARAM(GXParam, f32)
GX_INLINE_VERT_FUNC_3PARAM(GXParam, f32)
GX_INLINE_VERT_FUNC_4PARAM(GXParam, f32)
// GXPosition
GX_INLINE_VERT_FUNC_3PARAM(GXPosition, f32)
GX_INLINE_VERT_FUNC_3PARAM(GXPosition, u8)
GX_INLINE_VERT_FUNC_3PARAM(GXPosition, s8)
GX_INLINE_VERT_FUNC_3PARAM(GXPosition, u16)
GX_INLINE_VERT_FUNC_3PARAM(GXPosition, s16)
GX_INLINE_VERT_FUNC_2PARAM(GXPosition, f32)
GX_INLINE_VERT_FUNC_2PARAM(GXPosition, u8)
GX_INLINE_VERT_FUNC_2PARAM(GXPosition, s8)
GX_INLINE_VERT_FUNC_2PARAM(GXPosition, u16)
GX_INLINE_VERT_FUNC_2PARAM(GXPosition, s16)
GX_INLINE_VERT_FUNC_INDEX16(GXPosition)
GX_INLINE_VERT_FUNC_INDEX8(GXPosition)
// GXNormal
GX_INLINE_VERT_FUNC_3PARAM(GXNormal, f32)
GX_INLINE_VERT_FUNC_3PARAM(GXNormal, s16)
GX_INLINE_VERT_FUNC_3PARAM(GXNormal, s8)
GX_INLINE_VERT_FUNC_INDEX16(GXNormal)
GX_INLINE_VERT_FUNC_INDEX8(GXNormal)
// GXColor
GX_INLINE_VERT_FUNC_4PARAM(GXColor, u8)
GX_INLINE_VERT_FUNC_1PARAM(GXColor, u32)
GX_INLINE_VERT_FUNC_3PARAM(GXColor, u8)
GX_INLINE_VERT_FUNC_1PARAM(GXColor, u16)
GX_INLINE_VERT_FUNC_INDEX16(GXColor)
GX_INLINE_VERT_FUNC_INDEX8(GXColor)
// GXTexCoord
GX_INLINE_VERT_FUNC_2PARAM(GXTexCoord, f32)
GX_INLINE_VERT_FUNC_2PARAM(GXTexCoord, s16)
GX_INLINE_VERT_FUNC_2PARAM(GXTexCoord, u16)
GX_INLINE_VERT_FUNC_2PARAM(GXTexCoord, s8)
GX_INLINE_VERT_FUNC_2PARAM(GXTexCoord, u8)
GX_INLINE_VERT_FUNC_1PARAM(GXTexCoord, f32)
GX_INLINE_VERT_FUNC_1PARAM(GXTexCoord, s16)
GX_INLINE_VERT_FUNC_1PARAM(GXTexCoord, u16)
GX_INLINE_VERT_FUNC_1PARAM(GXTexCoord, s8)
GX_INLINE_VERT_FUNC_1PARAM(GXTexCoord, u8)
GX_INLINE_VERT_FUNC_INDEX16(GXTexCoord)
GX_INLINE_VERT_FUNC_INDEX8(GXTexCoord)
// GXMatrixIndex
GX_INLINE_VERT_FUNC_1PARAM(GXMatrixIndex, u8)
#undef GX_INLINE_VERT_FUNC_1PARAM
#undef GX_INLINE_VERT_FUNC_2PARAM
#undef GX_INLINE_VERT_FUNC_3PARAM
#undef GX_INLINE_VERT_FUNC_4PARAM
#undef GX_INLINE_VERT_FUNC_INDEX8
#undef GX_INLINE_VERT_FUNC_INDEX16
#ifdef __cplusplus
}
#endif
#endif // REVOLUTION_GX_VERT_H