aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-06-18 10:46:22 +0000
committerTravis Howell2006-06-18 10:46:22 +0000
commit49b3f8f5391f1aaa2739a8bb355474c5d07aa661 (patch)
tree7e652ed10b97d29fb934fdf9863a54306438a422
parent499b5491eb73b0c9d40ca2e72dda076e2a2e6c24 (diff)
downloadscummvm-rg350-49b3f8f5391f1aaa2739a8bb355474c5d07aa661.tar.gz
scummvm-rg350-49b3f8f5391f1aaa2739a8bb355474c5d07aa661.tar.bz2
scummvm-rg350-49b3f8f5391f1aaa2739a8bb355474c5d07aa661.zip
Add alternative method to prevent debug code of scripts been triggered in lost. Fixes regressions when convertFilePath() is used by some HE games
svn-id: r23171
-rw-r--r--engines/scumm/he/script_v60he.cpp11
-rw-r--r--engines/scumm/he/script_v72he.cpp10
2 files changed, 16 insertions, 5 deletions
diff --git a/engines/scumm/he/script_v60he.cpp b/engines/scumm/he/script_v60he.cpp
index c42cf61494..24efa9eabc 100644
--- a/engines/scumm/he/script_v60he.cpp
+++ b/engines/scumm/he/script_v60he.cpp
@@ -423,12 +423,13 @@ int ScummEngine_v60he::convertFilePath(byte *dst) {
// Strip path
int r = 0;
- if (dst[0] == '.' && dst[1] == '/') { // './'
+ if (dst[0] == '.' && dst[1] == '/') {
r = 2;
- } else if (dst[0] == 'c' && dst[1] == ':' && dst[3] == 'h') { // 'c:/hegames/'
- r = 11;
- } else if (dst[0] == 'c' && dst[1] == ':' && dst[3] == 'w') { // 'c:/windows/'
- r = 11;
+ } else if (dst[0] == 'c' && dst[1] == ':') {
+ for (r = len; r != 0; r--) {
+ if (dst[r - 1] == '/')
+ break;
+ }
}
debug(1, "convertFilePath: converted filePath is %s", dst + r);
diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp
index 1e7386556f..89619a9c10 100644
--- a/engines/scumm/he/script_v72he.cpp
+++ b/engines/scumm/he/script_v72he.cpp
@@ -1087,6 +1087,8 @@ void ScummEngine_v72he::o72_actorOps() {
if (!a)
return;
+ printf("o72_actorOps: Actor %d subOp %d\n", a->_number, subOp);
+
switch (subOp) {
case 21: // HE 80+
k = getStackList(args, ARRAYSIZE(args));
@@ -1721,6 +1723,14 @@ void ScummEngine_v72he::o72_openFile() {
const char *filename = (char *)buffer + convertFilePath(buffer);
debug(1, "Final filename to %s", filename);
+ // Work around for lost, to avoid debug code been triggered.
+ // The 'TEST.FYL' file is always deleted after been created
+ // but we currently don't support deleting files.
+ if (!strcmp(filename, "TEST.FYL")) {
+ push(-1);
+ return;
+ }
+
slot = -1;
for (i = 1; i < 17; i++) {
if (_hInFileTable[i] == 0 && _hOutFileTable[i] == 0) {