[Scummvm-cvs-logs] CVS: scummvm/kyra kyra.cpp,1.52,1.53 kyra.h,1.23,1.24 resource.cpp,1.19,1.20 screen.cpp,1.10,1.11 seqplayer.cpp,1.3,1.4 seqplayer.h,1.2,1.3 wsamovie.cpp,1.12,1.13

Johannes Schickel lordhoto at users.sourceforge.net
Thu Oct 13 14:14:15 CEST 2005


Update of /cvsroot/scummvm/scummvm/kyra
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28764

Modified Files:
	kyra.cpp kyra.h resource.cpp screen.cpp seqplayer.cpp 
	seqplayer.h wsamovie.cpp 
Log Message:
Committed patch #1325945 ( KYRA: md5 game detection ) with a few changes
and added the story picture in the intro.


Index: kyra.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- kyra.cpp	12 Oct 2005 19:15:32 -0000	1.52
+++ kyra.cpp	13 Oct 2005 21:12:47 -0000	1.53
@@ -29,6 +29,7 @@
 #include "common/config-manager.h"
 #include "common/file.h"
 #include "common/system.h"
+#include "common/md5.h"
 
 #include "sound/mixer.h"
 #include "sound/mididrv.h"
@@ -48,30 +49,63 @@
 
 using namespace Kyra;
 
+enum {
+	// We only compute MD5 of the first megabyte of our data files.
+	kMD5FileSizeLimit = 1024 * 1024
+};
+
+// Kyra MD5 detection brutally ripped from the Gobliins engine.
 struct KyraGameSettings {
 	const char *name;
 	const char *description;
+	byte id;
 	uint32 features;
-	const char *detectName;
+	const char *md5sum;
+	const char *checkFile;
 	GameSettings toGameSettings() const {
 		GameSettings dummy = { name, description, features };
 		return dummy;
 	}
 };
 
