aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_titanic/create_titanic_dat.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-31 20:52:16 -0400
committerPaul Gilbert2016-07-15 19:17:31 -0400
commitec33749157a18780b7df13733f23af831d4cb096 (patch)
treedb33204eeaa81899c0e0a5b9fec6978b65f22e81 /devtools/create_titanic/create_titanic_dat.cpp
parentcf0051caf719a5ee510973df31aa3b4e4bddc832 (diff)
downloadscummvm-rg350-ec33749157a18780b7df13733f23af831d4cb096.tar.gz
scummvm-rg350-ec33749157a18780b7df13733f23af831d4cb096.tar.bz2
scummvm-rg350-ec33749157a18780b7df13733f23af831d4cb096.zip
DEVTOOLS: Add Bellbot script responses to create_titanic
Diffstat (limited to 'devtools/create_titanic/create_titanic_dat.cpp')
-rw-r--r--devtools/create_titanic/create_titanic_dat.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/devtools/create_titanic/create_titanic_dat.cpp b/devtools/create_titanic/create_titanic_dat.cpp
index 9b8e8caa58..133bad577d 100644
--- a/devtools/create_titanic/create_titanic_dat.cpp
+++ b/devtools/create_titanic/create_titanic_dat.cpp
@@ -36,7 +36,7 @@
#include "common/rect.h"
#include "winexe_pe.h"
#include "file.h"
-#include "script_tags.h"
+#include "script_responses.h"
/**
* Format of the access.dat file that will be created:
@@ -356,7 +356,48 @@ void writeData() {
writeAllScriptTags();
}
+// Support method used for translating IDA debugger's output for
+// an NPC's chooseResponse method tag list to a format for inclusion
+// in this tool's script_respones.cpp file
+void createScriptResponses() {
+ Common::File inFile;
+ char line[80];
+ char c[2];
+ c[0] = c[1] = '\0';
+
+ inFile.open("d:\\temp\\bellbot.txt");
+ printf("static const int xxxx_RESPONSES[][5] = {\n");
+
+ do {
+ strcpy(line, "");
+
+ while (!inFile.eof()) {
+ c[0] = inFile.readByte();
+ if (c[0] == '\n')
+ c[0] = ' ';
+ else if (c[0] == '\r')
+ continue;
+ strcat(line, c);
+ if (inFile.eof() || strlen(line) == (5 * 9))
+ break;
+ }
+
+ int tag, v1, v2, v3, v4;
+ sscanf(line, "%x %x %x %x %x", &tag, &v1, &v2, &v3, &v4);
+
+ printf("\t{ MKTAG('%c', '%c', '%c', '%c'), %d, %d, %d, %d },\n",
+ (tag >> 24) & 0xff, (tag >> 16) & 0xff, (tag >> 8) & 0xff, tag & 0xff,
+ v1, v2, v3, v4);
+
+ } while (!inFile.eof());
+
+ printf("};\r\n");
+ inFile.close();
+}
+
int main(int argc, char *argv[]) {
+ createScriptResponses();
+
if (argc != 3) {
printf("Format: %s ST.exe titanic.dat\n", argv[0]);
exit(0);