|
@@ -819,10 +819,20 @@ REWError readWiseScriptUnknown0x1D(FILE *fp, WiseScriptUnknown0x1D *data) {
|
|
|
|
|
|
REWError readWiseScriptUnknown0x1E(FILE * fp, WiseScriptUnknown0x1E * data) {
|
|
REWError readWiseScriptUnknown0x1E(FILE * fp, WiseScriptUnknown0x1E * data) {
|
|
REWError status;
|
|
REWError status;
|
|
- status = readBytesInto(fp, data->unknown_2, 2);
|
|
|
|
|
|
+ data->unknownString = NULL;
|
|
|
|
+
|
|
|
|
+ status = readBytesInto(fp, &data->unknown, 1);
|
|
if (status != REWERR_OK) {
|
|
if (status != REWERR_OK) {
|
|
return status;
|
|
return status;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ status = readCString(fp, &data->unknownString);
|
|
|
|
+ if (status != REWERR_OK) {
|
|
|
|
+ printError("readWiseScriptUnknown0x1E failed to read unknownString: "
|
|
|
|
+ "%d\n", status);
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
return REWERR_OK;
|
|
return REWERR_OK;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -858,6 +868,37 @@ REWError readWiseScriptUnknown0x23(FILE * fp, WiseScriptUnknown0x23 * data) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+REWError readWiseScriptUnknown0x30(FILE *fp, WiseScriptUnknown0x30 *data)
|
|
|
|
+{
|
|
|
|
+ REWError status;
|
|
|
|
+
|
|
|
|
+ // init struct
|
|
|
|
+ data->unknownString_1 = NULL;
|
|
|
|
+ data->unknownString_2 = NULL;
|
|
|
|
+
|
|
|
|
+ status = readBytesInto(fp, &data->unknown_1, 1);
|
|
|
|
+ if (status != REWERR_OK) {
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ status = readCString(fp, &data->unknownString_1);
|
|
|
|
+ if (status != REWERR_OK) {
|
|
|
|
+ printError("readWiseScriptUnknown0x30 failed to read unknownString_1: "
|
|
|
|
+ "%d\n", status);
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ status = readCString(fp, &data->unknownString_2);
|
|
|
|
+ if (status != REWERR_OK) {
|
|
|
|
+ printError("readWiseScriptUnknown0x30 failed to read unknownString_2: "
|
|
|
|
+ "%d\n", status);
|
|
|
|
+ freeWiseScriptUnknown0x30(data);
|
|
|
|
+ return status;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return REWERR_OK;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
void freeWiseScriptHeader(WiseScriptHeader * header) {
|
|
void freeWiseScriptHeader(WiseScriptHeader * header) {
|
|
@@ -1117,6 +1158,14 @@ void freeWiseScriptUnknown0x1D(WiseScriptUnknown0x1D *data) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+void freeWiseScriptUnknown0x1E(WiseScriptUnknown0x1E *data) {
|
|
|
|
+ if (data->unknownString != NULL) {
|
|
|
|
+ free(data->unknownString);
|
|
|
|
+ data->unknownString = NULL;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
void freeWiseScriptUnknown0x23(WiseScriptUnknown0x23 *data) {
|
|
void freeWiseScriptUnknown0x23(WiseScriptUnknown0x23 *data) {
|
|
if (data->varName != NULL) {
|
|
if (data->varName != NULL) {
|
|
free(data->varName);
|
|
free(data->varName);
|
|
@@ -1129,6 +1178,18 @@ void freeWiseScriptUnknown0x23(WiseScriptUnknown0x23 *data) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+void freeWiseScriptUnknown0x30(WiseScriptUnknown0x30 *data) {
|
|
|
|
+ if (data->unknownString_1 != NULL) {
|
|
|
|
+ free(data->unknownString_1);
|
|
|
|
+ data->unknownString_1 = NULL;
|
|
|
|
+ }
|
|
|
|
+ if (data->unknownString_2 != NULL) {
|
|
|
|
+ free(data->unknownString_2);
|
|
|
|
+ data->unknownString_2 = NULL;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
// https://www.doubleblak.com/m/blogPosts.php?id=7
|
|
// https://www.doubleblak.com/m/blogPosts.php?id=7
|
|
// MS-Dos FileTime
|
|
// MS-Dos FileTime
|
|
// DATE
|
|
// DATE
|
|
@@ -1352,9 +1413,7 @@ void printWiseScriptUnknown0x1D(WiseScriptUnknown0x1D *data) {
|
|
}
|
|
}
|
|
|
|
|
|
void printWiseScriptUnknown0x1E(WiseScriptUnknown0x1E * data) {
|
|
void printWiseScriptUnknown0x1E(WiseScriptUnknown0x1E * data) {
|
|
- printf("0x1E 0x");
|
|
|
|
- printHex(data->unknown_2, 2);
|
|
|
|
- printf("\n");
|
|
|
|
|
|
+ printf("0x1E 0x%02X '%s'\n", data->unknown, data->unknownString);
|
|
}
|
|
}
|
|
|
|
|
|
void printWiseScriptUnknown0x23(WiseScriptUnknown0x23 * data) {
|
|
void printWiseScriptUnknown0x23(WiseScriptUnknown0x23 * data) {
|
|
@@ -1369,6 +1428,13 @@ void printWiseScriptUnknown0x24(void) {
|
|
void printWiseScriptUnknown0x25(void) {
|
|
void printWiseScriptUnknown0x25(void) {
|
|
printf("0x25 \n");
|
|
printf("0x25 \n");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+void printWiseScriptUnknown0x30(WiseScriptUnknown0x30 *data)
|
|
|
|
+{
|
|
|
|
+ printf("0x30 %02X '%s' '%s'\n", data->unknown_1,
|
|
|
|
+ data->unknownString_1,
|
|
|
|
+ data->unknownString_2);
|
|
|
|
+}
|
|
#endif // REWISE_DEBUG
|
|
#endif // REWISE_DEBUG
|
|
|
|
|
|
|
|
|
|
@@ -1407,6 +1473,7 @@ void initWiseScriptCallbacks(WiseScriptCallbacks * callbacks) {
|
|
callbacks->cb_0x23 = NULL;
|
|
callbacks->cb_0x23 = NULL;
|
|
callbacks->cb_0x24 = NULL;
|
|
callbacks->cb_0x24 = NULL;
|
|
callbacks->cb_0x25 = NULL;
|
|
callbacks->cb_0x25 = NULL;
|
|
|
|
+ callbacks->cb_0x30 = NULL;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2003,6 +2070,7 @@ bool parseWiseScript(FILE *fp, WiseScriptParsedInfo *parsedInfo,
|
|
if (status == REWERR_OK && callbacks->cb_0x1E != NULL) {
|
|
if (status == REWERR_OK && callbacks->cb_0x1E != NULL) {
|
|
(*callbacks->cb_0x1E)(&data);
|
|
(*callbacks->cb_0x1E)(&data);
|
|
}
|
|
}
|
|
|
|
+ freeWiseScriptUnknown0x1E(&data);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -2090,6 +2158,18 @@ bool parseWiseScript(FILE *fp, WiseScriptParsedInfo *parsedInfo,
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
+ case 0x30:
|
|
|
|
+ {
|
|
|
|
+ WiseScriptUnknown0x30 data;
|
|
|
|
+ status = readWiseScriptUnknown0x30(fp, &data);
|
|
|
|
+ // TODO need to stop wise parse on error??????
|
|
|
|
+ if (status == REWERR_OK && callbacks->cb_0x30 != NULL) {
|
|
|
|
+ (*callbacks->cb_0x30)(&data);
|
|
|
|
+ }
|
|
|
|
+ freeWiseScriptUnknown0x30(&data);
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
|
|
+
|
|
default:
|
|
default:
|
|
printError("parseWiseScript unknown OP: %02X at 0x%08X\n", ch,
|
|
printError("parseWiseScript unknown OP: %02X at 0x%08X\n", ch,
|
|
ftell(fp));
|
|
ftell(fp));
|
|
@@ -2174,6 +2254,7 @@ bool wiseScriptDebugPrint(FILE *fp, WiseScriptParsedInfo *parsedInfo) {
|
|
callbacks.cb_0x23 = printWiseScriptUnknown0x23;
|
|
callbacks.cb_0x23 = printWiseScriptUnknown0x23;
|
|
callbacks.cb_0x24 = printWiseScriptUnknown0x24;
|
|
callbacks.cb_0x24 = printWiseScriptUnknown0x24;
|
|
callbacks.cb_0x25 = printWiseScriptUnknown0x25;
|
|
callbacks.cb_0x25 = printWiseScriptUnknown0x25;
|
|
|
|
+ callbacks.cb_0x30 = printWiseScriptUnknown0x30;
|
|
|
|
|
|
return parseWiseScript(fp, parsedInfo, &callbacks);
|
|
return parseWiseScript(fp, parsedInfo, &callbacks);
|
|
}
|
|
}
|