diff options
author | Johannes Schickel | 2007-01-29 18:15:14 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-01-29 18:15:14 +0000 |
commit | 1bbad356ef66a72951a58be7f1c328ba3c6d501f (patch) | |
tree | cc38ad4aff03763b58daaab7400e29a0f73b39e6 /engines/kyra/saveload.cpp | |
parent | 0058049e3224b10d1d8a074d70eb092a9a780fd3 (diff) | |
download | scummvm-rg350-1bbad356ef66a72951a58be7f1c328ba3c6d501f.tar.gz scummvm-rg350-1bbad356ef66a72951a58be7f1c328ba3c6d501f.tar.bz2 scummvm-rg350-1bbad356ef66a72951a58be7f1c328ba3c6d501f.zip |
- adds support for FM-Towns SFX (thanks to Florian Kagerer for his source)
- gets rid of GameFlags::hasAudioCD
svn-id: r25258
Diffstat (limited to 'engines/kyra/saveload.cpp')
-rw-r--r-- | engines/kyra/saveload.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/engines/kyra/saveload.cpp b/engines/kyra/saveload.cpp index 45d34de88e..747091d328 100644 --- a/engines/kyra/saveload.cpp +++ b/engines/kyra/saveload.cpp @@ -29,14 +29,16 @@ #include "kyra/animator.h" #include "kyra/screen.h" #include "kyra/resource.h" +#include "kyra/sound.h" -#define CURRENT_VERSION 6 +#define CURRENT_VERSION 7 // TODO: our current savefiles still use the old // flag system to check the version, we should // change that some day, but for now it works #define GF_FLOPPY (1 << 0) #define GF_TALKIE (1 << 1) +#define GF_FMTOWNS (1 << 2) namespace Kyra { void KyraEngine::loadGame(const char *fileName) { @@ -78,11 +80,15 @@ void KyraEngine::loadGame(const char *fileName) { warning("Can not load cdrom savefile for this (non cdrom) gameversion"); delete in; return; + } else if ((flags & GF_FMTOWNS) && !(_flags.platform == Common::kPlatformFMTowns)) { + warning("can not load FM-Towns savefile for this (non FM-Towns) gameversion"); + delete in; + return; } } else { warning("Make sure your savefile was from this version! (too old savefile version to detect that)"); } - + snd_playSoundEffect(0x0A); snd_playWanderScoreViaMap(0, 1); @@ -198,6 +204,10 @@ void KyraEngine::loadGame(const char *fileName) { in->readByte(); // Voice } + if (version >= 7) { + _curSfxFile = in->readByte(); + } + _screen->_disableScreen = true; loadMainScreen(8); @@ -265,7 +275,12 @@ void KyraEngine::saveGame(const char *fileName, const char *saveName) { out->writeUint32BE(MKID_BE('KYRA')); out->writeUint32BE(CURRENT_VERSION); out->write(saveName, 31); - out->writeUint32BE((_flags.isTalkie ? GF_TALKIE : GF_FLOPPY)); + if (_flags.isTalkie) + out->writeUint32BE(GF_TALKIE); + else if (_flags.platform == Common::kPlatformFMTowns) + out->writeUint32BE(GF_FMTOWNS); + else + out->writeUint32BE(GF_FLOPPY); for (int i = 0; i < 11; i++) { out->writeUint16BE(_characterList[i].sceneId); @@ -335,6 +350,8 @@ void KyraEngine::saveGame(const char *fileName, const char *saveName) { out->writeSint16BE(_lastMusicCommand); + out->writeByte(_curSfxFile); + out->flush(); // check for errors |