+#include <stdio.h>\r
#include "src\lib\modex16.h"\r
+#include "src\lib\planar.h"\r
+#include "src\lib\bitmap.h"\r
\r
word far* clock= (word far*) 0x046C; /* 18.2hz clock */\r
\r
void main() {\r
+ bitmap_t bmp;\r
+ planar_buf_t *p;\r
+ word size;\r
int i;\r
- word start;\r
- page_t page;\r
+ int plane;\r
+ int x,y;\r
+ byte color;\r
\r
- page=modexDefaultPage();\r
+ /* get the size we want */\r
+ printf("Width: ");\r
+ scanf("%d", &bmp.width);\r
+ printf("Height: ");\r
+ scanf("%d", &bmp.height);\r
+ printf("Color: ");\r
+ scanf("%x", &color);\r
\r
- modexEnter();\r
- start = *clock;\r
- for(i=0; i<500; i++) {\r
- modexShowPage(&page);\r
+ /* allocate the bmp and fill it with 42 */\r
+ size = bmp.width * bmp.height;\r
+ bmp.data = malloc(size);\r
+ for(i=0; i<size; i++) {\r
+ bmp.data[i] = color;\r
}\r
- modexLeave();\r
\r
+ /* create the planar buffer */\r
+ p = planar_buf_from_bitmap(&bmp);\r
+\r
+ /* print out the contents of each plane */\r
+ for(plane=0; plane < 4; plane++) {\r
+ i=0;\r
+ printf("Plane %d\n", plane);\r
+ for(y=0; y < p->height; y++) {\r
+ for(x=0; x < p->pwidth; x++) {\r
+ printf("%02X ", (int) p->plane[plane][i++]);\r
+ }\r
+ printf("\n");\r
+ }\r
+ }\r
}\r