From: sparky4 Date: Tue, 26 May 2015 19:43:21 +0000 (-0500) Subject: maptest~~~~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=5a58cbe2fbb89c31abbb46b23d6bfc6d2765cca5;p=16.git maptest~~~~ modified: makefile modified: maptest.exe modified: src/lib/mapread.c modified: src/lib/mapread.h modified: src/maptest.c --- diff --git a/makefile b/makefile index 4f3ab84a..3cf99e4f 100644 --- a/makefile +++ b/makefile @@ -2,7 +2,7 @@ #-zk0 = kanji support~ #-zkl = current codepage -CFLAGS=-zkl -zm -mh -wo -x# -zdp# -zp16 -zq +CFLAGS=-zkl -zm -wo -x# -mh# -zdp# -zp16 -zq OFLAGS=-ot -ox -ob -oh -or# -om -ol -ol+ FLAGS=-0 -d2 $(OFLAGS) $(CFLAGS) REMOVECOMMAND=del diff --git a/maptest.exe b/maptest.exe index 507078f9..85028f5f 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/src/lib/mapread.c b/src/lib/mapread.c index aa9761ec..36169f95 100644 --- a/src/lib/mapread.c +++ b/src/lib/mapread.c @@ -68,7 +68,7 @@ int dump(const char /*far*/ *js, jsmntok_t /*far*/ *t, size_t count, int indent, { // fprintf(stdout, "[[[[%d|%d]]]]\n", &(t+1)->size, (t+1)->size); // fprintf(stdout, "\n%.*s[xx[%d|%d]xx]\n", (t+1)->end - (t+1)->start, js+(t+1)->start, &(t+1)->size, (t+1)->size); - map->data = /*_f*/malloc(sizeof(byte) * (t+1)->size); + map->data = _fmalloc(sizeof(byte) * (t+1)->size); map->tiles = /*_f*/malloc(sizeof(tiles_t)); //map->tiles->data = malloc(sizeof(bitmap_t)); //fix this @@ -87,7 +87,8 @@ int dump(const char /*far*/ *js, jsmntok_t /*far*/ *t, size_t count, int indent, if (jsoneq(js, t, "height") == 0 && indent<=1) { strcpy(js_sv, "height");//strdup(js+t->start);//, t->end - t->start); - }else if(jsoneq(js, t, "width") == 0 && indent<=1) + }else + if(jsoneq(js, t, "width") == 0 && indent<=1) { strcpy(js_sv, "width");//strdup(js+t->start);//, t->end - t->start); }else strcpy(js_sv, "\0"); diff --git a/src/lib/mapread.h b/src/lib/mapread.h index f0e07cc8..ceef6bb9 100644 --- a/src/lib/mapread.h +++ b/src/lib/mapread.h @@ -13,7 +13,7 @@ //#define DEBUG_MAPDATA #define DEBUG_MAPVAR //#define DEBUG_DUMPVARS -#define DEBUG_JS +//#define DEBUG_JS typedef struct { bitmap_t *data; @@ -24,7 +24,7 @@ typedef struct { } tiles_t; typedef struct { - byte *data; + byte far *data; tiles_t *tiles; unsigned int width; unsigned int height; diff --git a/src/maptest.c b/src/maptest.c index 1f7e03fc..09a72024 100644 --- a/src/maptest.c +++ b/src/maptest.c @@ -1,7 +1,7 @@ #include "src/lib/mapread.h" #define DUMP -#define DUMP_MAP +//#define DUMP_MAP void main(int argc, char *argv[]) @@ -20,6 +20,12 @@ main(int argc, char *argv[]) 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); + fprintf(stdout, "&map.data==%Fp\n", map.data); #endif }