summaryrefslogtreecommitdiff
path: root/include/dolphin/gf/GFTev.h
blob: 0022792d1fe98ba26459c5ffa530c6c63f617407 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#ifndef GFTEV_H
#define GFTEV_H

#include "dolphin/gx/GXEnum.h"
#include "dolphin/gx/GXStruct.h"

#define BP_TEV_COLOR(d, c, b, a, bias, op, clamp, scale, out, id) \
    ( \
        (u32)(d) << 0 | \
        (u32)(c) << 4 | \
        (u32)(b) << 8 | \
        (u32)(a) << 12 | \
        (u32)(bias) << 16 | \
        (u32)(op) << 18 | \
        (u32)(clamp) << 19 | \
        (u32)(scale) << 20 | \
        (u32)(out) << 22 | \
        (u32)(id) << 24 \
    )

#define BP_TEV_ALPHA(ras_sel, tex_sel, d, c, b, a, bias, op, clamp, scale, out, id) \
    ( \
        (u32)(ras_sel) << 0 | \
        (u32)(tex_sel) << 2 | \
        (u32)(d) << 4 | \
        (u32)(c) << 7 | \
        (u32)(b) << 10 | \
        (u32)(a) << 13 | \
        (u32)(bias) << 16 | \
        (u32)(op) << 18 | \
        (u32)(clamp) << 19 | \
        (u32)(scale) << 20 | \
        (u32)(out) << 22 | \
        (u32)(id) << 24 \
    )

#define BP_TEV_COLOR_REG_RA(r, a, reg, id) \
    ( \
        (u32)(r) << 0 | \
        (u32)(a) << 12 | \
        (u32)(reg) << 23 | \
        (u32)(id) << 24 \
    )

#define BP_TEV_COLOR_REG_BG(b, g, reg, id) \
    ( \
        (u32)(b) << 0 | \
        (u32)(g) << 12 | \
        (u32)(reg) << 23 | \
        (u32)(id) << 24 \
    )

#define BP_TEV_KSEL(rb, ga, kcsel0, kasel0, kcsel1, kasel1, id) \
    ( \
        (u32)(rb) << 0 | \
        (u32)(ga) << 2 | \
        (u32)(kcsel0) << 4 | \
        (u32)(kasel0) << 9 | \
        (u32)(kcsel1) << 14 | \
        (u32)(kasel1) << 19 | \
        (u32)(id) << 24 \
    )

#define BP_ALPHA_COMPARE(ref0, ref1, comp0, comp1, op, id) \
    ( \
        (u32)(ref0) << 0 | \
        (u32)(ref1) << 8 | \
        (u32)(comp0) << 16 | \
        (u32)(comp1) << 19 | \
        (u32)(op) << 22 | \
        (u32)(id) << 24 \
    )

#define BP_ZTEX_PARAMS_0(bias, id) \
    ( \
        (u32)(bias) << 0 | \
        (u32)(id) << 24 \
    )

#define BP_ZTEX_PARAMS_1(zfmt, op, id) \
    ( \
        (u32)(zfmt) << 0 | \
        (u32)(op) << 2 | \
        (u32)(id) << 24 \
    )

#define BP_TEV_ORDER(map0, coord0, enable0, color0, map1, coord1, enable1, color1, id) \
    ( \
        (u32)(map0) << 0 | \
        (u32)(coord0) << 3 | \
        (u32)(enable0) << 6 | \
        (u32)(color0) << 7 | \
        (u32)(map1) << 12 | \
        (u32)(coord1) << 15 | \
        (u32)(enable1) << 18 | \
        (u32)(color1) << 19 | \
        (u32)(id) << 24 \
    )

void GFSetTevColor(GXTevRegID, GXColor);
void GFSetTevColorS10(GXTevRegID, GXColorS10);
void GFSetAlphaCompare(GXCompare, u8, GXAlphaOp, GXCompare, u8);

#endif /* GFTEV_H */