commit 21f899121a4b9223f678c709340d1bbed463a96b
Author: Willem Jan Palenstijn <wjp@usecode.org>
Date:   Wed Nov 2 20:36:55 2011 +0100

    SCUMM: Save bool indicating if we saved FM-Towns data

diff --git a/engines/scumm/saveload.cpp b/engines/scumm/saveload.cpp
index 2f9f4c1..9cbcb5c 100644
--- a/engines/scumm/saveload.cpp
+++ b/engines/scumm/saveload.cpp
@@ -1291,12 +1291,28 @@ void ScummEngine::saveOrLoad(Serializer *s) {
 		s->saveLoadArrayOf(_16BitPalette, 512, sizeof(_16BitPalette[0]), sleUint16);
 	}
 
-#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
+	//
 	// FM-Towns specific (extra palette data, color cycle data, etc.)
+	//
+
+#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
 	// In earlier save game versions (below 87) the FM-Towns specific data would get saved (and loaded) even in non FM-Towns games.
 	// This would cause an unnecessary save file incompatibility between DS (which uses the DISABLE_TOWNS_DUAL_LAYER_MODE setting)
 	// and other ports.
 	if ((_game.platform == Common::kPlatformFMTowns && s->getVersion() >= VER(87)) || (s->getVersion() >= VER(82) && s->getVersion() < VER(87))) {
+
+		// Starting with version 88, we store a bool (byte) indicating
+		// if this FM-Towns specific data has been stored.
+		if (s->getVersion() >= VER(88)) {
+			if (s->isSaving()) {
+				s->saveByte(true);
+			} else {
+				byte savedFMTownsData = s->loadByte();
+				if (!savedFMTownsData)
+					error("This savegame is incompatible with this platform");
+			}
+		}
+
 		const SaveLoadEntry townsFields[] = {
 			MKLINE(Common::Rect, left, sleInt16, VER(82)),
 			MKLINE(Common::Rect, top, sleInt16, VER(82)),
@@ -1319,6 +1335,29 @@ void ScummEngine::saveOrLoad(Serializer *s) {
 		s->saveLoadArrayOf(&_curStringRect, 1, sizeof(_curStringRect), townsFields);
 		s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8);
 		s->saveLoadEntries(this, townsExtraEntries);
+	} else
+#else
+	{
+		// Starting with version 88, we store a bool (byte) indicating
+		// if this FM-Towns specific data has been stored.
+		if (s->getVersion() >= VER(88)) {
+			if (s->isSaving()) {
+				s->saveByte(false);
+			} else {
+				byte savedFMTownsData = s->loadByte();
+				if (savedFMTownsData) {
+					if (_game.platform == Common::kPlatformFMTowns)
+						warning("Discarding FM-Towns specific data from savegame");
+
+					// Data size: 48*sizeof(_textPalette[0]) + 10*sizeof(_cyclRects[0]) +
+					//             1*sizeof(_curStringRect)  + 16*sizeof(_townsCharsetColorMap[0]) +
+					//             5*sizeof(Uint8)
+					//          = 48*1 + 10*8 + 1*8 + 16*1 + 5*1 = 157
+					byte buf[157];
+					s->loadBytes(buf, 157);
+				}
+			}
+		}
 	}
 #endif
 
diff --git a/engines/scumm/saveload.h b/engines/scumm/saveload.h
index d55ec2d..064bdf1 100644
--- a/engines/scumm/saveload.h
+++ b/engines/scumm/saveload.h
@@ -47,7 +47,7 @@ namespace Scumm {
  * only saves/loads those which are valid for the version of the savegame
  * which is being loaded/saved currently.
  */
-#define CURRENT_VER 87
+#define CURRENT_VER 88
 
 /**
  * An auxillary macro, used to specify savegame versions. We use this instead
