]> 4ch.mooo.com Git - 16.git/blob - src/test2.c
oh shit!!!
[16.git] / src / test2.c
1 #include <stdio.h>
2 #include <conio.h>
3 #include "src/lib/modex16.h"\r
4 #include "src/lib/planar.h"\r
5 #include "src/lib/bitmap.h"\r
6 \r
7 word far* clock= (word far*) 0x046C; /* 18.2hz clock */\r
8 \r
9 void main() {
10         FILE *file;\r
11     bitmap_t bmp;\r
12     planar_buf_t *p;\r
13     word size;\r
14     int i;\r
15     int plane;\r
16     int x,y;\r
17     //byte color;\r
18 \r
19     /* get the size we want */\r
20     /*printf("Width: ");\r
21     scanf("%d", &bmp.width);\r
22     printf("Height: ");\r
23     scanf("%d", &bmp.height);\r
24     printf("Color: ");\r
25     scanf("%x", &color);*/\r
26 \r
27     /* allocate the bmp and fill it with 42 */\r
28     /*size = bmp.width * bmp.height;\r
29     bmp.data = malloc(size);\r
30     for(i=0; i<size; i++) {\r
31         bmp.data[i] = color;\r
32     }*/\r
33
34         bmp = bitmapLoadPcx("data/koishi^^.pcx");
35 \r
36     /* create the planar buffer */\r
37     p = planar_buf_from_bitmap(&bmp);\r
38 \r
39     /* print out the contents of each plane */\r
40     for(plane=0; plane < 4; plane++) {\r
41         i=0;\r
42         printf("Plane %d\n", plane);\r
43         for(y=0; y < p->height; y++) {\r
44             for(x=0; x < p->pwidth; x++) {\r
45                 printf("%02X ", (int) p->plane[plane][i++]);\r
46             }\r
47             printf("\n");\r
48         }\r
49     }
50                 /*__asm
51                 {
52                         mov ah,31h
53                         int 21h
54                 }*/
55
56 //      file = fopen("ptmp0.pcx", "wb");
57 \r
58     /* write the data to the file */\r
59     //fwrite(p, 1, p->width*p->height, file);\r
60     //fclose(file);\r
61 }\r