5 word far* clock= (word far*) 0x046C; /* 18.2hz clock */
\r
8 oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) {
\r
13 /* TODO Make this fast. It's SLOOOOOOW */
\r
14 for(plane=0; plane < 4; plane++) {
\r
15 modexSelectPlane(PLANE(plane+x));
\r
16 for(px = plane; px < bmp->width; px+=4) {
\r
18 for(py=0; py<bmp->height; py++) {
\r
19 if(!sprite || bmp->data[offset])
\r
20 page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];
\r
34 page=modexDefaultPage();
\r
36 bmp = bitmapLoadPcx("46113319.pcx");
\r
39 /* fix up the palette and everything */
\r
40 modexPalUpdate(bmp.palette);
\r
42 /* clear and draw one sprite and one bitmap */
\r
43 modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);
\r
45 /* non sprite comparison */
\r
47 for(i=0; i<100 ;i++) {
\r
48 oldDrawBmp(VGA, 20, 20, &bmp, 0);
\r
52 for(i=0; i<100 ;i++) {
\r
53 modexDrawBmp(&page, 20, 20, &bmp);
\r
55 t1 = (*clock-start) /18.2;
\r
58 for(i=0; i<100; i++) {
\r
59 modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64);
\r
61 t2 = (*clock-start)/18.2;
\r
65 for(i=0; i<100 ;i++) {
\r
66 oldDrawBmp(VGA, 20, 20, &bmp, 1);
\r
71 for(i=0; i<100 ;i++) {
\r
72 modexDrawSprite(&page, 20, 20, &bmp);
\r
76 printf("CPU to VGA: %f\n", t1);
\r
77 printf("VGA to VGA: %f\n", t2);
\r