[Scummvm-cvs-logs] CVS: scummvm/simon game.cpp,NONE,1.1 cursor.cpp,1.10,1.11 debug.cpp,1.48,1.49 debugger.cpp,1.21,1.22 icons.cpp,1.7,1.8 intern.h,1.42,1.43 items.cpp,1.136,1.137 module.mk,1.10,1.11 res.cpp,1.39,1.40 saveload.cpp,1.21,1.22 simon.cpp,1.534,1.535 simon.h,1.158,1.159 sound.cpp,1.92,1.93 sound.h,1.28,1.29 verb.cpp,1.32,1.33 vga.cpp,1.149,1.150 simon-md5.h,1.15,NONE

kirben kirben at users.sourceforge.net
Fri Nov 11 22:02:00 CET 2005


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

Modified Files:
	cursor.cpp debug.cpp debugger.cpp icons.cpp intern.h items.cpp 
	module.mk res.cpp saveload.cpp simon.cpp simon.h sound.cpp 
	sound.h verb.cpp vga.cpp 
Added Files:
	game.cpp 
Removed Files:
	simon-md5.h 
Log Message:

Old targets will be auto updated.
Many non-English versions will be broken until information is updated.


--- NEW FILE: game.cpp ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001-2005 The ScummVM project
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * $Header: /cvsroot/scummvm/scummvm/simon/game.cpp,v 1.1 2005/11/12 06:01:24 kirben Exp $
 *
 */

#include "common/stdafx.h"

#include "backends/fs/fs.h"

#include "base/gameDetector.h"
#include "base/plugins.h"

#include "common/config-manager.h"
#include "common/file.h"
#include "common/md5.h"

#include "simon/simon.h"
#include "simon/intern.h"

using Common::File;

