X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=16%2Fmodex16%2FPCXTEST.C;fp=16%2Fmodex16%2FPCXTEST.C;h=0000000000000000000000000000000000000000;hb=2d527c547173edff234815d495f298e07bc24a18;hp=9cd1903d45bc37401d4d22c641198b88b6203584;hpb=923244a5fb111f4fcef0563bd7b3dbc1a132c6c7;p=16.git diff --git a/16/modex16/PCXTEST.C b/16/modex16/PCXTEST.C deleted file mode 100644 index 9cd1903d..00000000 --- a/16/modex16/PCXTEST.C +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include "modex16.h" - -word far* clock= (word far*) 0x046C; /* 18.2hz clock */ - -void -oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) { - byte plane; - word px, py; - word offset; - - /* TODO Make this fast. It's SLOOOOOOW */ - for(plane=0; plane < 4; plane++) { - modexSelectPlane(PLANE(plane+x)); - for(px = plane; px < bmp->width; px+=4) { - offset=px; - for(py=0; pyheight; py++) { - if(!sprite || bmp->data[offset]) - page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset]; - offset+=bmp->width; - } - } - } -} - -void main() { - bitmap_t bmp; - int i; - page_t page; - word start; - float t1, t2; - - page=modexDefaultPage(); - - bmp = modexLoadPcx("ed.pcx"); - modexEnter(); - - /* fix up the palette and everything */ - modexPalUpdate(bmp.palette); - - /* clear and draw one sprite and one bitmap */ - modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1); - - /* non sprite comparison */ - start = *clock; - for(i=0; i<100 ;i++) { - oldDrawBmp(VGA, 20, 20, &bmp, 0); - } - - start = *clock; - for(i=0; i<100 ;i++) { - modexDrawBmp(&page, 20, 20, &bmp); - } - t1 = (*clock-start) /18.2; - - start = *clock; - for(i=0; i<100; i++) { - modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64); - } - t2 = (*clock-start)/18.2; - - - start = *clock; - for(i=0; i<100 ;i++) { - oldDrawBmp(VGA, 20, 20, &bmp, 1); - } - - - start = *clock; - for(i=0; i<100 ;i++) { - modexDrawSprite(&page, 20, 20, &bmp); - } - modexLeave(); - - printf("CPU to VGA: %f\n", t1); - printf("VGA to VGA: %f\n", t2); - return; -}