From: sparky4 <sparky4@cock.li>
Date: Fri, 13 Feb 2015 18:20:17 +0000 (-0600)
Subject: meh~
X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=f7a1230c87968e99ce6776e5ca0afe787670e289;p=16.git

meh~

	modified:   pcxtest.exe
	modified:   scroll.exe
	modified:   src/pcxtest.c
	modified:   src/scroll.c
	modified:   src/test2.c
	modified:   test2.exe
---

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