1 /* Project 16 Source Code~
2 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
4 * This file is part of Project 16.
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.
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.
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.
25 #include "src/lib/modex16.h"
\r
26 #include "src/lib/planar.h"
\r
27 //#include "src/lib/bitmap.h"
\r
29 word far* clockw= (word far*) 0x046C; /* 18.2hz clock */
\r
41 /* get the size we want */
\r
42 /*printf("Width: ");
\r
43 scanf("%d", &bmp.width);
\r
45 scanf("%d", &bmp.height);
\r
47 scanf("%x", &color);*/
\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
56 bmp = bitmapLoadPcx("data/koishi^^.pcx");
58 /* create the planar buffer */
\r
59 p = planar_buf_from_bitmap(&bmp);
\r
61 /* print out the contents of each plane */
\r
62 for(plane=0; plane < 4; plane++) {
\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
78 // file = fopen("ptmp0.pcx", "wb");
80 /* write the data to the file */
\r
81 //fwrite(p, 1, p->width*p->height, file);
\r