fill.h
3.44 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
/**************************************************************************
* *
* Copyright (C) 1995, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
*************************************************************************/
/*
* File: lines.h
*
*/
#define V(p, x, y, z, f, s, t, r, g, b, a) { \
(p)->v.ob[0] = (x); \
(p)->v.ob[1] = (y); \
(p)->v.ob[2] = (z); \
(p)->v.flag = (f); \
(p)->v.tc[0] = (s); \
(p)->v.tc[1] = (t); \
(p)->v.cn[0] = (r); \
(p)->v.cn[1] = (g); \
(p)->v.cn[2] = (b); \
(p)->v.cn[3] = (a); \
}
#define SCREEN_HT 240
#define SCREEN_WD 320
#define DELTA_Z 0.0
#define DELTAXY_POS 0.0
#define DELTAXY_INCR 1.0
#define MAXCLIPRATIO 6
#define MAXTRISPERXAXIS 20
#define MAXTRISPERYAXIS 20
#define MAXTRISPERZAXIS 5
#define MAXTRIS MAXTRISPERXAXIS*MAXTRISPERYAXIS*MAXTRISPERZAXIS
/* this stack size is in bytes, and is a lot larger
* than this program needs.
*/
#define STACKSIZE 0x2000
/* Large enough to handle maximum possible number
* of triangles, and then some
*/
#define TRILIST_LEN (2*MAXTRIS) /* one vertex load, one tri */
#define GLIST_LEN 3200
#define RDPLIST_LEN (4096*32)
/*
* ifdef needed because this file is included by "spec"
*/
#ifdef _LANGUAGE_C
/*
* Layout of dynamic data.
*
* This structure holds the things which change per frame. It is advantageous
* to keep dynamic data together so that we may selectively write back dirty
* data cache lines to DRAM prior to processing by the RCP.
*
*/
typedef struct {
Mtx projection;
Mtx start;
Mtx viewing;
Mtx identity;
Vtx FillVtx[MAXTRIS*3];
Gfx trilist[TRILIST_LEN];
Gfx glist[GLIST_LEN];
} Dynamic;
extern Dynamic dynamic;
extern unsigned short cfb_16_a[];
extern unsigned short cfb_16_b[];
extern unsigned short zbuffer[];
extern void *cfb_ptrs[2];
extern int draw_buffer;
extern Gfx *glistp;
extern Dynamic *dynamicp;
extern int ActiveController;
extern int ControllerInput;
extern float TICKSPERSEC;
extern int UseAAMode;
extern int DoClrClr;
extern int UseZMode;
extern float TimePerFrame;
extern int SuperBlock;
extern int SelfScaleTimer;
extern int ClipRatio;
extern int TimerTicks;
extern int UseTextureMode;
extern int ActiveVert;
extern float TriDx;
extern float TriDy;
extern float TriArea;
extern float TriWidth;
extern float TriHeight;
/* bounding box */
extern float BoxTx, BoxTy, BoxLx, BoxLy;
extern float TriAspectRatio;
extern int TriNx; /* number of divisions in x */
extern int TriNy; /* number of divisions in y */
extern int TriNz; /* number of divisions in z */
extern int TriSortOrder;
extern float TriDeltaXYPos;
extern u64 rdp_output[];
extern u64 rdp_output_len;
float frand(void);
void ApplyGlobalTransformations(void);
#endif /* _LANGUAGE_C */