namespace Simon {

static int detectGame(const FSList &fslist, bool mode = false, int start = -1);

struct GameMD5 {
	GameIds id;
	const char *md5;
	const char *filename;
	bool caseSensitive;
};

#define FILE_MD5_BYTES 5000

static GameMD5 gameMD5[] = {
	{ GID_SIMON1ACORN,  "64958b3a38afdcb85da1eeed85169806", "data", false },
	{ GID_SIMON1ACORN,  "28261b99cd9da1242189b4f6f2841bd6", "gamebase", false },
	{ GID_SIMON1ACORN,  "22107c24dfb31b66ac503c28a6e20b19", "icondata", false},
	{ GID_SIMON1ACORN,  "f3b27a3fbb45dcd323a48159496e45e8", "stripped", false},
	{ GID_SIMON1ACORN,  "d198a80de2c59e4a0cd24b98814849e8", "tbllist", false},

	{ GID_SIMON1CD32,   "bab7f19237cf7d7619b6c73631da1854", "gameamiga", true },
	{ GID_SIMON1CD32,   "565ef7a98dcc21ef526a2bb10b6f42ed", "icon.pkd", true },
	{ GID_SIMON1CD32,   "59be788020441e21861e284236fd08c1", "stripped.txt", true},
	{ GID_SIMON1CD32,   "f9d5bf2ce09f82289c791c3ca26e1e4b", "tbllist", true},

	{ GID_SIMON1DOS,    "9f93d27432ce44a787eef10adb640870", "gamepc", false },
	{ GID_SIMON1DOS,    "22107c24dfb31b66ac503c28a6e20b19", "icon.dat", false},
	{ GID_SIMON1DOS,    "2af9affc5981eec44b90d4c556145cb8", "stripped.txt", false},
	{ GID_SIMON1DOS,    "d198a80de2c59e4a0cd24b98814849e8", "tbllist", false},

	{ GID_SIMON1DEMO,   "2be4a21bc76e2fdc071867c130651439", "gdemo", false },
	{ GID_SIMON1DEMO,   "55af3b4d93972bc58bfee38a86b76c3f", "icon.dat", false},
	{ GID_SIMON1DEMO,   "33a2e329b97b2a349858d6a093159eb7", "stripped.txt", false},
	{ GID_SIMON1DEMO,   "1247e024e1f13ca54c1e354120c7519c", "tbllist", false},

	{ GID_SIMON1TALKIE, "28261b99cd9da1242189b4f6f2841bd6", "gamepc", false },
	{ GID_SIMON1TALKIE, "22107c24dfb31b66ac503c28a6e20b19", "icon.dat", false},
	{ GID_SIMON1TALKIE, "64958b3a38afdcb85da1eeed85169806", "simon.gme", false },
	{ GID_SIMON1TALKIE, "f3b27a3fbb45dcd323a48159496e45e8", "stripped.txt", false},
	{ GID_SIMON1TALKIE, "d198a80de2c59e4a0cd24b98814849e8", "tbllist", false},

	{ GID_SIMON1TALKIE_FR, "00000000000000000000000000000000", "gamepc", false },
	{ GID_SIMON1TALKIE_FR, "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON1TALKIE_FR, "00000000000000000000000000000000", "simon.gme", false },
	{ GID_SIMON1TALKIE_FR, "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON1TALKIE_FR, "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON1TALKIE_DE, "00000000000000000000000000000000", "gamepc", false },
	{ GID_SIMON1TALKIE_DE, "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON1TALKIE_DE, "00000000000000000000000000000000", "simon.gme", false },
	{ GID_SIMON1TALKIE_DE, "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON1TALKIE_DE, "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON1TALKIE_HB, "bc66e9c0b296e1b155a246917133f71a", "gamepc", false },
	{ GID_SIMON1TALKIE_HB, "22107c24dfb31b66ac503c28a6e20b19", "icon.dat", false},
	{ GID_SIMON1TALKIE_HB, "a34b2c8642f2e3676d7088b5c8b3e884", "simon.gme", false },
	{ GID_SIMON1TALKIE_HB, "9d31bef42db1a8abe4e9f368014df1d5", "stripped.txt", false},
	{ GID_SIMON1TALKIE_HB, "d198a80de2c59e4a0cd24b98814849e8", "tbllist", false},

	{ GID_SIMON1TALKIE_IT, "00000000000000000000000000000000", "gamepc", false },
	{ GID_SIMON1TALKIE_IT, "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON1TALKIE_IT, "00000000000000000000000000000000", "simon.gme", false },
	{ GID_SIMON1TALKIE_IT, "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON1TALKIE_IT, "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON1TALKIE_ES, "439f801ba52c02c9d1844600d1ce0f5e", "gamepc", false },
	{ GID_SIMON1TALKIE_ES, "22107c24dfb31b66ac503c28a6e20b19", "icon.dat", false},
	{ GID_SIMON1TALKIE_ES, "eff2774a73890b9eac533db90cd1afa1", "simon.gme", false },
	{ GID_SIMON1TALKIE_ES, "9d31bef42db1a8abe4e9f368014df1d5", "stripped.txt", false},
	{ GID_SIMON1TALKIE_ES, "d198a80de2c59e4a0cd24b98814849e8", "tbllist", false},

	{ GID_SIMON1WIN,       "c7c12fea7f6d0bfd22af5cdbc8166862", "gamepc", false },
	{ GID_SIMON1WIN,       "22107c24dfb31b66ac503c28a6e20b19", "icon.dat", false},
	{ GID_SIMON1WIN,       "b1b18d0731b64c0738c5cc4a2ee792fc", "simon.gme", false },
	{ GID_SIMON1WIN,       "a27e87a9ba21212d769804b3df47bfb2", "stripped.txt", false},
	{ GID_SIMON1WIN,       "d198a80de2c59e4a0cd24b98814849e8", "tbllist", false},

	{ GID_SIMON1WIN_DE,    "00000000000000000000000000000000", "gamepc", false },
	{ GID_SIMON1WIN_DE,    "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON1WIN_DE,    "00000000000000000000000000000000", "simon.gme", false },
	{ GID_SIMON1WIN_DE,    "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON1WIN_DE,    "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON2DOS,      "00000000000000000000000000000000", "game32", false },
	{ GID_SIMON2DOS,      "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON2DOS,      "00000000000000000000000000000000", "simon2.gme", false},
	{ GID_SIMON2DOS,      "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON2DOS,      "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON2DEMO,      "3794c15887539b8578bacab694ccf08a", "gsptr30", false },
	{ GID_SIMON2DEMO,      "72096a62d36e6034ea9fecc13b2dbdab", "icon.dat", false},
	{ GID_SIMON2DEMO,      "f8c9e6df1e55923a749e115ba74210c4", "simon2.gme", false},
	{ GID_SIMON2DEMO,      "e229f84d46fa83f99b4a7115679f3fb6", "stripped.txt", false},
	{ GID_SIMON2DEMO,      "a0d5a494b5d3d209d1a1d76cc8d76601", "tbllist", false},

	{ GID_SIMON2TALKIE,    "8c301fb9c4fcf119d2730ccd2a565eb3", "gsptr30", false },
	{ GID_SIMON2TALKIE,    "72096a62d36e6034ea9fecc13b2dbdab", "icon.dat", false},
	{ GID_SIMON2TALKIE,    "9c535d403966750ae98bdaf698375a38", "simon2.gme", false },
	{ GID_SIMON2TALKIE,    "e229f84d46fa83f99b4a7115679f3fb6", "stripped.txt", false},
	{ GID_SIMON2TALKIE,    "2082f8d02075e590300478853a91ffd9", "tbllist", false},

	{ GID_SIMON2TALKIE_FR, "43b3a04d2f0a0cbd1b024c814856561a", "gsptr30", false },
	{ GID_SIMON2TALKIE_FR, "72096a62d36e6034ea9fecc13b2dbdab", "icon.dat", false},
	{ GID_SIMON2TALKIE_FR, "8af0e02c0c3344db64dffc12196eb59d", "simon2.gme", false },
	{ GID_SIMON2TALKIE_FR, "5ea27977b4d7dcfd50eb5074e162ebbf", "stripped.txt", false},
	{ GID_SIMON2TALKIE_FR, "2082f8d02075e590300478853a91ffd9", "tbllist", false},

	{ GID_SIMON2TALKIE_DE, "00000000000000000000000000000000", "gsptr30", false },
	{ GID_SIMON2TALKIE_DE, "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON2TALKIE_DE, "00000000000000000000000000000000", "simon2.gme", false },
	{ GID_SIMON2TALKIE_DE, "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON2TALKIE_DE, "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON2TALKIE_HB, "952a2b1be23c3c609ba8d988a9a1627d", "gsptr30", false },
	{ GID_SIMON2TALKIE_HB, "72096a62d36e6034ea9fecc13b2dbdab", "icon.dat", false},
	{ GID_SIMON2TALKIE_HB, "a2b249a82ea182af09789eb95fb6c5be", "simon2.gme", false },
	{ GID_SIMON2TALKIE_HB, "de9dbc24158660e153483fa0cf6c3172", "stripped.txt", false},
	{ GID_SIMON2TALKIE_HB, "2082f8d02075e590300478853a91ffd9", "tbllist", false},

	{ GID_SIMON2TALKIE_IT, "00000000000000000000000000000000", "gsptr30", false },
	{ GID_SIMON2TALKIE_IT, "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON2TALKIE_IT, "00000000000000000000000000000000", "simon2.gme", false },
	{ GID_SIMON2TALKIE_IT, "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON2TALKIE_IT, "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON2TALKIE_ES, "00000000000000000000000000000000", "gsptr30", false },
	{ GID_SIMON2TALKIE_ES, "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON2TALKIE_ES, "00000000000000000000000000000000", "simon2.gme", false },
	{ GID_SIMON2TALKIE_ES, "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON2TALKIE_ES, "00000000000000000000000000000000", "tbllist", false},

	{ GID_SIMON2WIN,       "608e277904d87dd28725fa08eacc2c0d", "gsptr30", false },
	{ GID_SIMON2WIN,       "72096a62d36e6034ea9fecc13b2dbdab", "icon.dat", false},
	{ GID_SIMON2WIN,       "e749c4c103d7e7d51b34620ed76c5a04", "simon2.gme", false },
	{ GID_SIMON2WIN,       "e229f84d46fa83f99b4a7115679f3fb6", "stripped.txt", false},
	{ GID_SIMON2WIN,       "2082f8d02075e590300478853a91ffd9", "tbllist", false},

	{ GID_SIMON2WIN_DE,    "00000000000000000000000000000000", "gsptr30", false },
	{ GID_SIMON2WIN_DE,    "00000000000000000000000000000000", "icon.dat", false},
	{ GID_SIMON2WIN_DE,    "00000000000000000000000000000000", "simon2.gme", false },
	{ GID_SIMON2WIN_DE,    "00000000000000000000000000000000", "stripped.txt", false},
	{ GID_SIMON2WIN_DE,    "00000000000000000000000000000000", "tbllist", false},
};

// Simon the Sorcerer 1
static GameFileDescription SIMON1CD32_GameFiles[] = {
	{"gameamiga", GAME_BASEFILE},
	{"icon.pkd", GAME_ICONFILE},
	{"stripped.txt", GAME_STRFILE},
	{"tbllist", GAME_TBLFILE},
};

static GameFileDescription SIMON1ACORN_GameFiles[] = {
	{"data", GAME_GMEFILE},
	{"gamebase", GAME_BASEFILE},
	{"icondata", GAME_ICONFILE},
	{"stripped", GAME_STRFILE},
	{"tbllist", GAME_TBLFILE},
};

static GameFileDescription SIMON1DEMO_GameFiles[] = {
	{"gdemo", GAME_BASEFILE},
	{"icon.dat", GAME_ICONFILE},
	{"stripped.txt", GAME_STRFILE},
	{"tbllist", GAME_TBLFILE},
};

static GameFileDescription SIMON1DOS_GameFiles[] = {
	{"gamepc", GAME_BASEFILE},
	{"icon.dat", GAME_ICONFILE},
	{"stripped.txt", GAME_STRFILE},
	{"tbllist", GAME_TBLFILE},
};

static GameFileDescription SIMON1_GameFiles[] = {
	{"gamepc", GAME_BASEFILE},
	{"icon.dat", GAME_ICONFILE},
	{"simon.gme", GAME_GMEFILE},
	{"stripped.txt", GAME_STRFILE},
	{"tbllist", GAME_TBLFILE},
};

// Simon the Sorcerer 2
static GameFileDescription SIMON2_GameFiles[] = {
	{"gsptr30", GAME_BASEFILE},
	{"icon.dat", GAME_ICONFILE},
	{"simon2.gme", GAME_GMEFILE},
	{"stripped.txt", GAME_STRFILE},
	{"tbllist", GAME_TBLFILE},
};

static GameDescription gameDescriptions[] = {
	// Simon the Sorcerer 1 - English Amiga CD32
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1CD32,
		"Simon the Sorcerer 1 (Amiga CD32)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1CD32_GameFiles,
		GF_TALKIE | GF_OLD_BUNDLE,
		Common::EN_USA,
		Common::kPlatformAmiga,
	},

	// Simon the Sorcerer 1 - English Acorn CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1ACORN,
		"Simon the Sorcerer 1 (Acorn CD)",
		ARRAYSIZE(SIMON1ACORN_GameFiles),
		SIMON1ACORN_GameFiles,
		GF_TALKIE,
		Common::EN_USA,
		Common::kPlatformAcorn,
	},

	// Simon the Sorcerer 1 - English DOS Floppy Demo
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1DEMO,
		"Simon the Sorcerer 1 (DOS Floppy Demo)",
		ARRAYSIZE(SIMON1DEMO_GameFiles),
		SIMON1DEMO_GameFiles,
		GF_OLD_BUNDLE,
		Common::EN_USA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - English DOS Floppy (Infocom)
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1DOS,
		"Simon the Sorcerer 1 (DOS Floppy)",
		ARRAYSIZE(SIMON1DOS_GameFiles),
		SIMON1DOS_GameFiles,
		GF_OLD_BUNDLE,
		Common::EN_USA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - English DOS CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1TALKIE,
		"Simon the Sorcerer 1 (DOS CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::EN_USA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - French DOS CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1TALKIE_FR,
		"Simon the Sorcerer 1 (Fr DOS CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::FR_FRA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - German DOS CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1TALKIE_DE,
		"Simon the Sorcerer 1 (De DOS CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::DE_DEU,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - Hebrew DOS CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1TALKIE_HB,
		"Simon the Sorcerer 1 (Hb DOS CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::HB_ISR,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - Italian DOS CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1TALKIE_IT,
		"Simon the Sorcerer 1 (It DOS CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::IT_ITA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - Spanish DOS CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1TALKIE_ES,
		"Simon the Sorcerer 1 (Sp DOS CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::ES_ESP,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 1 - English Windows CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1WIN,
		"Simon the Sorcerer 1 (Windows CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::EN_USA,
		Common::kPlatformWindows,
	},

	// Simon the Sorcerer 1 - German Windows CD
	{
		"simon1",
		GType_SIMON1,
		GID_SIMON1WIN_DE,
		"Simon the Sorcerer 1 (De Windows CD)",
		ARRAYSIZE(SIMON1_GameFiles),
		SIMON1_GameFiles,
		GF_TALKIE,
		Common::DE_DEU,
		Common::kPlatformWindows,
	},

	// Simon the Sorcerer 2 - English DOS Floppy
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2DOS,
		"Simon the Sorcerer 2 (DOS Floppy)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		0,
		Common::EN_USA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - English DOS CD Demo
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2DEMO,
		"Simon the Sorcerer 2 (DOS CD Demo)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::EN_USA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - English DOS CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2TALKIE,
		"Simon the Sorcerer 2 (DOS CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::EN_USA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - French DOS CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2TALKIE_FR,
		"Simon the Sorcerer 2 (Fr DOS CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::FR_FRA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - German DOS CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2TALKIE_DE,
		"Simon the Sorcerer 2 (De DOS CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::DE_DEU,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - Hebrew DOS CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2TALKIE_HB,
		"Simon the Sorcerer 2 (Hb DOS CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::HB_ISR,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - Italian DOS CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2TALKIE_IT,
		"Simon the Sorcerer 2 (It DOS CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::IT_ITA,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - Spanish DOS CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2TALKIE_ES,
		"Simon the Sorcerer 2 (Sp DOS CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::ES_ESP,
		Common::kPlatformPC,
	},

	// Simon the Sorcerer 2 - English Windows CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2WIN,
		"Simon the Sorcerer 2 (Windows CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::EN_USA,
		Common::kPlatformWindows,
	},

	// Simon the Sorcerer 2 - German Windows CD
	{
		"simon2",
		GType_SIMON2,
		GID_SIMON2WIN_DE,
		"Simon the Sorcerer 2 (De Windows CD)",
		ARRAYSIZE(SIMON2_GameFiles),
		SIMON2_GameFiles,
		GF_TALKIE,
		Common::DE_DEU,
		Common::kPlatformWindows,
	},
};

bool SimonEngine::initGame(void) {
	int gameNumber;
	FSList dummy;

	if ((gameNumber = detectGame(dummy)) == -1) {
		warning("No valid games were found in the specified directory.");
		return false;
	}

	debug(0, "Running %s", gameDescriptions[gameNumber].title);

	_gameDescription = &gameDescriptions[gameNumber];

	return true;
}

DetectedGameList GAME_ProbeGame(const FSList &fslist, int **retmatches) {
	DetectedGameList detectedGames;
	int game_n;
	int index = 0, i, j;
	int matches[ARRAYSIZE(gameDescriptions)];
	bool mode = retmatches ? false : true;

	game_n = -1;
	for (i = 0; i < ARRAYSIZE(gameDescriptions); i++)
		matches[i] = -1;

	while (1) {
		game_n = detectGame(fslist, mode, game_n);
		if (game_n == -1)
			break;
		matches[index++] = game_n;
	}

	// We have some resource sets which are superpositions of other
	// Particularly it is ite-demo-linux vs ite-demo-win
	// Now remove lesser set if bigger matches too

	if (index > 1) {
		// Search max number
		int maxcount = 0;
		for (i = 0; i < index; i++) {
			int count = 0;
			for (j = 0; j < ARRAYSIZE(gameMD5); j++)
				if (gameMD5[j].id == gameDescriptions[matches[i]].gameId)
					count++;
			maxcount = MAX(maxcount, count);
		}

		// Now purge targets with number of files lesser than max
		for (i = 0; i < index; i++) {
			int count = 0;
			for (j = 0; j < ARRAYSIZE(gameMD5); j++)
				if (gameMD5[j].id == gameDescriptions[matches[i]].gameId)
					count++;
			if (count < maxcount) {
				debug(2, "Purged: %s", gameDescriptions[matches[i]].title);
				matches[i] = -1;
			}
		}

	}

	// and now push them into list of detected games
	for (i = 0; i < index; i++)
		if (matches[i] != -1)
			detectedGames.push_back(DetectedGame(gameDescriptions[matches[i]].toGameSettings(),
							 gameDescriptions[matches[i]].language,
							 gameDescriptions[matches[i]].platform));
		
	if (retmatches) {
		*retmatches = (int *)calloc(ARRAYSIZE(gameDescriptions), sizeof(int));
		for (i = 0; i < ARRAYSIZE(gameDescriptions); i++)
			(*retmatches)[i] = matches[i];
	}

	return detectedGames;
}

int detectGame(const FSList &fslist, bool mode, int start) {
	int game_count = ARRAYSIZE(gameDescriptions);
	int game_n = -1;
	typedef Common::Map<Common::String, Common::String> StringMap;
	StringMap filesMD5;

	typedef Common::Map<Common::String, bool> StringSet;
	StringSet filesList;

	uint16 file_count;
	uint16 file_n;
	Common::File test_file;
	bool file_missing;

	Common::String tstr, tstr1;
	char md5str[32+1];
	uint8 md5sum[16];

	// First we compose list of files which we need MD5s for
	for (int i = 0; i < ARRAYSIZE(gameMD5); i++) {
		tstr = Common::String(gameMD5[i].filename);
		tstr.toLowercase();

		if (gameMD5[i].caseSensitive && !mode)
			filesList[Common::String(gameMD5[i].filename)] = true;
		else
			filesList[tstr] = true;
	}

	if (mode) {
		// Now count MD5s for required files
		for (FSList::const_iterator file = fslist.begin(); file != fslist.end(); ++file) {
			if (!file->isDirectory()) {
				tstr = file->displayName();
				// FIXME: there is a bug in String class. tstr1 = tstr; tstr.toLowercase()
				// makes tstr1 lowercase as well
				tstr1 = Common::String(file->displayName().c_str());
				tstr.toLowercase();

				if (filesList.contains(tstr) || filesList.contains(tstr1)) {
					if (Common::md5_file(file->path().c_str(), md5sum, NULL, FILE_MD5_BYTES)) {
						for (int j = 0; j < 16; j++) {
							sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
						}
						filesMD5[tstr] = Common::String(md5str);
						filesMD5[tstr1] = Common::String(md5str);
					}
				}
			}
		}
	} else {
		Common::File testFile;

		for (StringSet::const_iterator file = filesList.begin(); file != filesList.end(); ++file) {
			if (testFile.open(file->_key.c_str())) {
				testFile.close();
				if (Common::md5_file(file->_key.c_str(), md5sum, NULL, FILE_MD5_BYTES)) {
					for (int j = 0; j < 16; j++) {
						sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
					}
					filesMD5[file->_key] = Common::String(md5str);
				}
			}
		}
	}

	for (game_n = start + 1; game_n < game_count; game_n++) {
		file_count = gameDescriptions[game_n].filesCount;
		file_missing = false;

		// Try to open all files for this game
		for (file_n = 0; file_n < file_count; file_n++) {
			tstr = gameDescriptions[game_n].filesDescriptions[file_n].fileName;

			if (!filesMD5.contains(tstr)) {
				file_missing = true;
				break;
			}
		}

		// Try the next game, couldn't find all files for the current
		// game
		if (file_missing) {
			continue;
		} else {
			bool match = true;

			debug(0, "Probing game: %s", gameDescriptions[game_n].title);

			for (int i = 0; i < ARRAYSIZE(gameMD5); i++) {
				if (gameMD5[i].id == gameDescriptions[game_n].gameId) {
					tstr = gameMD5[i].filename;

					if (strcmp(gameMD5[i].md5, filesMD5[tstr].c_str())) {
						match = false;
						break;
					}
				}
			}
			if (!match)
				continue;

			debug(0, "Found game: %s", gameDescriptions[game_n].title);

			return game_n;
		}
	}

	if (!filesMD5.isEmpty() && start == -1) {
		printf("MD5s of your game version are unknown. Please, report following data to\n");
		printf("ScummVM team along with your game name and version:\n");

		for (StringMap::const_iterator file = filesMD5.begin(); file != filesMD5.end(); ++file)
			printf("%s: %s\n", file->_key.c_str(), file->_value.c_str());
	}

	return -1;
}

} // End of namespace Simon

Index: cursor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/cursor.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cursor.cpp	5 Nov 2005 18:51:12 -0000	1.10
+++ cursor.cpp	12 Nov 2005 06:01:24 -0000	1.11
@@ -223,7 +223,7 @@
 };
 
 void SimonEngine::draw_mouse_pointer() {
-	if (_game & GF_SIMON2)
+	if (getGameType() == GType_SIMON2)
 		_system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);
 	else
 		_system->setMouseCursor(_simon1_cursor, 16, 16, 0, 0);

Index: debug.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debug.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- debug.cpp	10 Nov 2005 01:41:56 -0000	1.48
+++ debug.cpp	12 Nov 2005 06:01:24 -0000	1.49
@@ -37,13 +37,13 @@
 	opcode = *p++;
 	if (opcode == 255)
 		return NULL;
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		st = s = feeblefiles_opcode_name_table[opcode];
-	} else if (_game & GF_SIMON2 && _game & GF_TALKIE) {
+	} else if (getGameType() == GType_SIMON2 && getFeatures() & GF_TALKIE) {
 		st = s = simon2talkie_opcode_name_table[opcode];
-	} else if (_game & GF_TALKIE) {
+	} else if (getFeatures() & GF_TALKIE) {
 		st = s = simon1talkie_opcode_name_table[opcode];
-	} else if (_game & GF_SIMON2) {
+	} else if (getGameType() == GType_SIMON2) {
 		st = s = simon2dos_opcode_name_table[opcode];
 	} else {
 		st = s = simon1dos_opcode_name_table[opcode];
@@ -176,7 +176,7 @@
 	const char *str, *strn;
 
 	do {
-		if (_game & GF_SIMON1) {
+		if (getGameType() == GType_SIMON1) {
 			opcode = READ_BE_UINT16(src);
 			src += 2;
 		} else {
@@ -188,9 +188,9 @@
 			return;
 		}
 
-		if (_game == GAME_FEEBLEFILES) {
+		if (getGameType() == GType_FF) {
 			strn = str = feeblefiles_video_opcode_name_table[opcode];
-		} else if (_game & GF_SIMON2) {
+		} else if (getGameType() == GType_SIMON2) {
 			strn = str = simon2_video_opcode_name_table[opcode];
 		} else {
 			strn = str = simon1_video_opcode_name_table[opcode];
@@ -200,7 +200,7 @@
 			strn++;
 		fprintf(_dumpFile, "%.2d: %s ", opcode, strn + 1);
 
-		int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
+		int end = (getGameType() == GType_FF) ? 9999 : 999;
 		for (; *str != '|'; str++) {
 			switch (*str) {
 			case 'x':

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debugger.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- debugger.cpp	18 Oct 2005 01:30:22 -0000	1.21
+++ debugger.cpp	12 Nov 2005 06:01:24 -0000	1.22
@@ -106,10 +106,10 @@
 bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
 	if (argc > 1) {
 		uint music = atoi(argv[1]);
-		uint range = (_vm->_game & GF_SIMON2) ? 93 : 34;
+		uint range = (_vm->getGameType() == GType_SIMON2) ? 93 : 34;
 		if (music <= range) {
 			_vm->loadMusic (music);
-			if (_vm->_game & GF_SIMON2)
+			if (_vm->getGameType() == GType_SIMON2)
 				_vm->midi.startTrack (0);
 		} else
 			DebugPrintf("Music out of range (0 - %d)\n", range);
@@ -122,7 +122,7 @@
 bool Debugger::Cmd_PlaySound(int argc, const char **argv) {
 	if (argc > 1) {
 		uint sound = atoi(argv[1]);
-		uint range = (_vm->_game & GF_SIMON2) ? 222 : 127;
+		uint range = (_vm->getGameType() == GType_SIMON2) ? 222 : 127;
 		if (sound <= range)
 			_vm->_sound->playEffects(sound);
 		else
@@ -136,7 +136,7 @@
 bool Debugger::Cmd_PlayVoice(int argc, const char **argv) {
 	if (argc > 1) {
 		uint voice = atoi(argv[1]);
-		uint range = (_vm->_game & GF_SIMON2) ? 3632 : 1996;
+		uint range = (_vm->getGameType() == GType_SIMON2) ? 3632 : 1996;
 		if (voice <= range)
 			_vm->_sound->playVoice(voice);
 		else

Index: icons.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/icons.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- icons.cpp	18 Oct 2005 01:30:22 -0000	1.7
+++ icons.cpp	12 Nov 2005 06:01:24 -0000	1.8
@@ -30,9 +30,9 @@
 
 void SimonEngine::loadIconFile() {
 	Common::File in;
-	if (_game & GF_ACORN)
+	if (getPlatform() == Common::kPlatformAcorn)
 		in.open("ICONDATA");
-	else if (_game & GF_AMIGA)
+	else if (getPlatform() == Common::kPlatformAmiga)
 		in.open("icon.pkd");
 	else
 		in.open("ICON.DAT");
@@ -161,12 +161,12 @@
 	_lockWord |= 0x8000;
 	dst = dx_lock_2();
 
-	if (!(_game & GF_SIMON2)) {
+	if (!(getGameType() == GType_SIMON2)) {
 		// Simon 1
 		dst += (x + fcs->x) * 8;
 		dst += (y * 25 + fcs->y) * _dxSurfacePitch;
 
-		if (_game & GF_AMIGA) {
+		if (getPlatform() == Common::kPlatformAmiga) {
 			src = _iconFilePtr;
 			src += READ_BE_UINT32(&((uint32 *)src)[icon]);
 			decompress_icon_amiga (dst, src, 0xE0, _dxSurfacePitch);
@@ -200,7 +200,7 @@
 
 	ha = findEmptyHitArea();
 
-	if (!(_game & GF_SIMON2)) {
+	if (!(getGameType() == GType_SIMON2)) {
 		ha->x = (x + fcs->x) << 3;
 		ha->y = y * 25 + fcs->y;
 		ha->item_ptr = item_ptr;

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/intern.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- intern.h	5 Nov 2005 18:51:12 -0000	1.42
+++ intern.h	12 Nov 2005 06:01:24 -0000	1.43
@@ -147,30 +147,46 @@
 
 } // End of namespace Simon
 
-enum {
-	GF_SIMON1     = 1 << 0,
-	GF_SIMON2     = 1 << 1,
-	GF_WIN        = 1 << 2,
-	GF_TALKIE     = 1 << 3,
-	GF_DEMO       = 1 << 4,
-	GF_AMIGA      = 1 << 5,
-	GF_ACORN      = 1 << 6,
-	GF_OLD_BUNDLE = 1 << 7
+enum GameFeatures {
+	GF_TALKIE     = 1 << 0,
+	GF_OLD_BUNDLE = 1 << 1
 };
 
-enum {
-	GAME_SIMON1DOS = GF_SIMON1 | GF_OLD_BUNDLE,
-	GAME_SIMON1DEMO = GF_SIMON1 | GF_DEMO | GF_OLD_BUNDLE,
-	GAME_SIMON1AMIGA = GF_SIMON1 | GF_AMIGA | GF_OLD_BUNDLE,
-	GAME_SIMON1CD32 = GF_SIMON1 | GF_TALKIE | GF_AMIGA | GF_OLD_BUNDLE,
-	GAME_SIMON1ACORN = GF_SIMON1 | GF_TALKIE | GF_ACORN,
-	GAME_SIMON1TALKIE = GF_SIMON1 | GF_TALKIE,
+enum GameFileTypes {
+	GAME_BASEFILE = 1 << 0,
+	GAME_ICONFILE = 1 << 1,
+	GAME_GMEFILE  = 1 << 2,
+	GAME_STRFILE  = 1 << 3,
+	GAME_TBLFILE  = 1 << 4
+};
 
-	GAME_SIMON2DOS = GF_SIMON2,
-	GAME_SIMON2TALKIE = GF_SIMON2 | GF_TALKIE,
-	GAME_SIMON2WIN = GF_SIMON2 | GF_WIN | GF_TALKIE,
+enum GameIds {
+	GID_SIMON1DOS,
+	GID_SIMON1DEMO,
+	GID_SIMON1AMIGA,
+	GID_SIMON1CD32,
+	GID_SIMON1ACORN,
+	GID_SIMON1TALKIE,
+	GID_SIMON1TALKIE_DE,
+	GID_SIMON1TALKIE_FR,
+	GID_SIMON1TALKIE_HB,
+	GID_SIMON1TALKIE_IT,
+	GID_SIMON1TALKIE_ES,
+	GID_SIMON1WIN,
+	GID_SIMON1WIN_DE,
 
-	GAME_FEEBLEFILES = GF_SIMON2 | GF_WIN | GF_TALKIE | GF_OLD_BUNDLE
+	GID_SIMON2DOS,
+	GID_SIMON2DEMO,
+	GID_SIMON2TALKIE,
+	GID_SIMON2TALKIE_DE,
+	GID_SIMON2TALKIE_FR,
+	GID_SIMON2TALKIE_HB,
+	GID_SIMON2TALKIE_IT,
+	GID_SIMON2TALKIE_ES,
+	GID_SIMON2WIN,
+	GID_SIMON2WIN_DE,
+
+	GAME_FEEBLEFILES
 };
 
 #endif

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- items.cpp	11 Nov 2005 04:55:54 -0000	1.136
+++ items.cpp	12 Nov 2005 06:01:24 -0000	1.137
@@ -277,7 +277,7 @@
 
 				// Disable random in simon1amiga for now
 				// Since copy protection screen is currently unreadable
-				if (_game == GAME_SIMON1AMIGA)
+				if (getPlatform() == Common::kPlatformAmiga)
 					writeVariable(var, 4);
 				else
 					writeVariable(var, _rnd.getRandomNumber(value - 1));
@@ -374,7 +374,7 @@
 		case 67:{									/* set item description */
 				uint var = getVarOrByte();
 				uint string_id = getNextStringID();
-				if (_game & GF_TALKIE) {
+				if (getFeatures() & GF_TALKIE) {
 					uint speech_id = getNextWord();
 					if (var < 20) {
 						_stringIdArray3[var] = string_id;
@@ -400,7 +400,7 @@
 		case 70:{									/* show string from array */
 				const char *str = (const char *)getStringPtrByID(_stringIdArray3[getVarOrByte()]);
 
-				if (_game & GF_SIMON2) {
+				if (getGameType() == GType_SIMON2) {
 					writeVariable(51, strlen(str) / 53 * 8 + 8);
 				}
 
@@ -449,7 +449,7 @@
 			break;
 
 		case 83:{									/* restart subroutine */
-				if (_game & GF_SIMON2)
+				if (getGameType() == GType_SIMON2)
 					o_83_helper();
 				return -10;
 			}
@@ -527,7 +527,7 @@
 
 		case 98:{									/* start vga */
 				uint vga_res, vgaSpriteId, windowNum, x, y, palette;
-				if (_game & GF_SIMON2) {
+				if (getGameType() == GType_SIMON2) {
 					vga_res = getVarOrWord();
 					vgaSpriteId = getVarOrWord();
 				} else {
@@ -543,7 +543,7 @@
 			break;
 
 		case 99:{									/* kill sprite */
-				if (_game & GF_SIMON1) {
+				if (getGameType() == GType_SIMON1) {
 					o_kill_sprite_simon1(getVarOrWord());
 				} else {
 					uint a = getVarOrWord();
@@ -741,7 +741,7 @@
 
 		case 133:{									/* load game */
 				_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
-				if (_game == GAME_FEEBLEFILES) {
+				if (getGameType() == GType_FF) {
 					load_game(readVariable(55));
 				} else {
 					o_load_game();
@@ -757,7 +757,7 @@
 			break;
 
 		case 135:{									/* quit if user presses y */
-				if (_game == GAME_FEEBLEFILES) {
+				if (getGameType() == GType_FF) {
 					// Switch CD
 					debug(1, "Switch to CD number %d", readVariable(97));
 				} else {
@@ -986,7 +986,7 @@
 
 				const char *string_ptr = (const char *)getStringPtrByID(_stringIdArray3[string_id]);
 				TextLocation *tl = getTextLocation(vgaSpriteId);
-				if (_game & GF_TALKIE)
+				if (getFeatures() & GF_TALKIE)
 					speech_id = _speechIdArray4[string_id];
 
 				if (_speech && speech_id != 0)
@@ -1003,7 +1003,7 @@
 
 		case 181:{									/* force lock */
 				o_force_lock();
-				if (_game & GF_SIMON2) {
+				if (getGameType() == GType_SIMON2) {
 					changeWindow(1);
 					showMessageFormat("\xC");
 				}
@@ -1011,10 +1011,10 @@
 			break;
 
 		case 182:{									/* load beard */
-				if (_game == GAME_FEEBLEFILES) {
+				if (getGameType() == GType_FF) {
 					// Load video file
 					debug(1,"Load video file: %s", getStringPtrByID(getNextStringID()));
-				} else if (_game & GF_SIMON2) {
+				} else if (getGameType() == GType_SIMON2) {
 					goto invalid_opcode;
 				} else {
 					o_loadBeard();
@@ -1023,10 +1023,10 @@
 			break;
 
 		case 183:{									/* unload beard */
-				if (_game == GAME_FEEBLEFILES) {
+				if (getGameType() == GType_FF) {
 					// Play video
 					debug(1, "Play video");
-				} else if (_game & GF_SIMON2) {
+				} else if (getGameType() == GType_SIMON2) {
 					goto invalid_opcode;
 				} else {
 					o_unloadBeard();
@@ -1040,11 +1040,11 @@
 			break;
 
 		case 185:{									/* load sound files */
-				if (_game & GF_SIMON2)
+				if (getGameType() == GType_SIMON2)
 					goto invalid_opcode;
 
 				_soundFileId = getVarOrWord();
-				if (_game == GAME_SIMON1CD32) {
+				if (getPlatform() == Common::kPlatformAmiga && getFeatures() & GF_TALKIE) {
 					char buf[10];
 					sprintf(buf, "%d%s", _soundFileId, "Effects");
 					_sound->readSfxFile(buf);
@@ -1061,14 +1061,14 @@
 			break;
 
 		case 187:{									/* fade to black */
-				if (_game & GF_SIMON2)
+				if (getGameType() == GType_SIMON2)
 					goto invalid_opcode;
 				o_fade_to_black();
 			}
 			break;
 
 		case 188:									/* string2 is */
-			if (_game & GF_SIMON1)
+			if (getGameType() == GType_SIMON1)
 				goto invalid_opcode;
 			{
 				uint i = getVarOrByte();
@@ -1078,7 +1078,7 @@
 			break;
 
 		case 189:{									/* clear_op189_flag */
-				if (_game & GF_SIMON1)
+				if (getGameType() == GType_SIMON1)
 					goto invalid_opcode;
 				_marks = 0;
 			}
@@ -1086,7 +1086,7 @@
 
 		case 190:{
 				uint i;
-				if (_game & GF_SIMON1)
+				if (getGameType() == GType_SIMON1)
 					goto invalid_opcode;
 				i = getVarOrByte();
 				if (!(_marks & (1 << i)))
@@ -1310,7 +1310,7 @@
 		tl = getTextLocation(vgaSpriteId);
 	}
 
-	if ((_game & GF_SIMON2) && (_game & GF_TALKIE)) {
+	if ((getGameType() == GType_SIMON2) && (getFeatures() & GF_TALKIE)) {
 		if (child != NULL && child->avail_props & 0x200) {
 			uint speech_id = child->array[getOffsetOfChild2Param(child, 0x200)];
 
@@ -1362,7 +1362,7 @@
 				talk_with_speech(speech_id, vgaSpriteId);
 		}
 
-	} else if (_game & GF_TALKIE) {
+	} else if (getFeatures() & GF_TALKIE) {
 		if (child != NULL && child->avail_props & 0x200) {
 			uint offs = getOffsetOfChild2Param(child, 0x200);
 			talk_with_speech(child->array[offs], vgaSpriteId);
@@ -1470,7 +1470,7 @@
 start_over:;
 	_keyPressed = 0;
 
-	if (_game == GAME_SIMON1CD32)
+	if (getPlatform() == Common::kPlatformAmiga && getFeatures() & GF_TALKIE)
 		goto start_over_3;
 
 start_over_2:;
@@ -1604,7 +1604,7 @@
 	// actually start a track (so the resource is
 	// effectively preloaded so there's no latency when
 	// starting playback).
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		int loop = getVarOrByte();
 
 		midi.setLoop (loop != 0);
@@ -1630,7 +1630,7 @@
 }
 
 void SimonEngine::o_play_sound(uint sound_id) {
-	if (_game == GAME_SIMON1DOS)
+	if (getGameId() == GID_SIMON1DOS)
 		playSting(sound_id);
 	else
 		_sound->playEffects(sound_id);

Index: module.mk
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/module.mk,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- module.mk	16 Dec 2004 12:49:25 -0000	1.10
+++ module.mk	12 Nov 2005 06:01:24 -0000	1.11
@@ -5,6 +5,7 @@
 	simon/cursor.o \
 	simon/debug.o \
 	simon/debugger.o \
+	simon/game.o \
 	simon/icons.o \
 	simon/items.o \
 	simon/midi.o \

Index: res.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/res.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- res.cpp	10 Nov 2005 01:18:09 -0000	1.39
+++ res.cpp	12 Nov 2005 06:01:24 -0000	1.40
@@ -114,14 +114,14 @@
 };
 
 uint16 SimonEngine::to16Wrapper(uint value) {
-	if (_game == GAME_FEEBLEFILES)
+	if (getGameType() == GType_FF)
 		return TO_LE_16(value);
 	else
 		return TO_BE_16(value);
 }
 
 uint16 SimonEngine::readUint16Wrapper(const void *src) {
-	if (_game == GAME_FEEBLEFILES)
+	if (getGameType() == GType_FF)
 		return READ_LE_UINT16(src);
 	else
 		return READ_BE_UINT16(src);
@@ -179,11 +179,11 @@
 	_tablesHeapPtrOrg = _tablesHeapPtr;
 	_tablesHeapCurPosOrg = _tablesHeapCurPos;
 
-	if (_game == GAME_FEEBLEFILES)
+	if (getGameType() == GType_FF)
 		return;
 
 	/* Read list of TEXT resources */
-	if (_game == GAME_SIMON1ACORN)
+	if (getPlatform() == Common::kPlatformAcorn)
 		in.open("STRIPPED");
 	else
 		in.open("STRIPPED.TXT");
@@ -294,13 +294,13 @@
 
 	const char *const *table;
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		table = opcode_arg_table_feeblefiles;
-	} else if ((_game & GF_SIMON2) && (_game & GF_TALKIE))
+	} else if ((getGameType() == GType_SIMON2) && (getFeatures() & GF_TALKIE))
 		table = opcode_arg_table_simon2win;
-	else if (_game & GF_SIMON2)
+	else if (getGameType() == GType_SIMON2)
 		table = opcode_arg_table_simon2dos;
-	else if (_game & GF_TALKIE)
+	else if (getFeatures() & GF_TALKIE)
 		table = opcode_arg_table_simon1win;
 	else
 		table = opcode_arg_table_simon1dos;

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/saveload.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- saveload.cpp	5 Nov 2005 14:24:13 -0000	1.21
+++ saveload.cpp	12 Nov 2005 06:01:24 -0000	1.22
@@ -108,7 +108,7 @@
 void SimonEngine::quick_load_or_save() {
 	// simon1demo subroutines are missing too many segments
 	// original demo didn't allow load or save either.
-	if (_game == GAME_SIMON1DEMO)
+	if (getGameId() == GID_SIMON1DEMO)
 		return;
 
 	bool success;
@@ -412,7 +412,7 @@
 		return false;
 	}
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		f->write(caption, 100);
 	} else {
 		f->write(caption, 18);
@@ -482,7 +482,7 @@
 		f->writeUint16BE(_bitArray[i]);
 
 	// Write the bits in array 3
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		for (i = 33; i != 48; i++)
 			f->writeUint16BE(_bitArray[i]);
 	}
@@ -499,12 +499,12 @@
 char *SimonEngine::gen_savename(int slot) {
 	static char buf[15];
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		if (slot == 999)
 			sprintf(buf, "save.%.3d", slot);
 		else
 			sprintf(buf, "feeble.%.3d", slot);
-	} else if (_game & GF_SIMON2) {
+	} else if (getGameType() == GType_SIMON2) {
 		sprintf(buf, "simon2.%.3d", slot);
 	} else {
 		sprintf(buf, "simon1.%.3d", slot);
@@ -525,7 +525,7 @@
 		return false;
 	}
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		f->read(ident, 100);
 	} else {
 		f->read(ident, 18);
@@ -612,7 +612,7 @@
 		_bitArray[i] = f->readUint16BE();
 
 	// Read the bits in array 3
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		for (i = 33; i != 48; i++)
 			_bitArray[i] = f->readUint16BE();
 	}

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.534
retrieving revision 1.535
diff -u -d -r1.534 -r1.535
--- simon.cpp	11 Nov 2005 09:05:19 -0000	1.534
+++ simon.cpp	12 Nov 2005 06:01:24 -0000	1.535
@@ -38,7 +38,6 @@
 #include "simon/intern.h"
 #include "simon/vga.h"
 #include "simon/debugger.h"
-#include "simon/simon-md5.h"
 
 #include "sound/mididrv.h"
 #ifdef _WIN32_WCE
@@ -51,117 +50,90 @@
 
 using Common::File;
 
[...1164 lines suppressed...]
 		_nextMusicToPlay = -1;
-	} else if (_game & GF_SIMON1) {        // Simon 1 music
+	} else if (getGameType() == GType_SIMON1) {        // Simon 1 music
 		midi.stop();
 		midi.setLoop (true); // Must do this BEFORE loading music. (GMF may have its own override.)
 
-		if (_game & GF_TALKIE) {
+		if (getFeatures() & GF_TALKIE) {
 			// FIXME: The very last music resource, a cymbal crash for when the
 			// two demons crash into each other, should NOT be looped like the
 			// other music tracks. In simon1dos/talkie the GMF resource includes
@@ -4290,7 +4204,7 @@
 				warning("Can't load music from '%s'", filename);
 				return;
 			}
-			if (_game & GF_DEMO)
+			if (getGameId() == GID_SIMON1DEMO)
 				midi.loadS1D (&f);
 			else
 				midi.loadSMF (&f, music);

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.158
retrieving revision 1.159
diff -u -d -r1.158 -r1.159
--- simon.h	10 Nov 2005 05:33:31 -0000	1.158
+++ simon.h	12 Nov 2005 06:01:24 -0000	1.159
@@ -24,6 +24,8 @@
 
 #include <stdio.h>
 #include "base/engine.h"
+#include "base/gameDetector.h"
+#include "base/plugins.h"
 #include "common/util.h"
 #include "simon/midi.h"
 #include "simon/sound.h"
@@ -101,6 +103,36 @@
 	VgaTimerEntry() { memset(this, 0, sizeof(*this)); }
 };
 
+enum SimonTypes {
+	GType_SIMON1,
+	GType_SIMON2,
+	GType_FF
+};
+
+struct GameFileDescription {
+	const char *fileName;
+	uint16 fileType;
+};
+
+struct GameDescription {
+	const char *name;
+	SimonTypes gameType;
+	GameIds gameId;
+	const char *title;
+	int filesCount;
+	GameFileDescription *filesDescriptions;
+	uint32 features;
+	Common::Language language;
+	Common::Platform platform;
+
+	GameSettings toGameSettings() const {
+		GameSettings dummy = { name, title, features };
+		return dummy;
+	}
+};
+
+DetectedGameList GAME_ProbeGame(const FSList &fslist, int **matches = NULL);
+
 struct GameSpecificSettings;
 
 class Debugger;
@@ -113,7 +145,18 @@
 	typedef void (SimonEngine::*VgaOpcodeProc) ();
 	void setupVgaOpcodes();
 	const VgaOpcodeProc *_vga_opcode_table;
-	
+
+public:
+	GameDescription *_gameDescription;
+
+	bool initGame(void);
+
+	int getGameId() const { return _gameDescription->gameId; }
+	int getGameType() const { return _gameDescription->gameType; }
+	uint32 getFeatures() const { return _gameDescription->features; }
+	Common::Language getLanguage() const { return _gameDescription->language; }
+	Common::Platform getPlatform() const { return _gameDescription->platform; }
+
 protected:
 	void playSting(uint a);
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.cpp,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- sound.cpp	18 Oct 2005 01:30:22 -0000	1.92
+++ sound.cpp	12 Nov 2005 06:01:24 -0000	1.93
@@ -22,6 +22,7 @@
 #include "common/file.h"
 #include "common/util.h"
 
+#include "simon/simon.h"
 #include "simon/sound.h"
 
 #include "sound/flac.h"
@@ -231,8 +232,8 @@
 }
 #endif
 
-Sound::Sound(const byte game, const GameSpecificSettings *gss, Audio::Mixer *mixer)
-	: _game(game), _mixer(mixer) {
+Sound::Sound(SimonEngine *vm, const GameSpecificSettings *gss, Audio::Mixer *mixer)
+	: _vm(vm), _mixer(mixer) {
 	_voice = 0;
 	_effects = 0;
 
@@ -247,8 +248,8 @@
 	_hasVoiceFile = false;
 	_ambientPlaying = 0;
 
-	// simon1cd32 uses separate speech files
-	if (!(_game & GF_TALKIE) || (_game == GAME_SIMON1CD32))
+	// SIMON1CD32 uses separate speech files
+	if (!(_vm->getFeatures() & GF_TALKIE) || (_vm->getGameId() == GID_SIMON1CD32))
 		return;
 
 	File *file = new File();
@@ -280,7 +281,7 @@
 		}
 	}
 #endif
-	if (!_hasVoiceFile && (_game & GF_SIMON2)) {
+	if (!_hasVoiceFile && _vm->getGameType() == GType_SIMON2) {
 		// for simon2 mac/amiga, only read index file
 		file->open("voices.idx");
 		if (file->isOpen() == true) {
@@ -312,7 +313,7 @@
 		}
 	}
 
-	if ((_game & GF_SIMON1) && (_game & GF_TALKIE)) {
+	if ((_vm->getGameType() == GType_SIMON1) && (_vm->getFeatures() & GF_TALKIE)) {
 		file = new File();
 #ifdef USE_MAD
 		if (!_hasEffectsFile && gss->mp3_effects_filename && gss->mp3_effects_filename[0]) {
@@ -383,7 +384,7 @@
 	}
 
 	delete _effects;
-	if (_game == GAME_SIMON1CD32) {
+	if (_vm->getGameId() == GID_SIMON1CD32) {
 		_effects = new VocSound(_mixer, file, 0, SOUND_BIG_ENDIAN);
 	} else
 		_effects = new WavSound(_mixer, file);
@@ -392,7 +393,7 @@
 void Sound::loadSfxTable(File *gameFile, uint32 base) {
 	stopAll();
 
-	if (_game & GF_WIN)
+	if (_vm->getPlatform() == Common::kPlatformWindows)
 		_effects = new WavSound(_mixer, gameFile, base);
 	else
 		_effects = new VocSound(_mixer, gameFile, base);
@@ -444,7 +445,7 @@
 		return;
 
 	_mixer->stopHandle(_voiceHandle);
-	_voice->playSound(sound, &_voiceHandle, (_game == GAME_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED);
+	_voice->playSound(sound, &_voiceHandle, (_vm->getGameId() == GID_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED);
 }
 
 void Sound::playEffects(uint sound) {
@@ -454,7 +455,7 @@
 	if (_effectsPaused)
 		return;
 
-	_effects->playSound(sound, &_effectsHandle, (_game == GAME_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED);
+	_effects->playSound(sound, &_effectsHandle, (_vm->getGameId() == GID_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED);
 }
 
 void Sound::playAmbient(uint sound) {

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- sound.h	18 Oct 2005 01:30:22 -0000	1.28
+++ sound.h	12 Nov 2005 06:01:24 -0000	1.29
@@ -28,9 +28,11 @@
 
 class BaseSound;
 
+class SimonEngine;
+
 class Sound {
 private:
-	byte _game;
+	SimonEngine *_vm;
 
 	Audio::Mixer *_mixer;
 
@@ -53,7 +55,7 @@
 	uint _ambientPlaying;
 
 public:
-	Sound(const byte game, const GameSpecificSettings *gss, Audio::Mixer *mixer);
+	Sound(SimonEngine *vm, const GameSpecificSettings *gss, Audio::Mixer *mixer);
 	~Sound();
 
 	void readSfxFile(const char *filename);

Index: verb.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/verb.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- verb.cpp	19 Oct 2005 11:32:25 -0000	1.32
+++ verb.cpp	12 Nov 2005 06:01:24 -0000	1.33
@@ -191,7 +191,7 @@
 	HitArea *last;
 	HitArea *ha;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		if (_bitArray[4] & 0x8000) {
 			o_unk_120(202);
 			_lastHitArea2Ptr = NULL;
@@ -265,7 +265,7 @@
 void SimonEngine::hitareaChangedHelper() {
 	FillOrCopyStruct *fcs;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		if (_bitArray[4] & 0x8000)
 			return;
 	}
@@ -362,7 +362,7 @@
 	uint id;
 	HitArea *ha;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		id = 2;
 		if (!(_bitArray[4] & 0x8000))
 			id = (_mouseY >= 136) ? 102 : 101;
@@ -391,7 +391,7 @@
 	if (ha == tmp)
 		return;
 
-	if (!(_game & GF_SIMON2)) {
+	if (!(getGameType() == GType_SIMON2)) {
 		if (tmp != NULL) {
 			tmp->flags |= 8;
 			video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA);
@@ -414,7 +414,7 @@
 }
 
 void SimonEngine::hitarea_leave(HitArea *ha) {
-	if (!(_game & GF_SIMON2)) {
+	if (!(getGameType() == GType_SIMON2)) {
 		video_toggle_colors(ha, 0xdf, 0xd5, 0xda, 5);
 	} else {
 		video_toggle_colors(ha, 0xe7, 0xe5, 0xe6, 1);
@@ -458,7 +458,7 @@
 	uint16 x_ = x;
 	const uint16 y_ = y;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		if (_bitArray[4] & 0x8000 || y < 134) {
 			x_ += _scrollX * 8;
 		}
@@ -528,7 +528,7 @@
 	uint x;
 	const byte *string_ptr;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		if (_bitArray[4] & 0x8000) {
 			Subroutine *sub;
 			_variableArray[84] = a;

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.149
retrieving revision 1.150
diff -u -d -r1.149 -r1.150
--- vga.cpp	11 Nov 2005 09:05:19 -0000	1.149
+++ vga.cpp	12 Nov 2005 06:01:24 -0000	1.150
@@ -134,7 +134,7 @@
 			}
 		}
 
-		if (_game & GF_SIMON1) {
+		if (getGameType() == GType_SIMON1) {
 			opcode = READ_BE_UINT16(_vcPtr);
 			_vcPtr += 2;
 		} else {
@@ -208,10 +208,10 @@
 		6, 4, 2, 6, 0
 	};
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		uint opcode = vc_read_next_byte();
 		_vcPtr += opcode_param_len_feeblefiles[opcode];
-	} else if (_game & GF_SIMON2) {
+	} else if (getGameType() == GType_SIMON2) {
 		uint opcode = vc_read_next_byte();
 		_vcPtr += opcode_param_len_simon2[opcode];
 	} else {
@@ -279,7 +279,7 @@
 
 
 	bb = _curVgaFile1;
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		b = bb + READ_LE_UINT16(&((VgaFileHeader_Feeble *) bb)->hdr2_start);
 		b = bb + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) b)->imageTable);
 
@@ -295,7 +295,7 @@
 
 	vc_ptr_org = _vcPtr;
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		_vcPtr = _curVgaFile1 + READ_LE_UINT16(&((ImageHeader_Feeble *) b)->scriptOffs);
 	} else {
 		_vcPtr = _curVgaFile1 + READ_BE_UINT16(&((ImageHeader_Simon *) b)->scriptOffs);
@@ -320,7 +320,7 @@
 
 	windowNum = vc_read_next_word();		/* 0 */
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		fileId = vc_read_next_word();		/* 0 */
 		vgaSpriteId = vc_read_next_word();	/* 2 */
 	} else {
@@ -365,7 +365,7 @@
 	}
 
 	pp = _curVgaFile1;
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		p = pp + READ_LE_UINT16(&((VgaFileHeader_Feeble *) pp)->hdr2_start);
 		p = pp + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) p)->animationTable);
 
@@ -400,7 +400,7 @@
 #endif
 
 	if (_startVgaScript) {
-		if (_game == GAME_FEEBLEFILES) {
+		if (getGameType() == GType_FF) {
 			dump_vga_script(_curVgaFile1 + READ_LE_UINT16(&((AnimationHeader_Feeble*)p)->scriptOffs), res, vgaSpriteId);
 		} else {
 			dump_vga_script(_curVgaFile1 + READ_BE_UINT16(&((AnimationHeader_Simon*)p)->scriptOffs), res, vgaSpriteId);
@@ -408,7 +408,7 @@
 		}
 	}
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		add_vga_timer(VGA_DELAY_BASE, _curVgaFile1 + READ_LE_UINT16(&((AnimationHeader_Feeble *) p)->scriptOffs), vgaSpriteId, res);
 	} else {
 		add_vga_timer(VGA_DELAY_BASE, _curVgaFile1 + READ_BE_UINT16(&((AnimationHeader_Simon *) p)->scriptOffs), vgaSpriteId, res);
@@ -666,7 +666,7 @@
 	if (state.image == 0)
 		return;
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		state.palette = (_vcPtr[0] * 16);
 	} else {
 		state.palette = (_vcPtr[1] * 16);
@@ -674,12 +674,12 @@
 	_vcPtr += 2;
 	state.x = (int16)vc_read_next_word();
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		state.x -= _scrollX;
 	}
 	state.y = (int16)vc_read_next_word();
 
-	if (_game & GF_SIMON1) {
+	if (getGameType() == GType_SIMON1) {
 		state.flags = vc_read_next_word();
 	} else {
 		state.flags = vc_read_next_byte();
@@ -691,7 +691,7 @@
 	p2 = _curVgaFile2 + state.image * 8;
 	state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		state.depack_src = _curVgaFile2 + READ_LE_UINT32(p2);
 		width = READ_LE_UINT16(p2 + 6);
 		height = READ_LE_UINT16(p2 + 4) & 0x7FFF;
@@ -722,8 +722,8 @@
 		}
 	}
 
-	maxWidth = (_game == GAME_FEEBLEFILES) ? 640 : 20;
-	if (_game & GF_SIMON2 && width > maxWidth) {
+	maxWidth = (getGameType() == GType_FF) ? 640 : 20;
+	if (getGameType() == GType_SIMON2 && width > maxWidth) {
 		const byte *src;
 		byte *dst;
 		uint w;
@@ -752,7 +752,7 @@
 		return;
 	}
 
-	if (_game != GAME_FEEBLEFILES) {
+	if (getGameType() != GType_FF) {
 		if (state.flags & 0x10) {
 			state.depack_src = vc10_uncompressFlip(state.depack_src, width, height);
 		} else if (state.flags & 1) {
@@ -778,7 +778,7 @@
 	}
 	state.x = cur;
 
-	maxWidth = (_game == GAME_FEEBLEFILES) ? 640 : (vlut[2] * 2);
+	maxWidth = (getGameType() == GType_FF) ? 640 : (vlut[2] * 2);
 	cur += state.draw_width - maxWidth;
 	if (cur > 0) {
 		do {
@@ -797,7 +797,7 @@
 	}
 	state.y = cur;
 
-	maxHeight = (_game == GAME_FEEBLEFILES) ? 480 : vlut[3];
+	maxHeight = (getGameType() == GType_FF) ? 480 : vlut[3];
 	cur += state.draw_height - maxHeight;
 	if (cur > 0) {
 		do {
@@ -820,7 +820,7 @@
 		uint offs, offs2;
 		// Allow one section of Simon the Sorcerer 1 introduction to be displayed
 		// in lower half of screen
-		if ((_game & GF_SIMON1) && _subroutine == 2926) {
+		if ((getGameType() == GType_SIMON1) && _subroutine == 2926) {
 			offs = ((vlut[0]) * 2 + state.x) * 8;
 			offs2 = (vlut[1] + state.y);
 		} else {
@@ -850,7 +850,7 @@
 			dst = state.surf_addr + w * 2;	/* edi */
 
 			h = state.draw_height;
-			if ((_game & GF_SIMON1) && vc_get_bit(88)) {
+			if ((getGameType() == GType_SIMON1) && vc_get_bit(88)) {
 				/* transparency */
 				do {
 					if (mask[0] & 0xF0) {
@@ -991,7 +991,7 @@
 		}
 		/* vc10_helper_4 */
 	} else {
-		if (_game & GF_SIMON2 && state.flags & 0x4 && _bitArray[10] & 0x800) {
+		if (getGameType() == GType_SIMON2 && state.flags & 0x4 && _bitArray[10] & 0x800) {
 			state.surf_addr = state.surf2_addr;
 			state.surf_pitch = state.surf2_pitch;
 		}
@@ -1100,7 +1100,7 @@
 	VgaSprite *vsp = find_cur_sprite();
 	uint num;
 
-	if (_game & GF_SIMON1) {
+	if (getGameType() == GType_SIMON1) {
 		num = vc_read_var_or_word();
 	} else {
 		num = vc_read_next_byte() * _frameRate;
@@ -1108,7 +1108,7 @@
 
 	// Work around to allow inventory arrows to be
 	// shown in some versions of Simon the Sorcerer 1
-	if ((_game & GF_SIMON1) && vsp->id == 0x80)
+	if ((getGameType() == GType_SIMON1) && vsp->id == 0x80)
 		num = 0;
 	else
 		num += VGA_DELAY_BASE;
@@ -1167,7 +1167,7 @@
 	uint a = vc_read_next_word();
 	_pathFindArray[a - 1] = (const uint16 *)_vcPtr;
 
-	int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
+	int end = (getGameType() == GType_FF) ? 9999 : 999;
 	while (readUint16Wrapper(_vcPtr) != end)
 		_vcPtr += 4;
 	_vcPtr += 2;
@@ -1199,7 +1199,7 @@
 void SimonEngine::vc21_endRepeat() {
 	int16 a = vc_read_next_word();
 	const byte *tmp = _vcPtr + a;
-	if (_game & GF_SIMON2)
+	if (getGameType() == GType_SIMON2)
 		tmp += 3;
 	else
 		tmp += 4;
@@ -1219,7 +1219,7 @@
 	uint palSize = 96;
 	byte *palptr, *src;
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		num = 256;
 		palSize = 768;
 	}
@@ -1283,7 +1283,7 @@
 
 	vsp->x += (int16)vc_read_next_word();
 	vsp->y += (int16)vc_read_next_word();
-	if (_game & GF_SIMON1) {
+	if (getGameType() == GType_SIMON1) {
 		vsp->flags = vc_read_next_word();
 	} else {
 		vsp->flags = vc_read_next_byte();
@@ -1321,7 +1321,7 @@
 
 	vsp = _vgaSprites;
 	while (vsp->id) {
-		if ((_game & GF_SIMON1) && vsp->id == 128) {
+		if ((getGameType() == GType_SIMON1) && vsp->id == 128) {
 			memcpy(&bak, vsp, sizeof(VgaSprite));
 		}
 		vsp->id = 0;
@@ -1339,7 +1339,7 @@
 
 	vte = _vgaTimerList;
 	while (vte->delay) {
-		if ((_game & GF_SIMON1) && vsp->id == 128) {
+		if ((getGameType() == GType_SIMON1) && vsp->id == 128) {
 			vte++;
 		} else {
 			vte2 = vte;
@@ -1410,7 +1410,7 @@
 	uint vga_res = vc_read_next_word();
 	uint windowNum = vc_read_next_word();
 
-	if (_game & GF_SIMON1) {
+	if (getGameType() == GType_SIMON1) {
 		if (windowNum == 16) {
 			_copyPartialMode = 2;
 		} else {
@@ -1443,7 +1443,7 @@
 	uint var = vc_read_next_word();
 	int16 value = vc_read_var(var) + vc_read_next_word();
 
-	if ((_game & GF_SIMON2) && var == 15 && !(_bitArray[5] & 1)) {
+	if ((getGameType() == GType_SIMON2) && var == 15 && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_scrollCount != 0) {
@@ -1472,7 +1472,7 @@
 	uint var = vc_read_next_word();
 	int16 value = vc_read_var(var) - vc_read_next_word();
 
-	if ((_game & GF_SIMON2) && var == 15 && !(_bitArray[5] & 1)) {
+	if ((getGameType() == GType_SIMON2) && var == 15 && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_scrollCount != 0) {
@@ -1591,18 +1591,18 @@
 void SimonEngine::vc52_playSound() {
 	uint16 sound_id = vc_read_next_word();
 
-	if (_game == GAME_FEEBLEFILES) {
+	if (getGameType() == GType_FF) {
 		uint16 pan = vc_read_next_word();
 		uint16 vol = vc_read_next_word();
 		debug(0, "STUB: vc52_playSound: snd %d pan %d vol %d", sound_id, pan, vol);
-	} else if (_game & GF_SIMON2) {
+	} else if (getGameType() == GType_SIMON2) {
 		if (sound_id >= 0x8000) {
 			sound_id = -sound_id;
 			_sound->playAmbient(sound_id);
 		} else {
 			_sound->playEffects(sound_id);
 		}
-	} else if (_game & GF_TALKIE) {
+	} else if (getFeatures() & GF_TALKIE) {
 		_sound->playEffects(sound_id);
 	} else {
 		playSting(sound_id);
@@ -1644,7 +1644,7 @@
 }
 
 void SimonEngine::vc56_delay() {
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		uint num = vc_read_var_or_word() * _frameRate;
 
 		add_vga_timer(num + VGA_DELAY_BASE, _vcPtr, _vgaCurSpriteId, _vgaCurFileId);
@@ -1653,7 +1653,7 @@
 }
 
 void SimonEngine::vc59() {
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		uint file = vc_read_next_word();
 		uint start = vc_read_next_word();
 		uint end = vc_read_next_word() + 1;
@@ -1707,7 +1707,7 @@
 
 	vfs = _vgaSleepStructs;
 	while (vfs->ident != 0) {
-		if (vfs->sprite_id == _vgaCurSpriteId && ((_game & GF_SIMON1) || vfs->cur_vga_file == _vgaCurFileId)) {
+		if (vfs->sprite_id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || vfs->cur_vga_file == _vgaCurFileId)) {
 			while (vfs->ident != 0) {
 				memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct));
 				vfs++;
@@ -1723,7 +1723,7 @@
 
 		vte = _vgaTimerList;
 		while (vte->delay != 0) {
-			if (vte->sprite_id == _vgaCurSpriteId && ((_game & GF_SIMON1) || vte->cur_vga_file == _vgaCurFileId)) {
+			if (vte->sprite_id == _vgaCurSpriteId && ((getGameType() == GType_SIMON1) || vte->cur_vga_file == _vgaCurFileId)) {
 				delete_vga_timer(vte);
 				break;
 			}
@@ -1739,7 +1739,7 @@
 void SimonEngine::vc60_killSprite() {
 	uint file;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		file = vc_read_next_word();
 	} else {
 		file = _vgaCurFileId;
@@ -1781,7 +1781,7 @@
 			delay(5);
 		}
 
-		if (_game & GF_SIMON1) {
+		if (getGameType() == GType_SIMON1) {
 			uint16 params[5];						/* parameters to vc10_draw */
 			VgaSprite *vsp;
 			VgaPointersEntry *vpe;
@@ -1819,12 +1819,12 @@
 
 		// Allow one section of Simon the Sorcerer 1 introduction to be displayed
 		// in lower half of screen
-		if ((_game & GF_SIMON1) && (_subroutine == 2923 || _subroutine == 2926))
+		if ((getGameType() == GType_SIMON1) && (_subroutine == 2923 || _subroutine == 2926))
 			dx_clear_surfaces(200);
 		else
 			dx_clear_surfaces(_windowNum == 4 ? 134 : 200);
 	}
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		if (_nextMusicToPlay != -1)
 			loadMusic(_nextMusicToPlay);
 	}

--- simon-md5.h DELETED ---





More information about the Scummvm-git-logs mailing list