From: sparky4 <sparky4@cock.li>
Date: Sun, 24 May 2015 00:35:23 +0000 (-0500)
Subject: fack!!!! wwww
X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=cb1e2d6d3b2dc7a316ca19e9a5277e2f63b39337;p=16.git

fack!!!! wwww
	modified:   makefile
	modified:   maptest.exe
	modified:   pcxtest.exe
	modified:   scroll.exe
	modified:   src/lib/mapread.c
	modified:   src/maptest.c
	modified:   src/pcxtest.c
	modified:   src/scroll.c
	modified:   test.exe
	modified:   test2.exe
---

diff --git a/makefile b/makefile
index 433caf81..cba89784 100644
--- a/makefile
+++ b/makefile
@@ -1,7 +1,11 @@
-FLAGS=-0 -d2 
-SRC=src\
-SRCLIB=$(SRC)lib\
-all: test.exe pcxtest.exe test2.exe scroll.exe
+OFLAGS=-ot -ox -ob -ol -oh -or
+FLAGS=-0 -d2 -mh -wo $(OFLAGS)
+DIRSEP=\
+SRC=src$(DIRSEP)
+SRCLIB=$(SRC)lib$(DIRSEP)
+JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)
+
+all: test.exe pcxtest.exe test2.exe scroll.exe maptest.exe
 
 scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj
 	wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj# 16/lib/x/modex.lib
@@ -17,7 +21,7 @@ pcxtest.exe: pcxtest.obj modex16.obj bitmap.obj
 	wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj
 
 maptest.exe: maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj
-	wcl $(FLAGS) maptest.obj jsmn.obj modex16.obj bitmap.obj
+	wcl $(FLAGS) maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj
 
 
 test.obj: $(SRC)test.c $(SRCLIB)modex16.h
@@ -29,8 +33,9 @@ test2.obj: $(SRC)test2.c $(SRCLIB)modex16.h
 pcxtest.obj: $(SRC)pcxtest.c $(SRCLIB)modex16.h
 	wcl $(FLAGS) -c $(SRC)pcxtest.c
 
-maptest.obj: $(SRC)maptest.c $(SRCLIB)mapread.h
+maptest.obj: $(SRC)maptest.c $(SRCLIB)modex16.h
 	wcl $(FLAGS) -c $(SRC)maptest.c
+
 
 modex16.obj: $(SRCLIB)modex16.h $(SRCLIB)modex16.c
 	wcl $(FLAGS) -c $(SRCLIB)modex16.c
@@ -44,14 +49,14 @@ bitmap.obj: $(SRCLIB)bitmap.h $(SRCLIB)bitmap.c
 planar.obj: $(SRCLIB)planar.h $(SRCLIB)planar.c
 	wcl $(FLAGS) -c $(SRCLIB)planar.c
 
-mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c jsmn.obj lib_head.obj
+mapread.obj: $(SRCLIB)mapread.h $(SRCLIB)mapread.c lib_head.obj jsmn.obj
 	wcl $(FLAGS) -c $(SRCLIB)mapread.c
 
 lib_head.obj: $(SRCLIB)lib_head.h $(SRCLIB)lib_head.c
 	wcl $(FLAGS) -c $(SRCLIB)lib_head.c
 
-jsmn.obj: $(SRCLIB)jsmn\jsmn.h $(SRCLIB)jsmn\jsmn.c
-	wcl $(FLAGS) -c $(SRCLIB)jsmn\jsmn.c
+jsmn.obj: $(JSMNLIB)jsmn.h $(JSMNLIB)jsmn.c
+	wcl $(FLAGS) -c $(JSMNLIB)jsmn.c
 
 clean:
 	del *.obj
