OSDN Git Service

meh~
authorsparky4 <sparky4@cock.li>
Fri, 13 Feb 2015 18:20:17 +0000 (12:20 -0600)
committersparky4 <sparky4@cock.li>
Fri, 13 Feb 2015 18:20:17 +0000 (12:20 -0600)
modified:   pcxtest.exe
modified:   scroll.exe
modified:   src/pcxtest.c
modified:   src/scroll.c
modified:   src/test2.c
modified:   test2.exe

pcxtest.exe
scroll.exe
src/pcxtest.c
src/scroll.c
src/test2.c
test2.exe

index af532db..28dcf31 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index b9c3e64..0da8ba4 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index e2c133c..67e351c 100644 (file)
@@ -1,6 +1,8 @@
-#include <stdio.h>\r
+#include <stdio.h>
+#include <string.h>\r
 #include "src\lib\modex16.h"\r
-#include "src\lib\bitmap.h"\r
+#include "src\lib\bitmap.h"
+#include "src\lib\planar.c"\r
 \r
 word far* clock= (word far*) 0x046C; /* 18.2hz clock */\r
 \r
@@ -23,17 +25,44 @@ oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) {
        }\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
+\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++) {
+               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
 void main() {\r
-    bitmap_t bmp;\r
+    bitmap_t bmp;
+    planar_buf_t *p;\r
     int i;\r
     page_t page;\r
-    word start;\r
+    word start;
+    int plane;\r
     float t1, t2;\r
 \r
     page=modexDefaultPage();\r
 \r
-    bmp = bitmapLoadPcx("data\46113319.pcx");\r
+    bmp = bitmapLoadPcx("data/ed.pcx");
+    p = planar_buf_from_bitmap(&bmp);\r
     modexEnter();\r
 \r
     /* fix up the palette and everything */\r
@@ -42,8 +71,8 @@ void main() {
     /* clear and draw one sprite and one bitmap */\r
     modexClearRegion(&page, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 1);\r
 \r
-    /* non sprite comparison */\r
-    start = *clock;\r
+    /* non sprite comparison */
+    /*start = *clock;\r
     for(i=0; i<100 ;i++) {\r
       oldDrawBmp(VGA, 20, 20, &bmp, 0);\r
     }\r
@@ -70,10 +99,16 @@ void main() {
     start = *clock;\r
     for(i=0; i<100 ;i++) {\r
       modexDrawSprite(&page, 20, 20, &bmp);\r
-    }\r
+    }*/
+       while(!kbhit())
+       {
+               DrawPBuf(&page, 0, 0, p, 0);
+       }
     modexLeave();\r
-\r
-    printf("CPU to VGA: %f\n", t1);\r
-    printf("VGA to VGA: %f\n", t2);\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
 }\r
index d45d784..3831ed2 100644 (file)
@@ -1,7 +1,6 @@
 #include "src\lib\modex16.h"\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
-#include <string.h>\r
 #include "src\lib\dos_kb.h"\r
 #include "16\lib\x\modex.h"\r
 #include "src\lib\wtest\wtest.c"\r
@@ -227,7 +226,6 @@ void main() {
        modexClearRegion(bg->page, 5*16, 5*16, 16, 16, 255);\r
 \r
        modexShowPage(spri->page);\r
-       //memcpy ( &mv2, p, (p->pwidth*(p->height))+1 );\r
        while(!keyp(1) && player.hp>0)\r
        {\r
        //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square\r
index cb0b818..7759156 100644 (file)
@@ -31,7 +31,7 @@ void main() {
        bmp.data[i] = color;\r
     }*/\r
 
-       bmp = bitmapLoadPcx("ptmp.pcx");
+       bmp = bitmapLoadPcx("data/46113319.pcx");
 \r
     /* create the planar buffer */\r
     p = planar_buf_from_bitmap(&bmp);\r
index dad8568..5dc62ad 100644 (file)
Binary files a/test2.exe and b/test2.exe differ