diff options
author | md5 | 2011-03-03 19:31:47 +0200 |
---|---|---|
committer | md5 | 2011-03-03 19:31:47 +0200 |
commit | 1aed9a1f3401477d4d56e278fec63cd90fafd81d (patch) | |
tree | bebccb4094c32b48230b007299aa5bbce0909704 | |
parent | ee86d6eb613d2692490066f4c7fbb3912656f8e9 (diff) | |
download | scummvm-rg350-1aed9a1f3401477d4d56e278fec63cd90fafd81d.tar.gz scummvm-rg350-1aed9a1f3401477d4d56e278fec63cd90fafd81d.tar.bz2 scummvm-rg350-1aed9a1f3401477d4d56e278fec63cd90fafd81d.zip |
SCI: Applied save/load dialog patching to all SCI0-SCI2.1 early games
Games that have the newer SCI2.1 kernel functions (i.e. kSave instead of
kSaveGame/kRestoreGame) aren't supported yet
-rw-r--r-- | engines/sci/sci.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 4155fd2a1f..657a7b9ee2 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -444,9 +444,8 @@ static void patchGameSaveRestoreCode(SegManager *segMan, reg_t methodAddress, by byte *patchPtr = const_cast<byte *>(script->getBuf(methodAddress.offset)); if (getSciVersion() <= SCI_VERSION_1_1) memcpy(patchPtr, patchGameRestoreSave, sizeof(patchGameRestoreSave)); - else if (getSciVersion() == SCI_VERSION_2) + else // SCI2+ memcpy(patchPtr, patchGameRestoreSaveSci2, sizeof(patchGameRestoreSaveSci2)); - // TODO: SCI21/SCI3 patchPtr[8] = id; } @@ -459,10 +458,6 @@ void SciEngine::patchGameSaveRestore() { byte kernelIdRestore = 0; byte kernelIdSave = 0; - // This feature is currently not supported in SCI21 or SCI3 - if (getSciVersion() >= SCI_VERSION_2_1) - return; - switch (_gameId) { case GID_MOTHERGOOSE256: // mother goose saves/restores directly and has no save/restore dialogs case GID_JONES: // gets confused, when we patch us in, the game is only able to save to 1 slot, so hooking is not required @@ -485,6 +480,11 @@ void SciEngine::patchGameSaveRestore() { kernelIdSave = kernelNr; } + // TODO: This feature does not yet work with the SCI2.1 middle and newer + // kernel functions (i.e. kSave) + if (!kernelIdRestore || !kernelIdSave) + return; + // Search for gameobject superclass ::restore uint16 gameSuperObjectMethodCount = gameSuperObject->getMethodCount(); for (uint16 methodNr = 0; methodNr < gameSuperObjectMethodCount; methodNr++) { |