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
\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
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
--- /dev/null
+#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