]> Joshua Wise's Git repositories - mandelfpga.git/blob - ctoreadmemb.c
Initial revision -- unknown as to whether it works, post-precision increment.
[mandelfpga.git] / ctoreadmemb.c
1 #include "mandelfpga.c"
2 #include <stdio.h>
3
4 // w t f, the data is inverted somehow :psyduck:
5 void main()
6 {
7   int y,x;
8   
9   for (y=MANDELFPGA_HEIGHT-1; y >= 0; y--)
10   {
11     for (x = MANDELFPGA_WIDTH; x < 128; x++)
12       printf("00\n");   // XST can't take don't cares there. sad face
13     for (x=MANDELFPGA_WIDTH-1; x >= 0; x--)
14     {
15       unsigned char *p = &MANDELFPGA_PIXEL_DATA[MANDELFPGA_BYTES_PER_PIXEL*(MANDELFPGA_WIDTH*y+x)];
16       if (p[0] == 0 && p[1] == 0 && p[2] == 0)
17         printf("00\n");
18       else if (p[0] == 255 && p[1] == 0 && p[2] == 0)
19         printf("10\n");
20       else if (p[0] == 0 && p[1] == 255 && ((p[2] == 0) || (p[2] == 36)))
21         printf("01\n");
22       else if (p[0] == 255 && p[1] == 255 && p[2] == 255)
23         printf("11\n");
24       else
25         fprintf(stderr, "o shi, what is %d %d %d\n", p[0], p[1], p[2]);
26     }
27     
28   }
29 }
This page took 0.025867 seconds and 4 git commands to generate.