]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/modex16.c
wwww
[16.git] / src / lib / modex16.c
index e3e70397b36b4241f4240b2c318d10449151a97e..eaf9966c805f047ddb35804d6967d2161d086277 100755 (executable)
@@ -284,24 +284,46 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte  color) {
 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
@@ -1166,6 +1188,21 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c
        }\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