rdp6M_static.c
4.97 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
/**************************************************************************
* *
* Copyright (C) 1994, 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: static.c
*
*
* This file holds tiny display list segments that are 'static' data.
* If you feel the urge to modify a test, see the comment at
* the top of main.c for details.
*
*/
#include <ultra64.h>
#include "gng.h"
#include "dldriver.h"
#include "rdp6M.h"
#include "cs.h"
/*
* Test conventions:
*
* Data variable names can be about anything, as long as they are unique
* and consistent in the table entry.
*
* In order to get around compiler weirdness, the table of tests
* is in rdpverif.c, and the Gfx rdpfb_lists must be extern'd in rdpverif.h
*
* Your test case display list must end with gsSPEndDisplayList(),
* otherwise there are length hassles.
*
* Your test case should set any special mode you want (texture, zbuff,
* etc.) and also turn it off when you are done, so as not to affect
* other tests.
*
*/
/*
* Test -1, default frame. Used as a placeholder.
*
* Simple square (4 triangles), each vertex a different color.
*
* Wed Oct 5 22:12:43 PDT 1994
*
*/
static Vtx place_vtx[5] = {
{ -40, 40, 0, 0, 0, 0, 0, 0, 0xff, 0xff },
{ 40, 40, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff },
{ 40, -40, 0, 0, 0, 0, 0, 0xff, 0, 0xff },
{ -40, -40, 0, 0, 0, 0, 0xff, 0, 0, 0xff },
{ 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff },
};
Gfx rdp6M_placebo_dl[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(G_ZBUFFER),
gsSPSetGeometryMode(G_SHADE),
gsDPSetCombineMode (G_CC_SHADE, G_CC_SHADE),
gsDPSetColorImage(G_IM_FMT_RGBA, G_IM_SIZ_32b, SCREEN_WD,
OS_K0_TO_PHYSICAL(L26R)),
gsSPVertex(&place_vtx, 5, 0),
gsSP1Triangle(0, 4, 1, 0),
gsSP1Triangle(1, 4, 2, 0),
gsSP1Triangle(2, 4, 3, 0),
gsSP1Triangle(3, 4, 0, 0),
gsSPEndDisplayList(),
};
/* end of case -1 */
Gfx rdp6M_test1[] = {
gsDPPipeSync(),
gsSPClearGeometryMode(G_ZBUFFER),
gsSPSetGeometryMode(G_SHADE),
gsDPSetCombineMode (G_CC_SHADE, G_CC_SHADE),
gsDPSetColorImage(G_IM_FMT_RGBA, G_IM_SIZ_32b, SCREEN_WD,
OS_K0_TO_PHYSICAL(L26R)),
gsSPVertex(&place_vtx, 5, 0),
gsSP1Triangle(0, 4, 1, 0),
gsSP1Triangle(1, 4, 2, 0),
gsSP1Triangle(2, 4, 3, 0),
gsSP1Triangle(3, 4, 0, 0),
gsSPEndDisplayList(),
};
#include "RGBA16grid.h"
static Vtx q1[8] = {
#ifdef ONETRI
{ -64, 64, -5, 0, ( 0 << 6), ( 0 << 6), 0, 0, 0xff, 0xff
},
{ 64, 64, -5, 0, (31 << 6), ( 0 << 6), 0x1f, 0, 0xff, 0xff
},
{ 64, -64, -5, 0, (31 << 6), (31 << 6), 0x1f, 0x1f, 0xff, 0xff
},
{ -64, -64, -5, 0, ( 0 << 6), (31 << 6), 0, 0x1f, 0xff, 0xff
},
#else
{ -64, 64, 0, 0, ( 0 << 6), ( 0 << 6), 0, 0, 0xff, 0xff },
{ 64, 64, 0, 0, (31 << 6), ( 0 << 6), 0x1f, 0, 0xff, 0xff
},
{ 64, -64, 0, 0, (31 << 6), (31 << 6), 0x1f, 0x1f, 0xff, 0xff
},
{ -64, -64, 0, 0, ( 0 << 6), (31 << 6), 0, 0x1f, 0xff, 0xff
},
#endif
/* second 4 points used for perspective test... */
{ -64, 0, 64, 0, ( 0 << 6), ( 0 << 6), 0, 0, 0xff, 0xff },
{ 64, 0, 64, 0, (127 << 6), ( 0 << 6), 0x1f, 0, 0xff, 0xff },
{ 64, 0, -64, 0, (127 << 6), (127 << 6), 0x1f, 0x1f, 0xff, 0xff },
{ -64, 0, -64, 0, ( 0 << 6), (127 << 6), 0, 0x1f, 0xff, 0xff },
};
Gfx rdp6M_square1[MAX_STATIC_GFX_SIZE] = {
gsSPClearGeometryMode(G_ZBUFFER),
gsSPClearGeometryMode(G_CULL_BACK),
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
gsDPSetColorImage(G_IM_FMT_RGBA, G_IM_SIZ_32b, SCREEN_WD,
OS_K0_TO_PHYSICAL(L26R)),
gsDPPipeSync(),
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
gsDPSetTextureFilter(G_TF_BILERP),
gsDPLoadTextureBlock(rdp6M_RGBA16grid, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0,
G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD),
gsSPVertex(&(q1[0]), 4, 0),
gsSP1Triangle(0, 1, 2, 0),
gsSP1Triangle(0, 2, 3, 0),
gsSPTexture(128, 128, 0, G_TX_RENDERTILE, G_OFF), /* done; turn texture off*/
gsSPEndDisplayList(),
};