X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fpcxtest.c;h=f735a5597e2561044f64406e85cd453c41e314cd;hb=0ba797bc23c1f81dde8c3959d7b7456bcb737503;hp=67e351c7b6a9c89dcae285145bb6a68e31b09269;hpb=f7a1230c87968e99ce6776e5ca0afe787670e289;p=16.git diff --git a/src/pcxtest.c b/src/pcxtest.c index 67e351c7..f735a559 100644 --- a/src/pcxtest.c +++ b/src/pcxtest.c @@ -1,4 +1,5 @@ #include +#include #include #include "src\lib\modex16.h" #include "src\lib\bitmap.h" @@ -24,8 +25,9 @@ oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) { } } } -} - +} + +/* void DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite) { @@ -33,7 +35,7 @@ DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite) word px, py; word offset; - /* TODO Make this fast. It's SLOOOOOOW */ + // TODO Make this fast. It's SLOOOOOOW for(plane=0; plane < 4; plane++) { modexSelectPlane(PLANE(plane+x)); for(px = plane; px < p->width; px+=4) { @@ -48,7 +50,7 @@ DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite) } } } - +*/ void main() { bitmap_t bmp; @@ -61,18 +63,18 @@ void main() { page=modexDefaultPage(); - bmp = bitmapLoadPcx("data/ed.pcx"); + bmp = bitmapLoadPcx("data/koishi~~.pcx"); p = planar_buf_from_bitmap(&bmp); modexEnter(); /* fix up the palette and everything */ - modexPalUpdate(bmp.palette); + modexPalUpdate(&bmp, 0, 0, 0); /* clear and draw one sprite and one bitmap */ modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1); /* non sprite comparison */ - /*start = *clock; + start = *clock; for(i=0; i<100 ;i++) { oldDrawBmp(VGA, 20, 20, &bmp, 0); } @@ -99,16 +101,17 @@ void main() { start = *clock; for(i=0; i<100 ;i++) { modexDrawSprite(&page, 20, 20, &bmp); - }*/ + } + //_fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2)); while(!kbhit()) { - DrawPBuf(&page, 0, 0, p, 0); + //DrawPBuf(&page, 0, 0, p, 0); } modexLeave(); printf("\n%d\n", sizeof(p->plane)); printf("%d\n", sizeof(bmp)); - //printf("CPU to VGA: %f\n", t1); - //printf("VGA to VGA: %f\n", t2); + printf("CPU to VGA: %f\n", t1); + printf("VGA to VGA: %f\n", t2); return; }