From d799ef823a8b57ba6c783ed323430254083158be Mon Sep 17 00:00:00 2001 From: sparky4 Date: Wed, 15 Feb 2017 09:58:10 -0600 Subject: [PATCH] ohh OHHH WWWWWWWWWWW --- MAPTEST.L16 | 69 ++++++++++++++++++++++++++--------------------- src/lib/16_map.c | 3 ++- src/lib/16_map.h | 2 +- src/lib/16_tail.c | 13 +++++++++ src/lib/doslib | 2 +- src/maptest.c | 4 +++ 6 files changed, 60 insertions(+), 33 deletions(-) diff --git a/MAPTEST.L16 b/MAPTEST.L16 index 220afd31..d427c34a 100755 --- a/MAPTEST.L16 +++ b/MAPTEST.L16 @@ -1,32 +1,41 @@ +Layer 0 data: [ +-./0,////////07777777777777777777777-./01234,-,-__77777777777777777777777777123456780-,-__7777777777777777777777777756789:;<,---14777777777777777777777777779:;<,,0,,,,,44777/777777777777777777777777777777,,,,447777777777777777777777777777777777,,,,777777777777777777777777777777777777,,,,77777777/77777777777777777777777777777777S777777/777777777777777777777777777777777777777/777777777777777777777777777777777777777/77777777777777777777777777777777777////-./0/////77777777777777777777777777/7777123422222///777777777777777777777//77777567822222222///77777777777777777/77777779:;layerdata[k][j] = (byte)atoi(js + t[i+2+j].start); #ifdef DEBUG_MAPDATA //printf("[%d,%d]%d", k, j, map->MAPDATAPTK[j]); - fprintf(stdout, "%c", map->data[j]+44); + printf("%c", map->layerdata[k][j]+44); + //fprintf(stdout, "%c", map->data[j]+44); #endif } i += j + 2; diff --git a/src/lib/16_map.h b/src/lib/16_map.h index e8290486..ef1c5c7f 100755 --- a/src/lib/16_map.h +++ b/src/lib/16_map.h @@ -33,7 +33,7 @@ #include "src/lib/16_mm.h" #include "src/lib/16_pm.h" -//#define DEBUG_MAPDATA +#define DEBUG_MAPDATA //#define DEBUG_MAPVAR //#define DEBUG_DUMPVARS //#define DEBUG_JS diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index 2ff2229d..bfa8446b 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -420,6 +420,19 @@ void turboXT(byte bakapee) } #endif +const char *word_to_binary(word x) +{ + static char b[17]; + int z; + + b[0] = '\0'; + for (z = 16; z > 0; z >>= 1) + { + strcat(b, ((x & z) == z) ? "1" : "0"); + } + return b; +} + const char *nibble_to_binary(nibble x) { static char b[9]; diff --git a/src/lib/doslib b/src/lib/doslib index e6b424d9..77b88234 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit e6b424d9eda930fe0bdbd74272dda46d024d0efa +Subproject commit 77b882341bd1c404c8a5a2e07534aae205d71593 diff --git a/src/maptest.c b/src/maptest.c index deef4c7c..c25fa516 100755 --- a/src/maptest.c +++ b/src/maptest.c @@ -55,7 +55,11 @@ main(int argc, char *argv[]) //loadmap("data/test.map", &map); //newloadmap("data/test.map", &map); +#ifdef __NEWMAPTILEDATAVARS__ CA_loadmap("data/test.map", &map, &gvar); +#else + CA_loadmap("data/newtest.map", &map, &gvar); +#endif #ifdef DUMP fprintf(stdout, "map.width= %d\n", map.width); fprintf(stdout, "map.height= %d\n", map.height); -- 2.39.5