-FLAGS=-0 -d2 \r
-SRC=src\\r
-SRCLIB=$(SRC)lib\\r
-all: test.exe pcxtest.exe test2.exe scroll.exe\r
+OFLAGS=-ot -ox -ob -ol -oh -or
+FLAGS=-0 -d2 -mh -wo $(OFLAGS)
+DIRSEP=\
+SRC=src$(DIRSEP)\r
+SRCLIB=$(SRC)lib$(DIRSEP)
+JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)
+\r
+all: test.exe pcxtest.exe test2.exe scroll.exe maptest.exe\r
\r
scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj\r
wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj# 16/lib/x/modex.lib\r
wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj\r
\r
maptest.exe: maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj\r
- wcl $(FLAGS) maptest.obj jsmn.obj modex16.obj bitmap.obj\r
+ wcl $(FLAGS) maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj\r
\r
\r
test.obj: $(SRC)test.c $(SRCLIB)modex16.h\r
pcxtest.obj: $(SRC)pcxtest.c $(SRCLIB)modex16.h\r
wcl $(FLAGS) -c $(SRC)pcxtest.c\r
\r
-maptest.obj: $(SRC)maptest.c $(SRCLIB)mapread.h\r
+maptest.obj: $(SRC)maptest.c $(SRCLIB)modex16.h\r
wcl $(FLAGS) -c $(SRC)maptest.c\r
+
\r
modex16.obj: $(SRCLIB)modex16.h $(SRCLIB)modex16.c\r
wcl $(FLAGS) -c $(SRCLIB)modex16.c\r
planar.obj: $(SRCLIB)planar.h $(SRCLIB)planar.c\r
wcl $(FLAGS) -c $(SRCLIB)planar.c\r
\r
-mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c jsmn.obj lib_head.obj\r
+mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c lib_head.obj jsmn.obj\r
wcl $(FLAGS) -c $(SRCLIB)mapread.c\r
\r
lib_head.obj: $(SRCLIB)lib_head.h $(SRCLIB)lib_head.c\r
wcl $(FLAGS) -c $(SRCLIB)lib_head.c\r
\r
-jsmn.obj: $(SRCLIB)jsmn\jsmn.h $(SRCLIB)jsmn\jsmn.c\r
- wcl $(FLAGS) -c $(SRCLIB)jsmn\jsmn.c\r
+jsmn.obj: $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c\r
+ wcl $(FLAGS) -c $(JSMNLIB)jsmn.c\r
\r
clean:\r
del *.obj\r
\r
void\r
oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) {\r
- byte plane;\r
- word px, py;\r
- word offset;\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
+ /* 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
+ 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
}
\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
+ 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
+ // 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++) {
+ 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
}\r
*/
\r
void main() {\r
- bitmap_t bmp;
- planar_buf_t *p;\r
- int i;\r
- page_t page;\r
- word start;
- int plane;\r
- float t1, t2;\r
-\r
- page=modexDefaultPage();\r
-\r
- bmp = bitmapLoadPcx("data/koishi~~.pcx");
- p = planar_buf_from_bitmap(&bmp);\r
- modexEnter();\r
-\r
- /* fix up the palette and everything */\r
- modexPalUpdate(&bmp, 0, 0, 0);\r
-\r
- /* clear and draw one sprite and one bitmap */\r
- modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
-\r
- /* non sprite comparison */
- start = *clock;\r
- for(i=0; i<100 ;i++) {\r
- oldDrawBmp(VGA, 20, 20, &bmp, 0);\r
- }\r
-\r
- start = *clock;\r
- for(i=0; i<100 ;i++) {\r
- modexDrawBmp(&page, 20, 20, &bmp);\r
- }\r
- t1 = (*clock-start) /18.2;\r
-\r
- start = *clock;\r
- for(i=0; i<100; i++) {\r
- modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64);\r
- }\r
- t2 = (*clock-start)/18.2;\r
-\r
-\r
- start = *clock;\r
- for(i=0; i<100 ;i++) {\r
- oldDrawBmp(VGA, 20, 20, &bmp, 1);\r
- }\r
-\r
-\r
- start = *clock;\r
- for(i=0; i<100 ;i++) {\r
- modexDrawSprite(&page, 20, 20, &bmp);\r
- }
- //_fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2));
+ bitmap_t bmp;
+ planar_buf_t *p;\r
+ int i;\r
+ page_t page;\r
+ word start;
+ int plane;\r
+ float t1, t2;\r
+\r
+ page=modexDefaultPage();\r
+\r
+//0000 bmp = bitmapLoadPcx("data/koishi~~.pcx");
+ bmp = bitmapLoadPcx("data/chikyuu.pcx");
+//0000 p = planar_buf_from_bitmap(&bmp);\r
+ modexEnter();\r
+\r
+ /* fix up the palette and everything */\r
+//++++ modexPalUpdate(&bmp, 0, 0, 0);\r
+\r
+ /* clear and draw one sprite and one bitmap */\r
+ modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
+\r
+ /* non sprite comparison */
+ /*0000start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+ oldDrawBmp(VGA, 20, 20, &bmp, 0);\r
+ }\r
+\r
+ start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+//0000 modexDrawBmp(&page, 20, 20, &bmp);
+ modexDrawBmp(&page, 0, 0, &bmp);\r
+ }\r
+ t1 = (*clock-start) /18.2;\r
+\r
+ start = *clock;\r
+ for(i=0; i<100; i++) {\r
+//0000 modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64);
+ modexCopyPageRegion(&page, &page, 0, 0, 0, 0, 320, 240);\r
+ }\r
+ t2 = (*clock-start)/18.2;\r
+\r
+\r
+ start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+ oldDrawBmp(VGA, 20, 20, &bmp, 1);\r
+ }\r
+\r
+\r
+ start = *clock;\r
+ for(i=0; i<100 ;i++) {\r
+//0000 modexDrawSprite(&page, 20, 20, &bmp);
+ modexDrawSprite(&page, 0, 0, &bmp);\r
+ }*/
+ //_fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2));
while(!kbhit())
{
//DrawPBuf(&page, 0, 0, p, 0);
+ modexDrawBmp(&page, 0, 0, &bmp);
}
- modexLeave();\r
+ modexLeave();\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
+//0000 printf("CPU to VGA: %f\n", t1);\r
+//0000 printf("VGA to VGA: %f\n", t2);\r
+ return;\r
}\r