mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
SCUMM: make FM-Towns save files compatible between DS and other platforms
(only applies to new save files)
This commit is contained in:
parent
7c78fe0d22
commit
ae5192c5d3
@ -1286,17 +1286,35 @@ void ScummEngine::saveOrLoad(Serializer *s) {
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Save/load palette data
|
// Save/load palette data
|
||||||
//
|
// Don't save 16 bit palette in FM-Towns and PCE games, since it gets regenerated afterwards anyway.
|
||||||
if (_16BitPalette && !(_game.platform == Common::kPlatformFMTowns && s->isLoading() && s->getVersion() < VER(82))) {
|
if (_16BitPalette && !(_game.platform == Common::kPlatformFMTowns && s->getVersion() < VER(82)) && !((_game.platform == Common::kPlatformFMTowns || _game.platform == Common::kPlatformPCEngine) && s->getVersion() > VER(87))) {
|
||||||
s->saveLoadArrayOf(_16BitPalette, 512, sizeof(_16BitPalette[0]), sleUint16);
|
s->saveLoadArrayOf(_16BitPalette, 512, sizeof(_16BitPalette[0]), sleUint16);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef DISABLE_TOWNS_DUAL_LAYER_MODE
|
|
||||||
// FM-Towns specific (extra palette data, color cycle data, etc.)
|
// FM-Towns specific (extra palette data, color cycle data, etc.)
|
||||||
// In earlier save game versions (below 87) the FM-Towns specific data would get saved (and loaded) even in non FM-Towns games.
|
// 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)
|
// This would cause an unnecessary save file incompatibility between DS (which uses the DISABLE_TOWNS_DUAL_LAYER_MODE setting)
|
||||||
// and other ports.
|
// and other ports.
|
||||||
if ((_game.platform == Common::kPlatformFMTowns && s->getVersion() >= VER(87)) || (s->getVersion() >= VER(82) && s->getVersion() < VER(87))) {
|
// In version 88 and later the save files from FM-Towns targets are compatible between DS and other platforms, too.
|
||||||
|
|
||||||
|
#ifdef DISABLE_TOWNS_DUAL_LAYER_MODE
|
||||||
|
byte hasTownsData = 0;
|
||||||
|
if (_game.platform == Common::kPlatformFMTowns && s->getVersion() > VER(87))
|
||||||
|
s->saveLoadArrayOf(&hasTownsData, 1, sizeof(byte), sleByte);
|
||||||
|
|
||||||
|
if (hasTownsData) {
|
||||||
|
// Skip FM-Towns specific data
|
||||||
|
for (int i = 69 * sizeof(uint8) + 11 * sizeof(Common::Rect); i; i--)
|
||||||
|
s->loadByte();
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
byte hasTownsData = ((_game.platform == Common::kPlatformFMTowns && s->getVersion() >= VER(87)) || (s->getVersion() >= VER(82) && s->getVersion() < VER(87))) ? 1 : 0;
|
||||||
|
if (_game.platform == Common::kPlatformFMTowns && s->getVersion() > VER(87))
|
||||||
|
s->saveLoadArrayOf(&hasTownsData, 1, sizeof(byte), sleByte);
|
||||||
|
|
||||||
|
if (hasTownsData) {
|
||||||
const SaveLoadEntry townsFields[] = {
|
const SaveLoadEntry townsFields[] = {
|
||||||
MKLINE(Common::Rect, left, sleInt16, VER(82)),
|
MKLINE(Common::Rect, left, sleInt16, VER(82)),
|
||||||
MKLINE(Common::Rect, top, sleInt16, VER(82)),
|
MKLINE(Common::Rect, top, sleInt16, VER(82)),
|
||||||
@ -1319,6 +1337,8 @@ void ScummEngine::saveOrLoad(Serializer *s) {
|
|||||||
s->saveLoadArrayOf(&_curStringRect, 1, sizeof(_curStringRect), townsFields);
|
s->saveLoadArrayOf(&_curStringRect, 1, sizeof(_curStringRect), townsFields);
|
||||||
s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8);
|
s->saveLoadArrayOf(_townsCharsetColorMap, 16, sizeof(_townsCharsetColorMap[0]), sleUint8);
|
||||||
s->saveLoadEntries(this, townsExtraEntries);
|
s->saveLoadEntries(this, townsExtraEntries);
|
||||||
|
} else if (_game.platform == Common::kPlatformFMTowns && s->getVersion() >= VER(82)) {
|
||||||
|
warning("Save file is missing FM-Towns specific graphic data (game was apparently saved on another platform)");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ namespace Scumm {
|
|||||||
* only saves/loads those which are valid for the version of the savegame
|
* only saves/loads those which are valid for the version of the savegame
|
||||||
* which is being loaded/saved currently.
|
* 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
|
* An auxillary macro, used to specify savegame versions. We use this instead
|
||||||
|
Loading…
x
Reference in New Issue
Block a user