mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 14:18:37 +00:00
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
This commit is contained in:
parent
ee86d6eb61
commit
1aed9a1f34
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user