aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-09-13 04:16:22 +0000
committerTravis Howell2004-09-13 04:16:22 +0000
commitc1122f4333d1988a78c9d9fbe67076dc979d5c83 (patch)
tree889596fd04ea3032f4ad3c1f0b3bf8e7b89c45dd /scumm
parentfde215e10682b8ded5f08c772cc4ba973cfdd1df (diff)
downloadscummvm-rg350-c1122f4333d1988a78c9d9fbe67076dc979d5c83.tar.gz
scummvm-rg350-c1122f4333d1988a78c9d9fbe67076dc979d5c83.tar.bz2
scummvm-rg350-c1122f4333d1988a78c9d9fbe67076dc979d5c83.zip
Debug code strings should use string num, not var num.
Updated work around for loading datafiles. svn-id: r15086
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v72he.cpp23
-rw-r--r--scumm/string.cpp2
2 files changed, 13 insertions, 12 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 85355c3a8c..fb3b1dc1b6 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -550,23 +550,14 @@ void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) {
len = resStrLen(string) + 1;
}
- // The boot script in some HE games just set data file name
- // to a bunch to spaces for some odd reason.
- // We work around that.
- if (!strcmp((char *)string,"%s.he3")) {
- memset(string, 0, sizeof(string));
- sprintf((char *)string, "%s.he3", _gameName.c_str());
- len = resStrLen(string);
- }
-
while (len--) {
chr = string[num++];
if (chr == 0x25) {
chr = string[num++];
if (chr == 0x64)
- dst += snprintf((char *)dst, 5, "%d", args[val++]);
+ dst += snprintf((char *)dst, 10, "%d", args[val++]);
else if (chr == 0x73)
- dst += addStringToStack(dst, 1024, args[val++]);
+ dst += addStringToStack(dst, 512, args[val++]);
continue;
}
*dst++ = chr;
@@ -1455,6 +1446,16 @@ void ScummEngine_v72he::o72_openFile() {
mode = pop();
copyScriptString(filename);
+ // The boot script in some HE games doen't set the
+ // complete data file name. So we work around that.
+ if (!strcmp((char *)filename,".he3")) {
+ memset(filename, 0, sizeof(filename));
+ sprintf((char *)filename, "%s.he3", _gameName.c_str());
+ } else if (!strcmp((char *)filename,".he7")) {
+ memset(filename, 0, sizeof(filename));
+ sprintf((char *)filename, "%s.he7", _gameName.c_str());
+ }
+
debug(1,"File %s", filename);
for (r = strlen((char*)filename); r != 0; r--) {
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 1e1ee80434..782f60796d 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -627,7 +627,7 @@ int ScummEngine::addStringToStack(byte *dst, int dstSize, int var) {
return i;
}
- if (_version == 3 || _version >= 6)
+ if (_version == 3 || (_version >= 6 && _heversion < 72))
var = readVar(var);
if (var) {