-#include <stdio.h>\r
+#include <stdio.h>
+#include <string.h>\r
#include "src\lib\modex16.h"\r
-#include "src\lib\bitmap.h"\r
+#include "src\lib\bitmap.h"
+#include "src\lib\planar.c"\r
\r
word far* clock= (word far*) 0x046C; /* 18.2hz clock */\r
\r
}\r
}\r
}\r
+
+void\r
+DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite)
+{\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 < p->width; px+=4) {\r
+ offset=px;\r
+ for(py=0; py<p->height/2; py++) {
+ SELECT_ALL_PLANES();\r
+ if(!sprite || p->plane[offset])\r
+ page->data = p->plane;\r
+ //offset+=p->width;
+ //offset++;\r
+ }\r
+ }\r
+ }\r
+}\r
+
\r
void main() {\r
- bitmap_t bmp;\r
+ bitmap_t bmp;
+ planar_buf_t *p;\r
int i;\r
page_t page;\r
- word start;\r
+ word start;
+ int plane;\r
float t1, t2;\r
\r
page=modexDefaultPage();\r
\r
- bmp = bitmapLoadPcx("data\46113319.pcx");\r
+ bmp = bitmapLoadPcx("data/ed.pcx");
+ p = planar_buf_from_bitmap(&bmp);\r
modexEnter();\r
\r
/* fix up the palette and everything */\r
/* clear and draw one sprite and one bitmap */\r
modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
\r
- /* non sprite comparison */\r
- start = *clock;\r
+ /* non sprite comparison */
+ /*start = *clock;\r
for(i=0; i<100 ;i++) {\r
oldDrawBmp(VGA, 20, 20, &bmp, 0);\r
}\r
start = *clock;\r
for(i=0; i<100 ;i++) {\r
modexDrawSprite(&page, 20, 20, &bmp);\r
- }\r
+ }*/
+ while(!kbhit())
+ {
+ DrawPBuf(&page, 0, 0, p, 0);
+ }
modexLeave();\r
-\r
- printf("CPU to VGA: %f\n", t1);\r
- printf("VGA to VGA: %f\n", t2);\r
+
+ printf("\n%d\n", sizeof(p->plane));
+ printf("%d\n", sizeof(bmp));\r
+ //printf("CPU to VGA: %f\n", t1);\r
+ //printf("VGA to VGA: %f\n", t2);\r
return;\r
}\r
#include "src\lib\modex16.h"\r
#include <stdio.h>\r
#include <stdlib.h>\r
-#include <string.h>\r
#include "src\lib\dos_kb.h"\r
#include "16\lib\x\modex.h"\r
#include "src\lib\wtest\wtest.c"\r
modexClearRegion(bg->page, 5*16, 5*16, 16, 16, 255);\r
\r
modexShowPage(spri->page);\r
- //memcpy ( &mv2, p, (p->pwidth*(p->height))+1 );\r
while(!keyp(1) && player.hp>0)\r
{\r
//top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r