]>
Commit | Line | Data |
---|---|---|
1 | #include "mandelfpga.c" | |
2 | #include <stdio.h> | |
3 | ||
4 | void main() | |
5 | { | |
6 | int y,x; | |
7 | ||
8 | for (y=0; y < MANDELFPGA_HEIGHT; y++) | |
9 | { | |
10 | ||
11 | for (x=0; x < MANDELFPGA_WIDTH; x++) | |
12 | { | |
13 | unsigned char *p = &MANDELFPGA_PIXEL_DATA[MANDELFPGA_BYTES_PER_PIXEL*(MANDELFPGA_WIDTH*y+x)]; | |
14 | if (p[0] == 0 && p[1] == 0 && p[2] == 0) | |
15 | printf("00\n"); | |
16 | else if (p[0] == 255 && p[1] == 0 && p[2] == 0) | |
17 | printf("10\n"); | |
18 | else if (p[0] == 0 && p[1] == 255 && ((p[2] == 0) || (p[2] == 36))) | |
19 | printf("01\n"); | |
20 | else if (p[0] == 255 && p[1] == 255 && p[2] == 255) | |
21 | printf("11\n"); | |
22 | else | |
23 | fprintf(stderr, "o shi, what is %d %d %d\n", p[0], p[1], p[2]); | |
24 | } | |
25 | for (; x < 128; x++) | |
26 | printf("00\n"); // XST can't take don't cares there. sad face | |
27 | } | |
28 | } |