]> 4ch.mooo.com Git - 16.git/commitdiff
reading huge map files....
authorsparky4 <sparky4@cock.li>
Tue, 2 Jun 2015 18:14:22 +0000 (13:14 -0500)
committersparky4 <sparky4@cock.li>
Tue, 2 Jun 2015 18:14:22 +0000 (13:14 -0500)
modified:   makefile
new file:   maptest0.exe
new file:   maptest0.out
modified:   src/lib/mapread.h
new file:   src/maptest0.c

makefile
maptest0.exe [new file with mode: 0644]
maptest0.out [new file with mode: 0644]
src/lib/mapread.h
src/maptest0.c [new file with mode: 0644]

index 2eae139f9eaeebb3448c9d20f3966d984964d170..1b142a0f93082fdf128690d2fb12703986d47cae 100644 (file)
--- a/makefile
+++ b/makefile
@@ -11,7 +11,7 @@ SRC=src$(DIRSEP)
 SRCLIB=$(SRC)lib$(DIRSEP)\r
 JSMNLIB=$(SRCLIB)jsmn$(DIRSEP)\r
 \r
-all: test.exe pcxtest.exe test2.exe scroll.exe maptest.exe\r
+all: test.exe pcxtest.exe test2.exe scroll.exe maptest.exe maptest0.exe\r
 \r
 scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj\r
        wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj mapread.obj jsmn.obj lib_head.obj# 16/lib/x/modex.lib\r
@@ -28,7 +28,9 @@ pcxtest.exe: pcxtest.obj modex16.obj bitmap.obj lib_head.obj
 \r
 maptest.exe: maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj\r
        wcl $(FLAGS) maptest.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj\r
-\r
+
+maptest0.exe: maptest0.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj\r
+       wcl $(FLAGS) maptest0.obj mapread.obj jsmn.obj modex16.obj bitmap.obj lib_head.obj\r
 \r
 test.obj: $(SRC)test.c $(SRCLIB)modex16.h\r
        wcl $(FLAGS) -c $(SRC)test.c\r
@@ -40,7 +42,10 @@ pcxtest.obj: $(SRC)pcxtest.c $(SRCLIB)modex16.h
        wcl $(FLAGS) -c $(SRC)pcxtest.c\r
 \r
 maptest.obj: $(SRC)maptest.c $(SRCLIB)modex16.h\r
-       wcl $(FLAGS) -c $(SRC)maptest.c\r
+       wcl $(FLAGS) -c $(SRC)maptest.c
+
+maptest0.obj: $(SRC)maptest0.c $(SRCLIB)modex16.h\r
+       wcl $(FLAGS) -c $(SRC)maptest0.c\r
 \r
 \r
 modex16.obj: $(SRCLIB)modex16.h $(SRCLIB)modex16.c\r
diff --git a/maptest0.exe b/maptest0.exe
new file mode 100644 (file)
index 0000000..2fc0e96
Binary files /dev/null and b/maptest0.exe differ
diff --git a/maptest0.out b/maptest0.out
new file mode 100644 (file)
index 0000000..e69de29
index fbc8e2137f537686fe25cfe7d6aa53ff63fe80e8..58769d5d01ae66e457e6f1a6290bb0c7853422af 100644 (file)
 #include "src/lib/modex16.h"
 #include "src/lib/lib_head.h"
 
-//#define DEBUG_MAPDATA
-//#define DEBUG_MAPVAR
-//#define DEBUG_DUMPVARS
-//#define DEBUG_JS
+#define DEBUG_MAPDATA
+#define DEBUG_MAPVAR
+#define DEBUG_DUMPVARS
+#define DEBUG_JS
 
 typedef struct {\r
        bitmap_t *data;
diff --git a/src/maptest0.c b/src/maptest0.c
new file mode 100644 (file)
index 0000000..244f16b
--- /dev/null
@@ -0,0 +1,38 @@
+#include <conio.h>
+#include "src/lib/mapread.h"\r
+
+#define DUMP
+#define DUMP_MAP
+
+void
+main(int argc, char *argv[])\r
+{\r
+       map_t map;
+       short i;
+       char *fmt = "Memory available = %u\n";
+       char *fmt0 = "Largest Contiguous Block of Memory available = %u\n";
+       fprintf(stderr, fmt, _memavl());
+       fprintf(stderr, fmt0, _memmax());
+       while(!kbhit());
+       fprintf(stderr, "loading~\n");
+       loadmap("data/tes0.map", &map);
+       fprintf(stderr, "okies~\n");
+       #ifdef DUMP
+       fprintf(stdout, "map.width=     %d\n", map.width);
+       fprintf(stdout, "map.height=    %d\n", map.height);
+       #ifdef DUMP_MAP
+       for(i=0; i<(map.width*map.height); i++)
+       {
+               fprintf(stdout, "%04d[%02d]", i, map.data[i]);
+               if(i && !(i%map.width)) fprintf(stdout, "\n");
+       }
+       fprintf(stdout, "\n");
+       #endif
+       fprintf(stdout, "&map==%Fp\n", &map);
+       fprintf(stdout, "&map.tiles==%Fp\n", map.tiles);
+       fprintf(stdout, "&map.width==%Fp\n", map.width);
+       fprintf(stdout, "&map.height==%Fp\n", map.height);\r
+       fprintf(stdout, "&map.data==%Fp\n", map.data);
+       #endif
+       fprintf(stdout, "okies~\n");
+}\r