From: sparky4 Date: Tue, 2 Jun 2015 17:23:12 +0000 (-0500) Subject: ^o^ cleaned~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=0797174ac571f1ff80ba3fa86ae362cd10864e14;p=16.git ^o^ cleaned~ modified: maptest.exe modified: maptest.out modified: scroll.exe modified: src/lib/mapread.c modified: src/maptest.c --- diff --git a/maptest.exe b/maptest.exe index d02f257c..9a112421 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/maptest.out b/maptest.out index c6fc8583..8b67a75a 100644 --- a/maptest.out +++ b/maptest.out @@ -1,9 +1,3 @@ -js=1ce1:6250 -*js=0ce0:007b -buff=[0ce0:1664] -(*buff)=[0ce0:000a] -height -width map.width= 40 map.height= 30 0000[01]0001[02]0002[03]0003[04]0004[00]0005[03]0006[03]0007[03]0008[03]0009[03]0010[03]0011[03]0012[03]0013[04]0014[01]0015[01]0016[01]0017[01]0018[01]0019[01]0020[01]0021[01]0022[01]0023[01]0024[01]0025[01]0026[01]0027[01]0028[01]0029[01]0030[01]0031[01]0032[01]0033[01]0034[01]0035[01]0036[01]0037[01]0038[01]0039[01]0040[05] @@ -36,8 +30,9 @@ map.height= 30 1081[01]1082[01]1083[01]1084[01]1085[01]1086[01]1087[01]1088[01]1089[01]1090[01]1091[01]1092[01]1093[01]1094[01]1095[01]1096[01]1097[01]1098[01]1099[01]1100[01]1101[01]1102[01]1103[01]1104[01]1105[01]1106[01]1107[00]1108[00]1109[00]1110[00]1111[00]1112[00]1113[00]1114[00]1115[01]1116[01]1117[01]1118[01]1119[01]1120[01] 1121[01]1122[01]1123[01]1124[01]1125[01]1126[01]1127[01]1128[01]1129[01]1130[01]1131[01]1132[01]1133[01]1134[01]1135[01]1136[01]1137[01]1138[01]1139[01]1140[01]1141[01]1142[01]1143[01]1144[01]1145[01]1146[01]1147[01]1148[01]1149[01]1150[01]1151[01]1152[01]1153[01]1154[01]1155[01]1156[01]1157[01]1158[10]1159[10]1160[01] 1161[01]1162[01]1163[01]1164[01]1165[01]1166[01]1167[01]1168[01]1169[01]1170[01]1171[01]1172[01]1173[01]1174[01]1175[01]1176[01]1177[01]1178[01]1179[01]1180[01]1181[01]1182[01]1183[01]1184[01]1185[01]1186[01]1187[01]1188[01]1189[01]1190[01]1191[01]1192[01]1193[01]1194[01]1195[01]1196[01]1197[01]1198[10]1199[10] -&map==0ce0:1888 -&map.tiles==1ce1:002c +&map==0cd9:1858 +&map.tiles==1cda:002c &map.width==0000:0028 &map.height==0000:001e -&map.data==2508:0000 +&map.data==2501:0000 +okies~ diff --git a/scroll.exe b/scroll.exe index 6e8faede..a0f20084 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/mapread.c b/src/lib/mapread.c index 853b809a..f1e7c571 100644 --- a/src/lib/mapread.c +++ b/src/lib/mapread.c @@ -87,12 +87,10 @@ int dump(const char huge *js, jsmntok_t huge *t, size_t count, int indent, char else if (jsoneq(js, t, "height") == 0 && indent<=1) { - fprintf(stdout, "height\n"); _fstrcpy(js_sv, "height");//strdup(js+t->start);//, t->end - t->start); }else if(jsoneq(js, t, "width") == 0 && indent<=1) { - fprintf(stdout, "width\n"); _fstrcpy(js_sv, "width");//strdup(js+t->start);//, t->end - t->start); }else _fstrcpy(js_sv, "\0"); return 1; @@ -126,11 +124,10 @@ int loadmap(char *mn, map_t *map) int r; static int incr=0; int eof_expected = 0; - //char *jz = NULL; char huge *js = NULL; size_t jslen = 0; char buf[BUFSIZ]; - char huge *buff = &buf;//(char huge *)(MK_FP(FP_SEG(&buf), FP_OFF(&buf)));// + char huge *buff = &buf; static char js_ss[16]; jsmn_parser p; @@ -164,26 +161,16 @@ int loadmap(char *mn, map_t *map) return 2; } } - //buf[BUFSIZ]='\0'; js = _frealloc(js, jslen + r + 1); if (js == NULL) { fprintf(stderr, "*js=%Fp\n", *js); fprintf(stderr, "realloc(): errno = %d\n", errno); return 3; } - //printf("strncpy~\n"); - //strncpy(jz + jslen, buf, r); - //if( - //_fstrncpy(js + jslen, &(*buff), r); _fstrncpy(js + jslen, &(*buff), r); - //strncpy((char *)js + jslen, buf, r); - // == NULL) -// fprintf(stderr, "_fstrncpy(): errno = %d\n", errno); - //printf("strncpy okies~~\n"); jslen = jslen + r; again: - //printf("(*js)=%Fp\n", (*js)); r = jsmn_parse(&p, js, jslen, tok, tokcount); if (r < 0) { if (r == JSMN_ERROR_NOMEM) { @@ -196,16 +183,16 @@ again: goto again; } } else { - printf("js=%Fp\n", (js)); - printf("*js=%Fp\n", (*(js))); + //printf("js=%Fp\n", (js)); + //printf("*js=%Fp\n", (*(js))); //printf("&*js=%s\n", &(*(js))); //printf("&buf=[%Fp]\n", &buf); //printf("&buf_seg=[%x]\n", FP_SEG(&buf)); //printf("&buf_off=[%x]\n", FP_OFF(&buf)); //printf("&buf_fp=[%Fp]\n", MK_FP(FP_SEG(&buf), FP_OFF(&buf))); //printf("buf=[\n%s\n]\n", buf); - printf("buff=[%Fp]\n", buff); - printf("(*buff)=[%Fp]\n", (*buff)); + //printf("buff=[%Fp]\n", buff); + //printf("(*buff)=[%Fp]\n", (*buff)); //printf("&(*buff)=[\n%s\n]\n", &(*buff)); dump(js, tok, p.toknext, incr, &js_ss, map, 0); eof_expected = 1; diff --git a/src/maptest.c b/src/maptest.c index 0b045e36..ee033104 100644 --- a/src/maptest.c +++ b/src/maptest.c @@ -26,4 +26,5 @@ main(int argc, char *argv[]) fprintf(stdout, "&map.height==%Fp\n", map.height); fprintf(stdout, "&map.data==%Fp\n", map.data); #endif + fprintf(stdout, "okies~\n"); }