[Scummvm-cvs-logs] scummvm master -> d4de84bf8be7fefb95b3330d5b178549335c459b

m-kiewitz m_kiewitz at users.sourceforge.net
Mon Jun 2 20:51:58 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d4de84bf8b SCI: fix saving in mother goose sci0 (bug #6486)


Commit: d4de84bf8be7fefb95b3330d5b178549335c459b
    https://github.com/scummvm/scummvm/commit/d4de84bf8be7fefb95b3330d5b178549335c459b
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2014-06-02T20:51:39+02:00

Commit Message:
SCI: fix saving in mother goose sci0 (bug #6486)

Changed paths:
    engines/sci/engine/kfile.cpp
    engines/sci/sci.cpp



diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 65acdbc..b6231c4 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -896,12 +896,25 @@ reg_t kRestoreGame(EngineState *s, int argc, reg_t *argv) {
 			gamestate_restore(s, in);
 			delete in;
 
-			if (g_sci->getGameId() == GID_MOTHERGOOSE256) {
+			switch (g_sci->getGameId()) {
+			case GID_MOTHERGOOSE:
+				// WORKAROUND: Mother Goose SCI0
+				//  Script 200 / rm200::newRoom will set global C5h directly right after creating a child to the
+				//   current number of children plus 1.
+				//  We can't trust that global, that's why we set the actual savedgame id right here directly after
+				//   restore a saved game.
+				//  If we didn't, the game would always save to a new slot
+				s->variables[VAR_GLOBAL][0xC5].setOffset(SAVEGAMEID_OFFICIALRANGE_START + savegameId);
+				break;
+			case GID_MOTHERGOOSE256:
 				// WORKAROUND: Mother Goose SCI1/SCI1.1 does some weird things for
 				//  saving a previously restored game.
 				// We set the current savedgame-id directly and remove the script
 				//  code concerning this via script patch.
 				s->variables[VAR_GLOBAL][0xB3].setOffset(SAVEGAMEID_OFFICIALRANGE_START + savegameId);
+				break;
+			default:
+				break;
 			}
 		} else {
 			s->r_acc = TRUE_REG;
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index cf5192e..fc723f1 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -511,6 +511,7 @@ void SciEngine::patchGameSaveRestore() {
 	case GID_HOYLE1: // gets confused, although the game doesnt support saving/restoring at all
 	case GID_HOYLE2: // gets confused, see hoyle1
 	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
+	case GID_MOTHERGOOSE: // mother goose EGA saves/restores directly and has no save/restore dialogs
 	case GID_MOTHERGOOSE256: // mother goose saves/restores directly and has no save/restore dialogs
 	case GID_PHANTASMAGORIA: // has custom save/load code
 	case GID_SHIVERS: // has custom save/load code






More information about the Scummvm-git-logs mailing list