inp006.c
1.98 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
#include <bstring.h>
#include <stdio.h>
#include "inp.h"
static void passThrough(void);
static void initTwoCycleKeyMode(cc_t *);
int
main(int argc, char *argv[])
{
printHeader();
passThrough();
printTrailingCycles();
}
static void
passThrough(void)
{
cc_t cc;
cc_t *ccp = &cc;
int i;
printf("# Verify X (SUBA) inputs are passed through to pixel outputs\n");
initTwoCycleKeyMode(ccp);
ccp->center_r = ccp->center_g = ccp->center_b = 0x0;
ccp->scale_r = ccp->scale_g = ccp->scale_b = 0x0;
for (i = 0; i < 9; i++) {
ccp->tf_b = 1 << i;
printVector(ccp, 1);
printVector(ccp, 1);
}
ccp->tf_b = 0;
for (i = 0; i < 9; i++) {
ccp->tf_g = 1 << i;
printVector(ccp, 1);
printVector(ccp, 1);
}
ccp->tf_g = 0;
for (i = 0; i < 9; i++) {
ccp->tf_r = 1 << i;
printVector(ccp, 1);
printVector(ccp, 1);
}
ccp->tf_r = 0;
}
static void
initTwoCycleKeyMode(cc_t *ccp)
{
bzero(ccp, sizeof(*ccp));
ccp->ncyc = 1; /* two cycle mode */
ccp->st_span = 1; /* set phase */
ccp->key_en = 1; /* enable keying */
printf("# Start two cycle mode w/keying \n");
printVector(ccp, 0);
ccp->st_span = 0; /* allow clocking to begin */
printVector(ccp, 0);
/* Initialize cycle 0 color selects to (0,0,0,1) */
ccp->cc_x_sel_0_r = CC_SUBA_ZERO;
ccp->cc_y_sel_0_r = CC_SUBB_ZERO;
ccp->cc_a_sel_0_r = CC_MULT_ZERO;
ccp->cc_c_sel_0_r = CC_ADD_ONE;
/* Initialize cycle 0 alpha selects to (0,0,0,1) */
ccp->cc_x_sel_0_a = CC_SUBA_ZERO_ALPHA;
ccp->cc_y_sel_0_a = CC_SUBB_ZERO_ALPHA;
ccp->cc_a_sel_0_a = CC_MULT_ZERO_ALPHA;
ccp->cc_c_sel_0_a = CC_ADD_ONE_ALPHA;
/* Initialize cycle 1 color selects to (tex 1, center, scale, tex 1) */
ccp->cc_x_sel_1_r = CC_SUBA_TEX_1;
ccp->cc_y_sel_1_r = CC_SUBB_CENTER;
ccp->cc_a_sel_1_r = CC_MULT_SCALE;
ccp->cc_c_sel_1_r = CC_ADD_TEX_1;
/* Initialize cycle 1 alpha selects to (0,0,0,0) */
ccp->cc_x_sel_1_a = CC_SUBA_ZERO_ALPHA;
ccp->cc_y_sel_1_a = CC_SUBB_ZERO_ALPHA;
ccp->cc_a_sel_1_a = CC_MULT_ZERO_ALPHA;
ccp->cc_c_sel_1_a = CC_ADD_ZERO_ALPHA;
}