void\r
oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite)\r
{\r
- byte plane;\r
- word px, py;\r
- word offset;\r
-\r
- /* TODO Make this fast. It's SLOOOOOOW */\r
- for(plane=0; plane < 4; plane++) {\r
- modexSelectPlane(PLANE(plane+x));\r
- for(px = plane; px < bmp->width; px+=4) {\r
- offset=px;\r
- for(py=0; py<bmp->height; py++) {\r
- if(!sprite || bmp->data[offset])\r
- page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];\r
- offset+=bmp->width;\r
- }\r
- }\r
- }\r
+ byte plane;\r
+ word px, py;\r
+ word offset;\r
+\r
+ /* TODO Make this fast. It's SLOOOOOOW */\r
+ for(plane=0; plane < 4; plane++) {\r
+ modexSelectPlane(PLANE(plane+x));\r
+ for(px = plane; px < bmp->width; px+=4) {\r
+ offset=px;\r
+ for(py=0; py<bmp->height; py++) {\r
+ if(!sprite || bmp->data[offset])\r
+ page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];\r
+ offset+=bmp->width;\r
+ }\r
+ }\r
+ }\r
}\r
\r
+void\r
+CDrawBmp(byte far* vgamem, page_t* page, int x, int y, bitmap_t *bmp, byte sprite)\r
+{\r
+ byte plane;\r
+ word px, py;\r
+ word offset=0;\r
+\r
+\r
+ /* TODO Make this fast. It's SLOOOOOOW */\r
+ for(plane=0; plane < 4; plane++) {\r
+ modexSelectPlane(PLANE(plane+x));\r
+ for(px = plane; px < bmp->width; px+=4) {\r
+ offset=px;\r
+ for(py=0; py<bmp->height; py++) {\r
+ if(!sprite || bmp->data[offset])\r
+ //modexputPixel(page, x+px, y+py, bmp->data[offset]);\r
+ vgamem[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];\r
+ offset+=bmp->width;\r
+ }\r
+ }\r
+ }\r
+}\r
\r
void\r
modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) {\r
}\r
}\r
\r
+/////////////////////////////////////////////////////////////////////////////\r
+// //\r
+// cls() - This clears the screen to the specified color, on the VGA or on //\r
+// the Virtual screen. //\r
+// //\r
+/////////////////////////////////////////////////////////////////////////////\r
+void cls(page_t *page, byte color, byte *Where)\r
+{\r
+ //modexClearRegion(page, 0, 0, page->width, page->height, color);\r
+ /* set map mask to all 4 planes */\r
+ outpw(SC_INDEX, 0xff02);\r
+ //_fmemset(VGA, color, 16000);\r
+ _fmemset(Where, color, page->width*(page->height));\r
+}\r
+\r
void\r
modexWaitBorder() {\r
while(inp(INPUT_STATUS_1) & 8) {\r