X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fplanrpcx.c;h=9792a024fbcf6f7d1e70b77327b414c11637eab9;hb=1cc75f46d15728fed75f53a2243c9ad4c8234511;hp=1eafcd6c9efdfdd072362c040a7268e5d7df80bc;hpb=b9a83c612a7692ac68a527fcf1198deffe79e0d9;p=16.git diff --git a/src/planrpcx.c b/src/planrpcx.c index 1eafcd6c..9792a024 100755 --- a/src/planrpcx.c +++ b/src/planrpcx.c @@ -28,11 +28,11 @@ #include "src/lib/planar.h" global_game_variables_t gvar; +bitmap_t bmp; +planar_buf_t *p; void main(int argc, char *argv[]) { - bitmap_t bmp; - planar_buf_t *p; int i; word start; int plane; @@ -42,17 +42,20 @@ void main(int argc, char *argv[]) sword baka; char *bakapeee; + byte l[1024]; + word j,chw,xp,col,bgcol; + + bakapeee = malloc(64); - if(argv[1]) bakapeee = argv[1]; - else bakapeee = "data/koishi~.pcx"; + if(argv[1]) bakapeee = argv[1]; + else bakapeee = "data/koishi~.pcx"; -// if(argv[2]) baka = atoi(argv[2]); -// else +// if(argv[2]) baka = atoi(argv[2]); +// else baka = 1; -//0000 bmp = bitmapLoadPcx("data/koishi~~.pcx"); - bmp = bitmapLoadPcx(bakapeee); - //bmp = bitmapLoadPcx("data/koishi~.pcx"); + + bmp = bitmapLoadPcx(bakapeee); p = planar_buf_from_bitmap(&bmp); VGAmodeX(baka, &gvar); gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]); @@ -71,21 +74,18 @@ baka = 1; /* non sprite comparison */ start = *clockw; // oldDrawBmp(VGA, 20, 20, &bmp, 0); -//0000 modexDrawBmp(&gvar.video.page[0], 20, 20, &bmp); -// modexDrawBmp(&gvar.video.page[0], 160, 120, &bmp); -// t1 = (*clockw-start) /18.2; + for(i=0; i<100 ;i++) { + modexDrawBmp(&gvar.video.page[0], 32, 32, &bmp); + } + t1 = (*clockw-start) /18.2; // start = *clockw; -//0000 modexCopyPageRegion(&gvar.video.page[0], &gvar.video.page[0], 20, 20, 128, 20, 64, 64); // modexCopyPageRegion(&gvar.video.page[0], &gvar.video.page[0], 0, 0, 0, 0, 320, 240); // t2 = (*clockw-start)/18.2; -// start = *clockw; -// oldDrawBmp(VGA, 20, 20, &bmp, 1); -//0000 modexDrawSprite(&gvar.video.page[0], 20, 20, &bmp); -// modexDrawSprite(&gvar.video.page[0], 160, 120, &bmp); + start = *clockw; for(i=0; i<100 ;i++) { - DrawPBuf(&gvar.video.page[0], 0, 0, p, 0); + //DrawPBuf(&gvar.video.page[0], 0, 0, p, 0); } - t1 = (*clockw-start) /18.2; + t2 = (*clockw-start) /18.2; while(!kbhit()) { } @@ -106,6 +106,27 @@ baka = 1; printf("\n"); } } + col=0x0d, bgcol=0; + for(i=0; i<8; i++) + { + /*modexSelectPlane(PLANE(x)); + j=1<<8; + *bakapee=(l[i] & j ? col:bgcol); + _fmemcpy(page->data + (((page->width/4) * (y+page->dy+i)) + ((x+page->dx+chw) / 4)), bakapee, 8);*/ + j=4<<8; + fprintf(stderr, "j<<=%u\n", j); + xp=0; + while(j) + { + //modexputPixel(page, x+xp+chw, y+i, l[i] & j ? col:bgcol); + //fprintf(stderr, "%u", l[i] & j ? col:bgcol); + xp++; + j>>=4; + fprintf(stderr, " j>>=%u\n", j); + } + //fprintf(stderr, "\n"); + } + chw += xp; fprintf(stderr,"Project 16 planrpcx.exe. This is just a test file!\n"); fprintf(stderr,"version %s\n", VERSION); fprintf(stderr,"%d\n", sizeof(p->plane)); @@ -113,9 +134,11 @@ baka = 1; fprintf(stderr,"ph=%d\n", p->height); fprintf(stderr,"ppw=%d\n", p->pwidth); fprintf(stderr,"%d\n", sizeof(bmp)); + fprintf(stderr,"%dx%d\n", gvar.video.page[0].sw-(p->width), gvar.video.page[0].sh-(p->height)); planar_buf_free(p); - fprintf(stderr, "CPU to VGA: %f\n", t1); -// fprintf(stderr, "VGA to VGA: %f\n", t2); + free(bakapeee); + fprintf(stderr, "modexDrawBmp: %f\n", t1); + fprintf(stderr, "DrawPBuf: %f\n", t2); fprintf(stderr, "gvar.video.page[0].width: %u\n", gvar.video.page[0].width); fprintf(stderr, "gvar.video.page[0].height: %u\n", gvar.video.page[0].height); return;