OSDN Git Service

major changes to entire project for tweaking it amd making it cleaner!! OK PNGWEN...
[proj16/16.git] / src / test2.c
1 /* Project 16 Source Code~
2  * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
3  *
4  * This file is part of Project 16.
5  *
6  * Project 16 is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Project 16 is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>, or
18  * write to the Free Software Foundation, Inc., 51 Franklin Street,
19  * Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  */
22
23 #include <stdio.h>
24 #include <conio.h>
25 #include "src/lib/modex16.h"\r
26 #include "src/lib/planar.h"\r
27 //#include "src/lib/bitmap.h"\r
28 \r
29 word far* clockw= (word far*) 0x046C; /* 18.2hz clock */\r
30 \r
31 void main() {
32         FILE *file;\r
33     bitmap_t bmp;\r
34     planar_buf_t *p;\r
35     word size;\r
36     int i;\r
37     int plane;\r
38     int x,y;\r
39     //byte color;\r
40 \r
41     /* get the size we want */\r
42     /*printf("Width: ");\r
43     scanf("%d", &bmp.width);\r
44     printf("Height: ");\r
45     scanf("%d", &bmp.height);\r
46     printf("Color: ");\r
47     scanf("%x", &color);*/\r
48 \r
49     /* allocate the bmp and fill it with 42 */\r
50     /*size = bmp.width * bmp.height;\r
51     bmp.data = malloc(size);\r
52     for(i=0; i<size; i++) {\r
53         bmp.data[i] = color;\r
54     }*/\r
55
56         bmp = bitmapLoadPcx("data/koishi^^.pcx");
57 \r
58     /* create the planar buffer */\r
59     p = planar_buf_from_bitmap(&bmp);\r
60 \r
61     /* print out the contents of each plane */\r
62     for(plane=0; plane < 4; plane++) {\r
63         i=0;\r
64         printf("Plane %d\n", plane);\r
65         for(y=0; y < p->height; y++) {\r
66             for(x=0; x < p->pwidth; x++) {\r
67                 printf("%02X ", (int) p->plane[plane][i++]);\r
68             }\r
69             printf("\n");\r
70         }\r
71     }
72                 /*__asm
73                 {
74                         mov ah,31h
75                         int 21h
76                 }*/
77
78 //      file = fopen("ptmp0.pcx", "wb");
79 \r
80     /* write the data to the file */\r
81     //fwrite(p, 1, p->width*p->height, file);\r
82     //fclose(file);\r
83 }\r