From 3db5db112719e71e43c7c8b18efc4cefcfeaf859 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Thu, 17 Apr 2008 07:01:15 +0000 Subject: [PATCH] Enable original load/save system in HE100 games. svn-id: r31529 --- engines/scumm/he/script_v100he.cpp | 13 ++++++++++--- engines/scumm/he/script_v72he.cpp | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/engines/scumm/he/script_v100he.cpp b/engines/scumm/he/script_v100he.cpp index f651e87bde5..f72701c2297 100644 --- a/engines/scumm/he/script_v100he.cpp +++ b/engines/scumm/he/script_v100he.cpp @@ -1571,7 +1571,6 @@ void ScummEngine_v100he::o100_redimArray() { void ScummEngine_v100he::o100_roomOps() { int a, b, c, d, e; - byte filename[100]; byte subOp = fetchScriptByte(); @@ -1635,9 +1634,17 @@ void ScummEngine_v100he::o100_roomOps() { break; case 137: - copyScriptString(filename, sizeof(filename)); + byte buffer[256]; + int r; + + copyScriptString((byte *)buffer, sizeof(buffer)); + + r = convertFilePath(buffer); + memcpy(_saveLoadFileName, buffer + r, sizeof(buffer) - r); + debug(1, "o100_roomOps: case 137: filename %s", _saveLoadFileName); + _saveLoadFlag = pop(); - _saveLoadSlot = 1; + _saveLoadSlot = 255; _saveTemporaryState = true; break; diff --git a/engines/scumm/he/script_v72he.cpp b/engines/scumm/he/script_v72he.cpp index 3cc48f84cc1..df3d8576421 100644 --- a/engines/scumm/he/script_v72he.cpp +++ b/engines/scumm/he/script_v72he.cpp @@ -1820,7 +1820,7 @@ void ScummEngine_v72he::o72_deleteFile() { copyScriptString(buffer, sizeof(buffer)); const char *filename = (char *)buffer + convertFilePath(buffer); - debug(1, "stub o72_deleteFile(%s)", filename); + debug(1, "o72_deleteFile(%s)", filename); _saveFileMan->removeSavefile(filename); } @@ -1836,7 +1836,7 @@ void ScummEngine_v72he::o72_rename() { _saveFileMan->renameSavefile(oldFilename, newFilename); - debug(1, "stub o72_rename(%s to %s)", oldFilename, newFilename); + debug(1, "o72_rename(%s to %s)", oldFilename, newFilename); } void ScummEngine_v72he::o72_getPixel() {