summaryrefslogtreecommitdiff
path: root/arm9/lib/NitroSDK/include/GX_g3imm.h
blob: 33ebdef203e7efa2001b6814f88c8a48a2e89d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef GUARD_GX_G3IMM_H
#define GUARD_GX_G3IMM_H

#include "GX_g3.h"
#include "fx.h"

void G3_LoadMtx43(struct Mtx43 *mtx);
void G3_MultMtx43(struct Mtx43 *mtx);
void G3_MultMtx33(struct Mtx33 *mtx);


static inline void G3_PushMtx()
{
    reg_G3_MTX_PUSH = 0;
}

static inline void G3_PopMtx(int num)
{
    reg_G3_MTX_POP = (u32)num;
}

static inline void G3_Identity()
{
    reg_G3_MTX_IDENTITY = 0;
}


static inline void G3_Translate(fx32 x, fx32 y, fx32 z)
{
    reg_G3_MTX_TRANS = (u32)x;
    reg_G3_MTX_TRANS = (u32)y;
    reg_G3_MTX_TRANS = (u32)z;
}


static inline void G3_PolygonAttr(int light, GXPolygonMode polyMode, GXCull cullMode, int polygonID, int alpha, int misc) {
    reg_G3_POLYGON_ATTR = GX_PACK_POLYGONATTR_PARAM(light,
                                                    polyMode, cullMode, polygonID, alpha, misc);
}

static inline void G3_TexImageParam(GXTexFmt texFmt,
                                    GXTexGen texGen,
                                    GXTexSizeS s,
                                    GXTexSizeT t,
                                    GXTexRepeat repeat,
                                    GXTexFlip flip, GXTexPlttColor0 pltt0, u32 addr) {
    reg_G3_TEXIMAGE_PARAM = GX_PACK_TEXIMAGE_PARAM(texFmt, texGen, s, t, repeat, flip, pltt0, addr);
}


static inline void G3_TexPlttBase(u32 addr, GXTexFmt texfmt)
{
    u32     param = GX_PACK_TEXPLTTBASE_PARAM(addr, texfmt);
    reg_G3_TEXPLTT_BASE = param;
}


static inline void G3_MaterialColorDiffAmb(GXRgb diffuse, GXRgb ambient, BOOL IsSetVtxColor)
{
    reg_G3_DIF_AMB = GX_PACK_DIFFAMB_PARAM(diffuse, ambient, IsSetVtxColor);
}

static inline void G3_MaterialColorSpecEmi(GXRgb specular, GXRgb emission, BOOL IsShininess)
{
    reg_G3_SPE_EMI = GX_PACK_SPECEMI_PARAM(specular, emission, IsShininess);
}

#endif  //GUARD_GX_G3IMM_H