make_ci8_tex.c
1.11 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
/*
* make color index lut for 256 entries, a linear ramp
* make color index tex, a linear ramp
*/
#include <stdio.h>
#include <stdlib.h>
#define DEF_RED 0x80
#define DEF_GRN 0x80
#define DEF_BLU 0x80
#define DEF_ALP 0xff
main(int argc, char **argv)
{
int i, j, flag, clr, red, grn, blu;
int quadricate = 0;
int c;
extern int optind;
extern char *optarg;
char *qstr;
char flags[] = "HW_FLAGS";
quadricate = 1;
qstr = getenv(flags);
*argv++;
if (qstr != 0) {
if (strcmp(qstr, "-D_HW_VERSION_2") == 0) quadricate = 0;
}
printf("unsigned short palette256[] = {");
for(i = 0; i < 256; i++)
{
if(!(i % 8))
printf("\n");
if(quadricate)
printf("0x%02xff, 0x%02xff, 0x%02xff, 0x%02xff,\n", i, i, i, i);
else
printf("0x%02xff, ", i);
}
printf("};\n");
printf("\n");
printf("static Gfx CI8ramp_dummy_aligner[] = { gsSPEndDisplayList() };\n");
printf("unsigned char CI8ramp[] = {\n");
for(j = 0; j < 256; j++)
{
if(!(j % 8))
printf("\n");
printf("0x%02x, ", j);
}
printf("};\n");
}