vi.h
4.8 KB
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/**********************************************************************
$B#G#o#N#o#G#o%F%9%H%W%m%0%i%`$r%(!<%8%s%08!::MQ$KJQ99$7$?$b$N(B
vi.c$B$O$+$J$jJ,$+$j$K$/$$%W%m%0%i%`$@$C$?$N$GA4LL2~D{$7$^$7$?!#(B
File : vi.h
Creater : Masaki Wada
E-Mail Address: wada@hamster.nintendo.co.jp
**********************************************************************/
/* $B3F<oHFMQDj5A(B */
#define GLIST_LEN 2048
#define FAST3D 0
#define LINE3D 1
/* $B8!::$K;HMQ$9$k#R#A#M%(%j%"$NNs5s@k8@(B */
enum RAM_AREA{ STANDARD, /* $BI8=`$N#4#M%(%j%"(B */
EXTEND_1ST, /* $B3HD%#18DL\$N#2#M(B */
EXTEND_2ND /* $B3HD%#28DL\$N#2#M(B */
};
/* $B8!::=g=x%j%9%H(B */
typedef struct{
int VideoMode; /* $BI=<($9$k;~$N%S%G%*%b!<%I(B */
int NumColorBits; /* $B?'$NI=8=%S%C%H?t(B */
int ScreenWidth; /* $B2#%5%$%:(B */
int ScreenHeight; /* $B=D%5%$%:(B */
enum RAM_AREA RamArea; /* $B;HMQ$9$k#R#A#M%(%j%"(B */
int Index; /* $B8!::4o$KAw$k8=:_$N8!::2hLLHV9f(B */
void (*Function)(void); /* $B3F!9$N4X?t(B */
} TEST_STRUCT;
/* $BF0E*NN0h$NG[CV(B */
typedef struct {
Mtx projection;
Mtx modeling1;
Mtx modeling2;
Mtx modeling3;
Mtx modeling4;
Mtx modeling5;
Mtx modeling6;
Mtx modeling7;
Mtx modeling8;
Mtx modeling9;
Mtx modeling10;
Mtx modeling11;
Mtx modeling12;
Mtx modeling13;
Mtx modeling14;
Mtx modeling15;
Mtx modeling16;
Mtx modeling17;
Mtx modeling18;
Mtx viewing;
Mtx identity;
Gfx glist[GLIST_LEN];
Vtx Vertex[16];
Vp mvp;
/* $B:{Ln$5$s%W%m%0%i%`IA2hMQ%^%H%j%/%972(B */
Mtx floor_rotatex;
Mtx floor_rotatey;
Mtx floor_rotatez;
Mtx floor_translate;
Mtx floor_model0;
Mtx floor_model1;
Mtx floor_model2;
Mtx floor_model3;
Mtx floor_model4;
Mtx floor_model5;
Mtx floor_model6;
Mtx floor_model7;
Mtx floor_model8;
} ViDynamic;
/* $B2hLL$N>pJs9=B$BN(B */
typedef struct{
float XScale; /* $B#XJ}8~$N3HBgN((B */
float YScale; /* $B#YJ}8~$N3HBgN((B */
int DitherEnable; /* $B%G%#%6%j%s%0>pJs(B */
int ViDitherEnable; /* $B%G%#%6%U%#%k%?!<(B */
int ViGammaEnable; /* $B%,%s%^Jd@5(B */
int ViDivotEnable; /* $B%G%#%\%C%HJd@5(B */
int TranslateHorizontal; /* $BITL@(B */
int TranslateVertical; /* $BITL@(B */
}CONFIGRATION;
/* $B%G%#%6%j%s%0>pJs(B */
const int DitherTypes[]={
G_CD_DISABLE,
G_CD_NOISE,
G_CD_MAGICSQ,
G_CD_BAYER
};
/* $B4J0W$J#2<!85:BI89=B$BN(B */
typedef struct{
int x;
int y;
}COORDINATES;
/* $B4J0WE*$J#3<!85:BI89=B$BN(B */
typedef struct{
float x;
float y;
float z;
} DIMENSION3;
/* $B4J0WE*$J#2<!85:BI89=B$BN(B */
typedef struct{
float x;
float y;
} DIMENSION2;
/* $B%F%9%H%Q%?!<%s$N<1JLHV9fI=<(MQ9=B$BN(B */
typedef struct{
int Index; /* $B<1JLHV9f(B */
int x; /* $BI=<(#X:BI8(B */
int y; /* $BI=<(#Y:BI8(B */
float Magnification; /* $BI=<(G\N((B */
}INDEX_INFO;
/* $B%/%j%"%+%i!<@_DjMQ9=B$BN(B */
typedef struct{
u32 Color16;
u32 Color32;
}COLOR;
/* $BBeI=?'$N@_Dj(B */
const COLOR BLACK = { ( GPACK_RGBA5551( 0x00, 0x00, 0x00, 1) << 16 |
GPACK_RGBA5551( 0x00, 0x00, 0x00, 1) ),
( 0x00 << 24 |
0x00 << 16 |
0x00 << 8 |
0xff ) };
const COLOR WHITE = { ( GPACK_RGBA5551( 0xff, 0xff, 0xff, 1) << 16 |
GPACK_RGBA5551( 0xff, 0xff, 0xff, 1) ),
( 0xff << 24 |
0xff << 16 |
0xff << 8 |
0xff ) };
const COLOR RED = { ( GPACK_RGBA5551( 0xff, 0x00, 0x00, 1) << 16 |
GPACK_RGBA5551( 0xff, 0x00, 0x00, 1) ),
( 0xff << 24 |
0x00 << 16 |
0x00 << 8 |
0xff ) };
const COLOR GREEN = { ( GPACK_RGBA5551( 0x00, 0xff, 0x00, 1) << 16 |
GPACK_RGBA5551( 0x00, 0xff, 0x00, 1) ),
( 0x00 << 24 |
0xff << 16 |
0x00 << 8 |
0xff ) };
const COLOR BLUE = { ( GPACK_RGBA5551( 0x00, 0x00, 0xff, 1) << 16 |
GPACK_RGBA5551( 0x00, 0x00, 0xff, 1) ),
( 0x00 << 24 |
0x00 << 16 |
0xff << 8 |
0xff ) };
const COLOR GRAY = { ( GPACK_RGBA5551( 0x80, 0x80, 0x80, 1) << 16 |
GPACK_RGBA5551( 0x80, 0x80, 0x80, 1) ),
( 0x40 << 24 |
0x40 << 16 |
0x40 << 8 |
0xff ) };