]> Joshua Wise's Git repositories - mandelfpga.git/blame - ctoreadmemb.c
Add readout
[mandelfpga.git] / ctoreadmemb.c
CommitLineData
05c0805b
JW
1#include "mandelfpga.c"
2#include <stdio.h>
3
05c0805b
JW
4void main()
5{
6 int y,x;
7
ca018365 8 for (y=0; y < MANDELFPGA_HEIGHT; y++)
05c0805b 9 {
ca018365
JW
10
11 for (x=0; x < MANDELFPGA_WIDTH; x++)
05c0805b
JW
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 }
ca018365
JW
25 for (; x < 128; x++)
26 printf("00\n"); // XST can't take don't cares there. sad face
05c0805b
JW
27 }
28}
This page took 0.025223 seconds and 4 git commands to generate.