-static const KyraGameSettings kyra_settings[] = {
-	{ "kyra1", "Legend of Kyrandia (Floppy)", GF_FLOPPY | GF_KYRA1, "INTRO.SND" },
-	{ "kyra1cd", "Legend of Kyrandia (CD)",  GF_TALKIE | GF_KYRA1,  "CHAPTER1.VRM" },
-	{ "kyra1demo", "Legend of Kyrandia (Demo)", GF_DEMO | GF_FLOPPY | GF_KYRA1, "DEMO1.WSA" },
-//	{ "kyra2", "Hand of Fate (Floppy)", GF_FLOPPY | GF_KYRA2, 0 },
-//	{ "kyra2cd", "Hand of Fate (CD)", GF_TALKIE | GF_KYRA2, "AUDIO.PAK" },
-//	{ "kyra3", "Malcolm's Revenge", GF_TALKIE | GF_KYRA3, "K3INTRO0.VQA" },
-	{ 0, 0, 0, 0 }
+static const KyraGameSettings kyra_games[] = {
+	{ "kyra1", "Legend of Kyrandia (Floppy, English)",	GI_KYRA1, GF_ENGLISH | GF_FLOPPY  | GF_KYRA1, 
+										"796e44863dd22fa635b042df1bf16673", "GEMCUT.EMC" },
+	{ "kyra1", "Legend of Kyrandia (Floppy, French)",	GI_KYRA1, GF_FRENCH  | GF_FLOPPY  | GF_KYRA1,
+										"abf8eb360e79a6c2a837751fbd4d3d24", "GEMCUT.EMC" },
+	{ "kyra1", "Legend of Kyrandia (Floppy, German)",	GI_KYRA1, GF_GERMAN  | GF_FLOPPY  | GF_KYRA1, 
+										"6018e1dfeaca7fe83f8d0b00eb0dd049", "GEMCUT.EMC"},
+	{ "kyra1", "Legend of Kyrandia (CD, English)",		GI_KYRA1, GF_ENGLISH | GF_TALKIE  | GF_KYRA1, 
+										"fac399fe62f98671e56a005c5e94e39f", "GEMCUT.PAK" },
+	{ "kyra1", "Legend of Kyrandia (CD, German)",		GI_KYRA1, GF_GERMAN | GF_TALKIE  | GF_KYRA1, 
+										"230f54e6afc007ab4117159181a1c722", "GEMCUT.PAK" },
+	{ "kyra1", "Legend of Kyrandia (CD, French)",		GI_KYRA1, GF_FRENCH | GF_TALKIE  | GF_KYRA1, 
+										"b037c41768b652a040360ffa3556fd2a", "GEMCUT.PAK" },
+	{ "kyra1", "Legend of Kyrandia (Demo)",			GI_KYRA1, GF_DEMO | GF_KYRA1,
+										"fb722947d94897512b13b50cc84fd648", "DEMO1.WSA" },
+	{ 0, 0, 0, 0, 0, 0 }
+};
+
+// Keep list of different supported games
+struct KyraGameList {
+	const char *name;
+	const char *description;
+	uint32 features;
+	GameSettings toGameSettings() const {
+		GameSettings dummy = { name, description, features };
+		return dummy;
+	}
+};
+
+static const KyraGameList kyra_list[] = {
+	{ "kyra1", "Legend of Kyrandia", GF_KYRA1 },
+	{ 0, 0, 0 }
 };
 
 GameList Engine_KYRA_gameList() {
 	GameList games;
-	const KyraGameSettings *g = kyra_settings;
+	const KyraGameList *g = kyra_list;
+
 	while (g->name) {
 		games.push_back(g->toGameSettings());
 		g++;
@@ -80,24 +114,49 @@
 }
 
 DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) {
-	const KyraGameSettings *game;
 	DetectedGameList detectedGames;
+	const KyraGameSettings *g;
+	FSList::const_iterator file;
 
-	for (game = kyra_settings; game->name; ++game) {
-		if (game->detectName == NULL)
+	// Iterate over all files in the given directory
+	bool isFound = false;
+	for (file = fslist.begin(); file != fslist.end(); file++) {
+		if (file->isDirectory())
 			continue;
 
-		for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
-			if (!file->isDirectory()) {
-				const char *name = file->displayName().c_str();
-				if ((!scumm_stricmp(game->detectName, name))) {
-					detectedGames.push_back(game->toGameSettings());
-					break;
-				}
-			}
+		for (g = kyra_games; g->name; g++) {
+			if (scumm_stricmp(file->displayName().c_str(), g->checkFile) == 0)
+				isFound = true;
 		}
+		if (isFound)
+			break;
 	}
 
+	if (file == fslist.end())
+		return detectedGames;
+
+	uint8 md5sum[16];
+	char md5str[32 + 1];
+
+	if (Common::md5_file(file->path().c_str(), md5sum, NULL, kMD5FileSizeLimit)) {
+		for (int i = 0; i < 16; i++) {
+			sprintf(md5str + i * 2, "%02x", (int)md5sum[i]);
+		}
+		for (g = kyra_games; g->name; g++) {
+			if (strcmp(g->md5sum, (char *)md5str) == 0) {
+				detectedGames.push_back(g->toGameSettings());
+			}
+		}
+		if (detectedGames.isEmpty()) {
+			printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
+
+			const KyraGameList *g1 = kyra_list;
+			while (g1->name) {
+				detectedGames.push_back(g1->toGameSettings());
+				g1++;
+			}
+		}
+	}
 	return detectedGames;
 }
 
@@ -121,25 +180,43 @@
 	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
 
-	// gets the game
-	if (detector->_game.features & GF_KYRA1) {
-		if (detector->_game.features & GF_DEMO) {
-			_game = KYRA1DEMO;
-		} else if (detector->_game.features & GF_FLOPPY) {
-			_game = KYRA1;
-		} else {
-			_game = KYRA1CD;
-		}
-	} else if (detector->_game.features & GF_KYRA2) {
-		if (detector->_game.features & GF_FLOPPY) {
-			_game = KYRA2;
-		} else {
-			_game = KYRA2CD;
+	// Detect game features based on MD5. Again brutally ripped from Gobliins.
+	uint8 md5sum[16];
+	char md5str[32 + 1];
+
+	const KyraGameSettings *g;
+	bool found = false;
+
+	// TODO
+	// Fallback. Maybe we will be able to determine game type from game
+	// data contents
+	_features = GF_KYRA1;
+
+	for (g = kyra_games; g->name; g++) {
+		if (!Common::File::exists(g->checkFile))
+			continue;
+
+		if (Common::md5_file(g->checkFile, md5sum, ConfMan.get("path").c_str(), kMD5FileSizeLimit)) {
+			for (int j = 0; j < 16; j++) {
+				sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
+			}
+		} else
+			continue;
+
+		if (strcmp(g->md5sum, (char *)md5str) == 0) {
+			_features = g->features;
+			_game = g->id;
+
+			if (g->description)
+				g_system->setWindowCaption(g->description);
+
+			found = true;
+			break;
 		}
-	} else if (detector->_game.features & GF_KYRA3) {
-		_game = KYRA3;
-	} else {
-		error("unknown game");
+	}
+
+	if (!found) {
+		debug("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team", md5str);
 	}
 }
 
@@ -204,7 +281,7 @@
 	_quitFlag = false;
 	uint32 sz;
 
-	if (_game == KYRA1) {
+	if (_features & GF_FLOPPY) {
 		_screen->loadFont(Screen::FID_6_FNT, _res->fileData("6.FNT", &sz));
 	}
 	_screen->loadFont(Screen::FID_8_FNT, _res->fileData("8FAT.FNT", &sz));
@@ -212,7 +289,7 @@
 
 	_abortIntroFlag = false;
 
-	if (_game == KYRA1DEMO) {
+	if (_features & GF_DEMO) {
 		seq_demo();
 	} else {
 		seq_intro();
@@ -321,11 +398,14 @@
 	_screen->clearPage(10);
 
 	// Loading GUI bitmap
-	if (_game == KYRA1CD) {
+	if (_features & GF_ENGLISH && _features & GF_TALKIE) 
 		loadBitmap("MAIN_ENG.CPS", 10, 10, 0);
-	} else {
+	else if(_features & GF_FRENCH)
+		loadBitmap("MAIN_FRE.CPS", 10, 10, 0);
+	else if(_features & GF_GERMAN)
+		loadBitmap("MAIN_GER.CPS", 10, 10, 0);
+	else
 		loadBitmap("MAIN15.CPS", 10, 10, 0);
-	}
 
 	// Loading main room background
 	strncpy(buf, _rooms[roomID].filename, 8);
@@ -368,7 +448,7 @@
 	uint8 *srcData = _res->fileData(filename, &fileSize);
 
 	if (palData && fileSize) {
-		debug(9, "Loading a palette of size %i from %s", fileSize, filename);
+		debug(9, "Loading a palette of size %i from '%s'", fileSize, filename);
 		memcpy(palData, srcData, fileSize);		
 	}
 }
@@ -663,12 +743,12 @@
 
 void KyraEngine::seq_intro() {
 	debug(9, "KyraEngine::seq_intro()");
-	if (_game == KYRA1CD) {
+	if (_features & GF_TALKIE) {
 			_res->loadPakFile("INTRO.VRM");
 	}
 	static const IntroProc introProcTable[] = {
 		&KyraEngine::seq_introLogos,
-//		&KyraEngine::seq_introStory,
+		&KyraEngine::seq_introStory,
 		&KyraEngine::seq_introMalcomTree,
 		&KyraEngine::seq_introKallakWriting,
 		&KyraEngine::seq_introKallakMalcom
@@ -686,7 +766,7 @@
 	waitTicks(30);
 	_seq->setCopyViewOffs(false);
 	_midi->stopMusic();
-	if (_game == KYRA1CD) {
+	if (_features & GF_TALKIE) {
 			_res->unloadPakFile("INTRO.VRM");
 	}
 }
@@ -702,7 +782,7 @@
 	_system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200);
 	_screen->fadeFromBlack();
 	
-	if (_game == KYRA1) {
+	if (_features & GF_FLOPPY) {
 		if (_seq->playSequence(_seq_floppyData_WestwoodLogo, _skipIntroFlag)) {
 			_screen->fadeToBlack();
 			_screen->clearPage(0);
@@ -714,7 +794,7 @@
 			_screen->clearPage(0);
 			return;
 		}
-	} else if (_game == KYRA1CD) {
+	} else if (_features & GF_TALKIE) {
 		if (_seq->playSequence(_seq_cdromData_WestwoodLogo, _skipIntroFlag)) {
 			_screen->fadeToBlack();
 			_screen->clearPage(0);
@@ -750,27 +830,40 @@
 		waitTicks(1);
 	} while (y2 >= 64);
 
-	if (_game == KYRA1) {
+	if (_features & GF_FLOPPY) {
 		_seq->playSequence(_seq_floppyData_Forest, true);
-	} else if (_game == KYRA1CD) {
+	} else if (_features & GF_TALKIE) {
 		_seq->playSequence(_seq_cdromData_Forest, true);
 	}
 }
 
 void KyraEngine::seq_introStory() {
 	debug(9, "KyraEngine::seq_introStory()");
-	loadBitmap("MAIN_ENG.CPS", 3, 3, 0);
-	_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
-	// XXX wait 360 ticks
+	// this is only needed for floppy versions
+	// since CD version has its own opcode for that
+	if (_features & GF_FLOPPY) {
+		_screen->clearPage(3);
+		_screen->clearPage(0);
+		if (_features & GF_ENGLISH) {
+			loadBitmap("TEXT_ENG.CPS", 3, 3, 0);
+		} else if (_features & GF_GERMAN) {
+			loadBitmap("TEXT_GER.CPS", 3, 3, 0);
+		} else if (_features & GF_FRENCH) {
+			loadBitmap("TEXT_FRE.CPS", 3, 3, 0);
+		}
+		_screen->copyRegion(0, 0, 0, 0, 320, 200, 3, 0);
+		_screen->updateScreen();
+		waitTicks(360);
+	}
 }
 
 void KyraEngine::seq_introMalcomTree() {
 	debug(9, "KyraEngine::seq_introMalcomTree()");
 	_screen->_curPage = 0;
 	_screen->clearPage(3);
-	if (_game == KYRA1) {
+	if (_features & GF_FLOPPY) {
 		_seq->playSequence(_seq_floppyData_MalcomTree, true);
-	} else if (_game == KYRA1CD) {
+	} else if (_features & GF_TALKIE) {
 		_seq->playSequence(_seq_cdromData_MalcomTree, true);
 	}
 }
@@ -781,9 +874,9 @@
 	_screen->setAnimBlockPtr(5060);
 	_screen->_charWidth = -2;
 	_screen->clearPage(3);
-	if (_game == KYRA1) {
+	if (_features & GF_FLOPPY) {
 		_seq->playSequence(_seq_floppyData_KallakWriting, true);
-	} else if (_game == KYRA1CD) {
+	} else if (_features & GF_TALKIE) {
 		_seq->playSequence(_seq_cdromData_KallakWriting, true);
 	}
 	_seq->freeHandShapes();
@@ -792,9 +885,9 @@
 void KyraEngine::seq_introKallakMalcom() {
 	debug(9, "KyraEngine::seq_introKallakMalcom()");
 	_screen->clearPage(3);
-	if (_game == KYRA1) {
+	if (_features & GF_FLOPPY) {
 		_seq->playSequence(_seq_floppyData_KallakMalcom, true);
-	} else if (_game == KYRA1CD) {
+	} else if (_features & GF_TALKIE) {
 		_seq->playSequence(_seq_cdromData_KallakMalcom, true);
 	}
 }

Index: kyra.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- kyra.h	12 Oct 2005 19:15:32 -0000	1.23
+++ kyra.h	13 Oct 2005 21:12:47 -0000	1.24
@@ -25,6 +25,7 @@
 #include "base/engine.h"
 #include "common/rect.h"
 #include "sound/mixer.h"
+#include "common/file.h"
 
 class AudioStream;
 
@@ -39,16 +40,15 @@
 	GF_KYRA2   = 1 << 3,
 	GF_KYRA3   = 1 << 4,
 	GF_AUDIOCD = 1 << 5,  // FM-Towns versions seems to use audio CD
-	GF_DEMO    = 1 << 6
+	GF_DEMO    = 1 << 6,
+	GF_ENGLISH = 1 << 7,
+	GF_FRENCH  = 1 << 8,
+	GF_GERMAN  = 1 << 9
+
 };
 
 enum {
-	KYRA1     = 0,
-	KYRA1CD   = 1,
-	KYRA1DEMO = 2,
-	KYRA2     = 3,
-	KYRA2CD   = 4,
-	KYRA3     = 5
+	GI_KYRA1 = 0
 };
 
 struct Character {
@@ -123,6 +123,7 @@
 	MusicPlayer *midi() { return _midi; }
 
 	uint8 game() const { return _game; }
+	uint32 features() const { return _features; }
 	
 	Common::RandomSource _rnd;
 
@@ -209,6 +210,7 @@
 	bool _talkMessagePrinted;
 	uint8 _flagsTable[51];
 	uint16 _gameSpeed;
+	uint32 _features;
 
 	uint16 _currentRoom;
 	AudioStream *_currentVocFile;

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/resource.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- resource.cpp	13 Oct 2005 18:05:04 -0000	1.19
+++ resource.cpp	13 Oct 2005 21:12:47 -0000	1.20
@@ -30,7 +30,7 @@
 	_engine = engine;
 
 	// No PAK files in the demo version
-	if (_engine->game() == KYRA1DEMO)
+	if (_engine->features() & GF_DEMO)
 		return;
 
 	// prefetches all PAK Files
@@ -63,9 +63,9 @@
 
 	const char** usedFilelist = 0;
 
-	if (_engine->game() == KYRA1)
+	if (_engine->features() & GF_FLOPPY)
 		usedFilelist = kyra1Filelist;
-	else if (_engine->game() == KYRA1CD)
+	else if (_engine->features() & GF_TALKIE)
 		usedFilelist = kyra1CDFilelist;
 	else
 		error("no filelist found for this game");
@@ -155,7 +155,7 @@
 			
 			if (!(*size))
 				continue;
-
+			
 			buffer = new uint8[*size];
 			assert(buffer);
 			

Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/screen.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- screen.cpp	3 Oct 2005 20:21:18 -0000	1.10
+++ screen.cpp	13 Oct 2005 21:12:47 -0000	1.11
@@ -549,7 +549,7 @@
 	DrawShapePlotPixelCallback plotPixel = _drawShapePlotPixelTable[ppc];
 	
 	const uint8 *src = shapeData;
-	if (_vm->game() == KYRA1CD) {
+	if (_vm->features() & GF_TALKIE) {
 		src += 2;
 	}
 	uint16 shapeFlags = READ_LE_UINT16(src); src += 2;

Index: seqplayer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/seqplayer.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- seqplayer.cpp	12 Oct 2005 19:15:32 -0000	1.3
+++ seqplayer.cpp	13 Oct 2005 21:12:47 -0000	1.4
@@ -60,7 +60,7 @@
 	uint16 numShapes = READ_LE_UINT16(data);
 	if (shape < numShapes) {
 		uint32 offs = 0;
-		if (_vm->game() == KYRA1CD) {
+		if (_vm->features() & GF_TALKIE) {
 			offs = READ_LE_UINT32(data + 2 + shape * 4);
 		} else {
 			offs = READ_LE_UINT16(data + 2 + shape * 2);
@@ -98,7 +98,7 @@
 	assert(wsaObj < ARRAYSIZE(_seqMovies));
 	uint8 offscreenDecode = *_seqData++;
 	_seqWsaCurDecodePage = _seqMovies[wsaObj].page = (offscreenDecode == 0) ? 0 : 3;				
-	if (_vm->game() == KYRA1DEMO) {
+	if (_vm->features() & GF_DEMO) {
 		_seqMovies[wsaObj].wsa = _vm->wsa_open(KyraEngine::_seq_demo_WSATable[wsaObj], offscreenDecode, 0);
 	} else {
 		_seqMovies[wsaObj].wsa = _vm->wsa_open(KyraEngine::_seq_WSATable[wsaObj], offscreenDecode, 0);
@@ -212,7 +212,7 @@
 	uint8 colNum = *_seqData++;
 	uint32 fileSize;
 	uint8 *srcData;
-	if (_vm->game() == KYRA1DEMO) {
+	if (_vm->features() & GF_DEMO) {
 		srcData = _res->fileData(KyraEngine::_seq_demo_COLTable[colNum], &fileSize);
 	} else {
 		srcData = _res->fileData(KyraEngine::_seq_COLTable[colNum], &fileSize);
@@ -306,9 +306,9 @@
 void SeqPlayer::s1_copyRegionSpecial() {
 	static const uint8 colorMap[] = { 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0 };
 	const char *copyStr = 0;
-	if (_vm->game() == KYRA1 || _vm->game() == KYRA1DEMO) {
+	if (_vm->features() & GF_FLOPPY || _vm->features() & GF_DEMO) {
 		copyStr = "Copyright (c) 1992 Westwood Studios";
-	} else if (_vm->game() == KYRA1CD) {
+	} else if (_vm->features() & GF_TALKIE) {
 		copyStr = "Copyright (c) 1992,1993 Westwood Studios";
 	}
 	
@@ -356,15 +356,15 @@
 	_screen->fillRect(x1, y1, x2, y2, color, page);
 }
 
-void SeqPlayer::s1_soundUnk1() {
+void SeqPlayer::s1_playEffect() {
 	uint8 track = *_seqData++;
 	_vm->waitTicks(3);
 	_midi->playSoundEffect(track);
 }
 
-void SeqPlayer::s1_soundUnk2() {
+void SeqPlayer::s1_playTrack() {
 	uint8 msg = *_seqData++;
-	if (_vm->game() == KYRA1 || _vm->game() == KYRA1DEMO) {
+	if (_vm->features() & GF_FLOPPY || _vm->features() & GF_DEMO) {
 		switch (msg) {
 		case 0:
 			// nothing to do here...
@@ -385,8 +385,10 @@
 			warning("Unknown seq. message: %.02d", msg);
 			break;
 		}
-	} else if (_vm->game() == KYRA1CD) {
-		if (msg == 1) {
+	} else if (_vm->features() & GF_TALKIE) {
+		if (msg == 0) {
+			// nothing to do here...
+		} else if (msg == 1) {
 			_midi->beginFadeOut();
 		} else {
 			_vm->snd_playTrack(msg);
@@ -395,7 +397,7 @@
 }
 
 void SeqPlayer::s1_allocTempBuffer() {
-	if (_vm->game() == KYRA1DEMO) {
+	if (_vm->features() & GF_DEMO) {
 		_seqQuitFlag = true;
 	} else {
 		// allocate offscreen buffer, not needed
@@ -426,8 +428,19 @@
 	_vm->snd_playVoiceFile(a);
 }
 
-void SeqPlayer::s1_miscUnk3() {
-	warning("STUB: s1_miscUnk3");
+void SeqPlayer::s1_displayStory() {
+	_screen->clearPage(3);
+	_screen->clearPage(0);
+	if (_vm->features() & GF_ENGLISH) {
+		_vm->loadBitmap("TEXT_ENG.CPS", 3, 3, 0);
+	} else if (_vm->features() & GF_GERMAN) {
+		_vm->loadBitmap("TEXT_GER.CPS", 3, 3, 0);
+	} else if (_vm->features() & GF_FRENCH) {
+		_vm->loadBitmap("TEXT_FRE.CPS", 3, 3, 0);
+	}
+	_screen->copyRegion(0, 0, 0, 0, 320, 200, 3, 0);
+	_screen->updateScreen();
+	_vm->waitTicks(360);
 }
 
 void SeqPlayer::s1_prefetchVocFile() {
@@ -468,8 +481,8 @@
 		SEQOP(2, s1_copyRegionSpecial),
 		SEQOP(9, s1_fillRect),
 		// 0x18
-		SEQOP(2, s1_soundUnk1),
-		SEQOP(2, s1_soundUnk2),
+		SEQOP(2, s1_playEffect),
+		SEQOP(2, s1_playTrack),
 		SEQOP(1, s1_allocTempBuffer),
 		SEQOP(1, s1_textDisplayEnable),
 		// 0x1C
@@ -512,9 +525,9 @@
 		SEQOP(3, s1_copyRegion),
 		SEQOP(2, s1_copyRegionSpecial),
 		SEQOP(9, s1_fillRect),
-		SEQOP(2, s1_soundUnk1),
+		SEQOP(2, s1_playEffect),
 		// 0x1C
-		SEQOP(2, s1_soundUnk2),
+		SEQOP(2, s1_playTrack),
 		SEQOP(1, s1_allocTempBuffer),
 		SEQOP(1, s1_textDisplayEnable),
 		SEQOP(1, s1_textDisplayDisable),
@@ -522,7 +535,7 @@
 		SEQOP(1, s1_endOfScript),
 		SEQOP(1, s1_miscUnk1),
 		SEQOP(2, s1_playVocFile),
-		SEQOP(1, s1_miscUnk3),
+		SEQOP(1, s1_displayStory),
 		// 0x24
 		SEQOP(2, s1_prefetchVocFile)
 	};
@@ -532,10 +545,10 @@
 
 	debug(9, "SeqPlayer::seq_playSequence(0x%X, %d)", seqData, skipSeq);
 
-	if (_vm->game() == KYRA1 || _vm->game() == KYRA1DEMO) {
+	if (_vm->features() & GF_FLOPPY || _vm->features() & GF_DEMO) {
 		commands = floppySeqProcs;
 		numCommands = ARRAYSIZE(floppySeqProcs);
-	} else if (_vm->game() == KYRA1CD) {
+	} else if (_vm->features() & GF_TALKIE) {
 		commands = cdromSeqProcs;
 		numCommands = ARRAYSIZE(cdromSeqProcs);
 	} else {

Index: seqplayer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/seqplayer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- seqplayer.h	12 Oct 2005 19:15:32 -0000	1.2
+++ seqplayer.h	13 Oct 2005 21:12:47 -0000	1.3
@@ -83,15 +83,15 @@
 	void s1_copyRegion();
 	void s1_copyRegionSpecial();
 	void s1_fillRect();
-	void s1_soundUnk1();
-	void s1_soundUnk2();
+	void s1_playEffect();
+	void s1_playTrack();
 	void s1_allocTempBuffer();
 	void s1_textDisplayEnable();
 	void s1_textDisplayDisable();
 	void s1_endOfScript();
 	void s1_miscUnk1();
 	void s1_playVocFile();
-	void s1_miscUnk3();
+	void s1_displayStory();
 	void s1_prefetchVocFile();
 
 	struct SeqMovie {

Index: wsamovie.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/wsamovie.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- wsamovie.cpp	22 Aug 2005 15:39:07 -0000	1.12
+++ wsamovie.cpp	13 Oct 2005 21:12:47 -0000	1.13
@@ -41,7 +41,7 @@
 	wsa->deltaBufferSize = READ_LE_UINT16(wsaData); wsaData += 2;
 	wsa->offscreenBuffer = NULL;
 	wsa->flags = 0;
-	if (_game == KYRA1CD) {
+	if (_features & GF_TALKIE) {
 		flags = READ_LE_UINT16(wsaData); wsaData += 2;
 	}
 	





More information about the Scummvm-git-logs mailing list