diff --git a/maptest.exe b/maptest.exe
index ec5c9720..e08e7d4e 100644
Binary files a/maptest.exe and b/maptest.exe differ
diff --git a/pcxtest.exe b/pcxtest.exe
index 478916cf..2b66334a 100644
Binary files a/pcxtest.exe and b/pcxtest.exe differ
diff --git a/scroll.exe b/scroll.exe
index 38e70859..f6d853d7 100644
Binary files a/scroll.exe and b/scroll.exe differ
diff --git a/src/lib/mapread.c b/src/lib/mapread.c
index 73fefcd0..8f84071a 100644
--- a/src/lib/mapread.c
+++ b/src/lib/mapread.c
@@ -26,7 +26,7 @@ static int dump(const char *js, jsmntok_t *t, size_t count, int indent, /*char *
 
 				FUCK well i am stuck.... wwww
 			*/
-//++++			map->data[q] = (byte)strtol(js+t->start, (char **)t->end, 10);
+			map->data[q] = (byte)strtol(js+t->start, (char **)t->end, 10);
 //			printf("%d[%d]", q, map->data[q]);
 		}
 		else
@@ -112,7 +112,7 @@ static int loadmap(char *mn, map_t *map)
 
 	/* Prepare parser */
 	jsmn_init(&p);
-fprintf(stderr, "b4 malloc\n");
+
 	/* Allocate some tokens as a start */
 	tok = malloc(sizeof(*tok) * tokcount);
 	if (tok == NULL) {
@@ -161,7 +161,6 @@ again:
 			eof_expected = 1;
 		}
 	}
-fprintf(stderr, "a4 malloc\n");
 
 	free(js);
 	free(tok);
diff --git a/src/maptest.c b/src/maptest.c
index ae016eec..dfcd300d 100644
--- a/src/maptest.c
+++ b/src/maptest.c
@@ -4,7 +4,6 @@ void
 main(int argc, char *argv[])
 {
 	map_t map;
-	fprintf(stderr, "wwww\n");
 	//loadmap("data/test.map", &map);
-	fprintf(stderr, "wwww\n");
+	fprintf(stderr, "%d\n", map.data[0]);
 }
diff --git a/src/pcxtest.c b/src/pcxtest.c
index 60cc85e2..be8dcc7a 100644
--- a/src/pcxtest.c
+++ b/src/pcxtest.c
@@ -9,109 +9,114 @@ word far* clock= (word far*) 0x046C; /* 18.2hz clock */
 
 void
 oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) {
-    byte plane;
-    word px, py;
-    word offset;
+	byte plane;
+	word px, py;
+	word offset;
 
-    /* TODO Make this fast.  It's SLOOOOOOW */
-    for(plane=0; plane < 4; plane++) {
+	/* TODO Make this fast.  It's SLOOOOOOW */
+	for(plane=0; plane < 4; plane++) {
 	modexSelectPlane(PLANE(plane+x));
 	for(px = plane; px < bmp->width; px+=4) {
-	    offset=px;
-	    for(py=0; py<bmp->height; py++) {
+		offset=px;
+		for(py=0; py<bmp->height; py++) {
 		if(!sprite || bmp->data[offset])
 		  page[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset];
 		offset+=bmp->width;
-	    }
+		}
+	}
 	}
-    }
 }
 
 /*
 void
 DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite)
 {
-    byte plane;
-    word px, py;
-    word offset;
+	byte plane;
+	word px, py;
+	word offset;
 
-    // TODO Make this fast.  It's SLOOOOOOW
-    for(plane=0; plane < 4; plane++) {
+	// 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++) {
+		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;
-    planar_buf_t *p;
-    int i;
-    page_t page;
-    word start;
-    int plane;
-    float t1, t2;
-
-    page=modexDefaultPage();
-
-    bmp = bitmapLoadPcx("data/koishi~~.pcx");
-    p = planar_buf_from_bitmap(&bmp);
-    modexEnter();
-
-    /* fix up the palette and everything */
-    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;
-    for(i=0; i<100 ;i++) {
-      oldDrawBmp(VGA, 20, 20, &bmp, 0);
-    }
-
-    start = *clock;
-    for(i=0; i<100 ;i++) {
-      modexDrawBmp(&page, 20, 20, &bmp);
-    }
-    t1 = (*clock-start) /18.2;
-
-    start = *clock;
-    for(i=0; i<100; i++) {
-    	modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64);
-    }
-    t2 = (*clock-start)/18.2;
-
-
-    start = *clock;
-    for(i=0; i<100 ;i++) {
-      oldDrawBmp(VGA, 20, 20, &bmp, 1);
-    }
-
-
-    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));
+	bitmap_t bmp;
+	planar_buf_t *p;
+	int i;
+	page_t page;
+	word start;
+	int plane;
+	float t1, t2;
+
+	page=modexDefaultPage();
+
+//0000	bmp = bitmapLoadPcx("data/koishi~~.pcx");
+	bmp = bitmapLoadPcx("data/chikyuu.pcx");
+//0000	p = planar_buf_from_bitmap(&bmp);
+	modexEnter();
+
+	/* fix up the palette and everything */
+//++++	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 */
+	/*0000start = *clock;
+	for(i=0; i<100 ;i++) {
+		oldDrawBmp(VGA, 20, 20, &bmp, 0);
+	}
+
+	start = *clock;
+	for(i=0; i<100 ;i++) {
+//0000		modexDrawBmp(&page, 20, 20, &bmp);
+		modexDrawBmp(&page, 0, 0, &bmp);
+	}
+	t1 = (*clock-start) /18.2;
+
+	start = *clock;
+	for(i=0; i<100; i++) {
+//0000		modexCopyPageRegion(&page, &page, 20, 20, 128, 20, 64, 64);
+		modexCopyPageRegion(&page, &page, 0, 0, 0, 0, 320, 240);
+	}
+	t2 = (*clock-start)/18.2;
+
+
+	start = *clock;
+	for(i=0; i<100 ;i++) {
+		oldDrawBmp(VGA, 20, 20, &bmp, 1);
+	}
+
+
+	start = *clock;
+	for(i=0; i<100 ;i++) {
+//0000		modexDrawSprite(&page, 20, 20, &bmp);
+		modexDrawSprite(&page, 0, 0, &bmp);
+	}*/
+	//_fmemset(MK_FP(0xA000, 0), (int)p->plane, SCREEN_WIDTH*(SCREEN_HEIGHT*2));
 	while(!kbhit())
 	{
 		//DrawPBuf(&page, 0, 0, p, 0);
+		modexDrawBmp(&page, 0, 0, &bmp);
 	}
-    modexLeave();
+	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);
-    return;
+//0000	printf("CPU to VGA: %f\n", t1);
+//0000	printf("VGA to VGA: %f\n", t2);
+	return;
 }
diff --git a/src/scroll.c b/src/scroll.c
index 32fdeb67..dc6459c2 100644
--- a/src/scroll.c
+++ b/src/scroll.c
@@ -100,7 +100,7 @@ void main() {
 		printf("Expanded memory is not present\n");
 		exit(0);
 	}
-     
+
 	if(!emmok())
 	{
 		printf("Expanded memory manager is not present\n");
@@ -124,7 +124,7 @@ void main() {
 	/* create the map */
 //0000	printf("Total used @ before map load:			%zu\n", oldfreemem-GetFreeSize());
 	fprintf(stderr, "testing~\n");
-//testqqqq	loadmap("data/test.map", &map);
+	loadmap("data/test.map", &map);
 //----	map = allocMap(map.width,map.height); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly
 	//if(isEMS()) printf("%d tesuto\n", coretotalEMS());
 //----	initMap(&map);
diff --git a/test.exe b/test.exe
index 6f9f78a9..38fef807 100644
Binary files a/test.exe and b/test.exe differ
diff --git a/test2.exe b/test2.exe
index efd5d134..d1a35e55 100644
Binary files a/test2.exe and b/test2.exe differ