[Scummvm-cvs-logs] CVS: scummvm/simon game.cpp,NONE,1.30.2.2 charset.cpp,1.38.2.4,1.38.2.5 cursor.cpp,1.8.2.2,1.8.2.3 debug.cpp,1.43.2.3,1.43.2.4 debug.h,1.20.2.2,1.20.2.3 debugger.cpp,1.20.2.2,1.20.2.3 icons.cpp,1.6.2.2,1.6.2.3 intern.h,1.39.2.2,1.39.2.3 items.cpp,1.129.2.3,1.129.2.4 module.mk,1.10,1.10.2.1 res.cpp,1.37.2.2,1.37.2.3 saveload.cpp,1.17.2.3,1.17.2.4 simon.cpp,1.520.2.6,1.520.2.7 simon.h,1.149.2.2,1.149.2.3 sound.cpp,1.91.2.3,1.91.2.4 sound.h,1.27.2.2,1.27.2.3 verb.cpp,1.29.2.2,1.29.2.3 vga.cpp,1.139.2.2,1.139.2.3 vga.h,1.13.2.2,1.13.2.3

kirben kirben at users.sourceforge.net
Wed Jan 25 19:36:04 CET 2006


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

Modified Files:
      Tag: branch-0-8-0
	charset.cpp cursor.cpp debug.cpp debug.h 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 vga.h 
Added Files:
      Tag: branch-0-8-0
	game.cpp 
Log Message:

Backport game detection changes for Simon engine, as suggested.


--- NEW FILE: game.cpp ---
/* ScummVM - Scumm Interpreter
 * Copyright (C) 2001-2006 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.30.2.2 2006/01/26 03:35:20 kirben Exp $
 *
[...1054 lines suppressed...]
				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: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/charset.cpp,v
retrieving revision 1.38.2.4
retrieving revision 1.38.2.5
diff -u -d -r1.38.2.4 -r1.38.2.5
--- charset.cpp	18 Jan 2006 18:07:35 -0000	1.38.2.4
+++ charset.cpp	26 Jan 2006 03:35:20 -0000	1.38.2.5
@@ -176,7 +176,7 @@
 	dst += READ_BE_UINT32(p);
 
 	memset(dst, 0, count);
-	if (_language == 20)
+	if (_language == Common::HB_ISR)
 		dst += width - 1; // For Hebrew, start at the right edge, not the left.
 
 	dst_org = dst;
@@ -185,13 +185,13 @@
 			dst_org += width * 10;
 			dst = dst_org;
 		} else if ((chr -= ' ') == 0) {
-			dst += (_language == 20 ? -6 : 6); // Hebrew moves to the left, all others to the right
+			dst += (_language == Common::HB_ISR ? -6 : 6); // Hebrew moves to the left, all others to the right
 		} else {
 			byte *img_hdr = src + 48 + chr * 4;
 			uint img_height = img_hdr[2];
 			uint img_width = img_hdr[3], i;
 			byte *img = src + READ_LE_UINT16(img_hdr);
-			if (_language == 20)
+			if (_language == Common::HB_ISR)
 				dst -= img_width - 1; // For Hebrew, move from right edge to left edge of image.
 			byte *cur_dst = dst;
 
@@ -211,7 +211,7 @@
 				cur_dst += width;
 			} while (--img_height);
 
-			if (_language != 20) // Hebrew character movement is done higher up
+			if (_language != Common::HB_ISR) // Hebrew character movement is done higher up
 				dst += img_width - 1;
 		}
 	}
@@ -302,7 +302,7 @@
 	} else if (c == 0xD || c == 0xA) {
 		video_putchar_newline(fcs);
 	} else if ((c == 1 && _language != 20) || (c == 8)) {
-		if (_language == 20) { //Hebrew
+		if (_language == Common::HB_ISR) { //Hebrew
 			if (b >= 64 && b < 91)
 				width = _hebrew_char_widths [b - 64];
 
@@ -334,7 +334,7 @@
 			fcs->textRow--;
 		}
 
-		if (_language == 20) { //Hebrew
+		if (_language == Common::HB_ISR) { //Hebrew
 			if (c >= 64 && c < 91)
 				width = _hebrew_char_widths [c - 64];
 			fcs->textColumnOffset  -= width;

Index: cursor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/cursor.cpp,v
retrieving revision 1.8.2.2
retrieving revision 1.8.2.3
diff -u -d -r1.8.2.2 -r1.8.2.3
--- cursor.cpp	18 Jan 2006 18:07:35 -0000	1.8.2.2
+++ cursor.cpp	26 Jan 2006 03:35:20 -0000	1.8.2.3
@@ -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.43.2.3
retrieving revision 1.43.2.4
diff -u -d -r1.43.2.3 -r1.43.2.4
--- debug.cpp	18 Jan 2006 18:07:35 -0000	1.43.2.3
+++ debug.cpp	26 Jan 2006 03:35:20 -0000	1.43.2.4
@@ -37,11 +37,11 @@
 	opcode = *p++;
 	if (opcode == 255)
 		return NULL;
-	if (_game & GF_SIMON2 && _game & GF_TALKIE) {
+	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];
@@ -174,7 +174,7 @@
 	const char *str, *strn;
 
 	do {
-		if (!(_game & GF_SIMON2)) {
+		if (getGameType() == GType_SIMON1) {
 			opcode = READ_BE_UINT16(src);
 			src += 2;
 		} else {
@@ -186,9 +186,7 @@
 			return;
 		}
 
-		if (_game == GAME_FEEBLEFILES) {
-			strn = str = feeblefiles_video_opcode_name_table[opcode];
-		} else if (_game & GF_SIMON2) {
+		if (getGameType() == GType_SIMON2) {
 			strn = str = simon2_video_opcode_name_table[opcode];
 		} else {
 			strn = str = simon1_video_opcode_name_table[opcode];
@@ -198,7 +196,6 @@
 			strn++;
 		fprintf(_dumpFile, "%.2d: %s ", opcode, strn + 1);
 
-		int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
 		for (; *str != '|'; str++) {
 			switch (*str) {
 			case 'x':
@@ -208,21 +205,21 @@
 				fprintf(_dumpFile, "%d ", *src++);
 				break;
 			case 'd':
-				fprintf(_dumpFile, "%d ", readUint16Wrapper(src));
+				fprintf(_dumpFile, "%d ", READ_BE_UINT16(src));
 				src += 2;
 				break;
 			case 'v':
-				fprintf(_dumpFile, "[%d] ", readUint16Wrapper(src));
+				fprintf(_dumpFile, "[%d] ", READ_BE_UINT16(src));
 				src += 2;
 				break;
 			case 'i':
-				fprintf(_dumpFile, "%d ", (int16)readUint16Wrapper(src));
+				fprintf(_dumpFile, "%d ", (int16)READ_BE_UINT16(src));
 				src += 2;
 				break;
 			case 'q':
-				while (readUint16Wrapper(src) != end) {
-					fprintf(_dumpFile, "(%d,%d) ", readUint16Wrapper(src),
-									readUint16Wrapper(src + 2));
+				while (READ_BE_UINT16(src) != 999) {
+					fprintf(_dumpFile, "(%d,%d) ", READ_BE_UINT16(src),
+									READ_BE_UINT16(src + 2));
 					src += 4;
 				}
 				src++;

Index: debug.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debug.h,v
retrieving revision 1.20.2.2
retrieving revision 1.20.2.3
diff -u -d -r1.20.2.2 -r1.20.2.3
--- debug.h	18 Jan 2006 18:07:35 -0000	1.20.2.2
+++ debug.h	26 Jan 2006 03:35:20 -0000	1.20.2.3
@@ -1162,115 +1162,6 @@
 	"bb|CLEAR_MARK",
 };
 
-const char *const feeblefiles_video_opcode_name_table[] = {
-	/* 0 */
-	"x|RET",
-	"ddd|FADEOUT",
-	"d|CALL",
-	"ddddd|NEW_SPRITE",
-	/* 4 */
-	"ddd|FADEIN",
-	"vd|SKIP_IF_NEQ",
-	"d|SKIP_IFN_SIB_WITH_A",
-	"d|SKIP_IF_SIB_WITH_A",
-	/* 8 */
-	"dd|SKIP_IF_PARENT_IS",
-	"dd|SKIP_IF_UNK3_IS",
-	"ddddb|DRAW",
-	"|CLEAR_PATHFIND_ARRAY",
-	/* 12 */
-	"b|DELAY",
-	"d|SET_SPRITE_OFFSET_X",
-	"d|SET_SPRITE_OFFSET_Y",
-	"d|IDENT_WAKEUP",
-	/* 16 */
-	"d|IDENT_SLEEP",
-	"dq|SET_PATHFIND_ITEM",
-	"i|JUMP_REL",
-	"|CHAIN_TO",
-	/* 20 */
-	"dd|SET_CODE_WORD",
-	"i|JUMP_IF_CODE_WORD",
-	"dd|SET_SPRITE_PALETTE",
-	"d|SET_SPRITE_PRIORITY",
-	/* 24 */
-	"diid|SET_SPRITE_XY",
-	"x|HALT_SPRITE",
-	"ddddd|SET_WINDOW",
-	"|RESET",
-	/* 28 */
-	"dddd|DUMMY_28",
-	"|STOP_ALL_SOUNDS",
-	"d|SET_BASE_DELAY",
-	"d|SET_PALETTE_MODE",
-	/* 32 */
-	"vv|COPY_VAR",
-	"|FORCE_UNLOCK",
-	"|FORCE_LOCK",
-	"dd|VC35",
-	/* 36 */
-	"dd|SAVELOAD_THING",
-	"v|SET_SPRITE_OFFSET_Y",
-	"v|SKIP_IF_VAR_ZERO",
-	"vd|SET_VAR",
-	/* 40 */
-	"vd|ADD_VAR",
-	"vd|SUB_VAR",
-	"vd|DELAY_IF_NOT_EQ",
-	"d|SKIP_IF_BIT_CLEAR",
-	/* 44 */
-	"d|SKIP_IF_BIT_SET",
-	"v|SET_SPRITE_X",
-	"v|SET_SPRITE_Y",
-	"vv|ADD_VAR_F",
-	/* 48 */
-	"|VC_48",
-	"d|SET_BIT",
-	"d|CLEAR_BIT",
-	"d|CLEAR_HITAREA_BIT_0x40",
-	/* 52 */
-	"ddd|PLAY_SOUND",
-	"ddd|PLAY_SOUND_WITH_ANIM",
-	"ddd|DUMMY_54",
-	"ddd|OFFSET_HIT_AREA",
-	/* 56 */
-	"i|SLEEP_EX",
-	"|DUMMY_57",
-	"|UNK_58",
-	"ddd|KILL_MULTI_SPRITE",
-	/* 60 */
-	"dd|KILL_SPRITE",
-	"ddd|INIT_SPRITE",
-	"|FASTFADEOUT",
-	"|FASTFADEIN",
-	/* 64 */
-	"|SKIP_IF_SPEECH_ENDED",
-	"|PALETTE_THING_3",
-	"|SKIP_IF_NZ",
-	"|SKIP_IF_GE",
-	/* 68 */
-	"|SKIP_IF_LE",
-	"dd|PLAY_TRACK",
-	"dd|QUEUE_MUSIC",
-	"|CHECK_MUSIC_QUEUE",
-	/* 72 */
-	"dd|PLAY_TRACK_2",
-	"bb|SET_MARK",
-	"bb|CLEAR_MARK",
-	"dd|SETSCALE",
-	/* 76 */
-	"ddd|SETSCALEXOFFS",
-	"ddd|SETSCALEYOFFS",
-	"|PATHUNK1",
-	"|PATHUNK1",
-	/* 80 */
-	"ddd|SETOVERLAYIMAGE",
-	"dd|SETRANDOM",
-	"d|PATHUNK3",
-	"ddd|PLAYSOUNDLOOP",
-	"|STOPSOUNDLOOP",
-};
-
 } // End of namespace Simon
 
 #endif

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/debugger.cpp,v
retrieving revision 1.20.2.2
retrieving revision 1.20.2.3
diff -u -d -r1.20.2.2 -r1.20.2.3
--- debugger.cpp	18 Jan 2006 18:07:35 -0000	1.20.2.2
+++ debugger.cpp	26 Jan 2006 03:35:20 -0000	1.20.2.3
@@ -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.6.2.2
retrieving revision 1.6.2.3
diff -u -d -r1.6.2.2 -r1.6.2.3
--- icons.cpp	18 Jan 2006 18:07:35 -0000	1.6.2.2
+++ icons.cpp	26 Jan 2006 03:35:20 -0000	1.6.2.3
@@ -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_SIMON1) {
 		// 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_SIMON1) {
 		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.39.2.2
retrieving revision 1.39.2.3
diff -u -d -r1.39.2.2 -r1.39.2.3
--- intern.h	18 Jan 2006 18:07:35 -0000	1.39.2.2
+++ intern.h	26 Jan 2006 03:35:20 -0000	1.39.2.3
@@ -147,30 +147,64 @@
 
 } // 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,
+	GF_CRUNCHED   = 1 << 2
 };
 
-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_SIMON1DOS_RU,
+	GID_SIMON1DOS_INF,
+	GID_SIMON1DOS_INF_RU,
+	GID_SIMON1DOS_DE,
+	GID_SIMON1DOS_FR,
+	GID_SIMON1DOS_IT,
+	GID_SIMON1DOS_ES,
+	GID_SIMON1DEMO,
+	GID_SIMON1AMIGA,
+	GID_SIMON1AMIGA_FR,
+	GID_SIMON1AMIGA_DE,
+	GID_SIMON1AMIGADEMO,
+	GID_SIMON1CD32,
+	GID_SIMON1CD32_2,
+	GID_SIMON1ACORN,
+	GID_SIMON1ACORNDEMO,
+	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_SIMON2DOS_RU,
+	GID_SIMON2DOS2,
+	GID_SIMON2DOS2_RU,
+	GID_SIMON2DOS_IT,
+	GID_SIMON2DEMO,
+	GID_SIMON2TALKIE,
+	GID_SIMON2TALKIE2,
+	GID_SIMON2TALKIE_DE,
+	GID_SIMON2TALKIE_FR,
+	GID_SIMON2TALKIE_HB,
+	GID_SIMON2TALKIE_IT,
+	GID_SIMON2TALKIE_ES,
+	GID_SIMON2WIN,
+	GID_SIMON2WIN_DE,
+	GID_SIMON2WIN_DE2,
+	GID_SIMON2WIN_PL
 };
 
 #endif

Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.129.2.3
retrieving revision 1.129.2.4
diff -u -d -r1.129.2.3 -r1.129.2.4
--- items.cpp	18 Jan 2006 18:07:35 -0000	1.129.2.3
+++ items.cpp	26 Jan 2006 03:35:20 -0000	1.129.2.4
@@ -274,13 +274,7 @@
 		case 53:{									/* random */
 				uint var = getVarOrByte();
 				uint value = (uint16)getVarOrWord();
-
-				// Disable random in simon1amiga for now
-				// Since copy protection screen is currently unreadable
-				if (_game == GAME_SIMON1AMIGA)
-					writeVariable(var, 4);
-				else
-					writeVariable(var, _rnd.getRandomNumber(value - 1));
+				writeVariable(var, _rnd.getRandomNumber(value - 1));
 			}
 			break;
 
@@ -374,7 +368,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 +394,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 +443,7 @@
 			break;
 
 		case 83:{									/* restart subroutine */
-				if (_game & GF_SIMON2)
+				if (getGameType() == GType_SIMON2)
 					o_83_helper();
 				return -10;
 			}
@@ -527,7 +521,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 +537,7 @@
 			break;
 
 		case 99:{									/* kill sprite */
-				if (_game & GF_SIMON1) {
+				if (getGameType() == GType_SIMON1) {
 					o_kill_sprite_simon1(getVarOrWord());
 				} else {
 					uint a = getVarOrWord();
@@ -741,11 +735,7 @@
 
 		case 133:{									/* load game */
 				_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
-				if (_game == GAME_FEEBLEFILES) {
-					load_game(readVariable(55));
-				} else {
-					o_load_game();
-				}
+				o_load_game();
 				_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 			}
 			break;
@@ -757,14 +747,9 @@
 			break;
 
 		case 135:{									/* quit if user presses y */
-				if (_game == GAME_FEEBLEFILES) {
-					// Switch CD
-					debug(1, "Switch to CD number %d", readVariable(97));
-				} else {
-					_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
-					o_quit_if_user_presses_y();
-					_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
-				}
+				_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
+				o_quit_if_user_presses_y();
+				_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, false);
 			}
 			break;
 
@@ -862,6 +847,9 @@
 
 		case 156:{									/* is bit set? */
 				uint bit = getVarOrByte();
+				if (getGameType() == GType_SIMON1 && _subroutine == 2962 && bit == 63) {
+					bit = 50;
+				}
 				condition = (_bitArray[bit >> 4] & (1 << (bit & 15))) != 0;
 			}
 			break;
@@ -986,7 +974,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 +991,7 @@
 
 		case 181:{									/* force lock */
 				o_force_lock();
-				if (_game & GF_SIMON2) {
+				if (getGameType() == GType_SIMON2) {
 					fcs_unk_2(1);
 					showMessageFormat("\xC");
 				}
@@ -1011,26 +999,18 @@
 			break;
 
 		case 182:{									/* read vgares 328 */
-				if (_game == GAME_FEEBLEFILES) {
-					// Load Smacker filename
-					debug(1,"Load Smacker: %s", getStringPtrByID(getNextStringID()));
-				} else if (_game & GF_SIMON2) {
+				if (getGameType() == GType_SIMON2)
 					goto invalid_opcode;
-				} else {
-					o_read_vgares_328();
-				}
+
+				o_read_vgares_328();
 			}
 			break;
 
 		case 183:{									/* read vgares 23 */
-				if (_game == GAME_FEEBLEFILES) {
-					// Play Smacker
-					debug(1, "Play Smacker");
-				} else if (_game & GF_SIMON2) {
+				if (getGameType() == GType_SIMON2)
 					goto invalid_opcode;
-				} else {
-					o_read_vgares_23();
-				}
+
+				o_read_vgares_23();
 			}
 			break;
 
@@ -1040,10 +1020,11 @@
 			break;
 
 		case 185:{									/* midi sfx file number */
-				if (_game & GF_SIMON2)
+				if (getGameType() == GType_SIMON2)
 					goto invalid_opcode;
-					_soundFileId = getVarOrWord();
-				if (_game == GAME_SIMON1CD32) {
+
+				_soundFileId = getVarOrWord();
+				if (getPlatform() == Common::kPlatformAmiga && getFeatures() & GF_TALKIE) {
 					char buf[10];
 					sprintf(buf, "%d%s", _soundFileId, "Effects");
 					_sound->readSfxFile(buf);
@@ -1060,14 +1041,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();
@@ -1077,7 +1058,7 @@
 			break;
 
 		case 189:{									/* clear_op189_flag */
-				if (_game & GF_SIMON1)
+				if (getGameType() == GType_SIMON1)
 					goto invalid_opcode;
 				_marks = 0;
 			}
@@ -1085,7 +1066,7 @@
 
 		case 190:{
 				uint i;
-				if (_game & GF_SIMON1)
+				if (getGameType() == GType_SIMON1)
 					goto invalid_opcode;
 				i = getVarOrByte();
 				if (!(_marks & (1 << i)))
@@ -1093,74 +1074,6 @@
 			}
 			break;
 
-		// Feeble opcodes
-		case 191:
-			warning("STUB: script opcode 191");
-			if (_bitArray[5] & 0x0008) {
-				// Clear some variables
-			} else {
-				// Clear some other variables
-			}
-			break;
-
-		case 192:{
-				uint a = getVarOrByte();
-				uint b = getVarOrByte();
-				uint c = getVarOrByte();
-				uint d = getVarOrByte();
-				if (_bitArray[5] & 0x0008) {
-					// Set some variables
-				} else {
-					// Set some other variables
-				}
-				warning("STUB: script opcode 192 (%d, %d, %d, %d)", a, b, c, d);
-			}
-			break;
-
-		case 193:
-			// pause clock
-			warning("STUB: script opcode 193");
-			break;
-
-		case 194:
-			// resume clock
-			warning("STUB: script opcode 194");
-			break;
-
-		case 195:{
-				// Set palette colour?
-				uint blue = getVarOrByte();
-				uint green = getVarOrByte();
-				uint red = getVarOrByte();
-				uint color = getVarOrByte();
-				warning("STUB: script opcode 195 (%d, %d, %d, %d)", blue, green, red, color);
-			}
-			break;
-
-		case 196:{									/* set bit3 */
-				uint bit = getVarOrByte();
-				_bitArray[(bit >> 4) + 32] |= 1 << (bit & 15);
-			}
-			break;
-
-		case 197:{									/* clear bit3 */
-				uint bit = getVarOrByte();
-				_bitArray[(bit >> 4) + 32] &= ~(1 << (bit & 15));
-			}
-			break;
-
-		case 198:{									/* is bit3 clear */
-				uint bit = getVarOrByte();
-				condition = (_bitArray[(bit >> 4) + 32] & (1 << (bit & 15))) == 0;
-			}
-			break;
-
-		case 199:{									/* is bit3 set */
-				uint bit = getVarOrByte();
-				condition = (_bitArray[(bit >> 4) + 32] & (1 << (bit & 15))) != 0;
-			}
-			break;
-
 		default:
 		invalid_opcode:;
 			error("Invalid opcode '%d'", opcode);
@@ -1309,7 +1222,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)];
 
@@ -1361,7 +1274,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);
@@ -1472,9 +1385,6 @@
 start_over:;
 	_keyPressed = 0;
 
-	if (_game == GAME_SIMON1CD32)
-		goto start_over_3;
-
 start_over_2:;
 	_lastHitArea = _lastHitArea3 = 0;
 
@@ -1520,51 +1430,6 @@
 	if (ha->id >= 214)
 		goto start_over_2;
 	return ha->id - 208;
-
-//FIXME Hack to allow load and save file selection in simon1cd32
-//      Uses the follow keys for moving around
-//      1 - 6 to select slot to load/save
-//      Up Arrow to move up slots
-//      Down Arrow to move down slots
-//      X to exit
-start_over_3:;
-	if (_saveLoadFlag) {
-		*b = false;
-		delay(1);
-		return _keyPressed;
-	}
-
-	if (_keyPressed == 17) {
-		if (_saveLoadRowCurPos == 1)
-			goto start_over_3;
-		if (_saveLoadRowCurPos < 7)
-			_saveLoadRowCurPos = 1;
-		else
-			_saveLoadRowCurPos -= 6;
-
-		goto strange_jump;
-	}
-
-	if (_keyPressed == 18) {
-		if (!_saveDialogFlag)
-			goto start_over_3;
-		_saveLoadRowCurPos += 6;
-		if (_saveLoadRowCurPos >= _numSaveGameRows)
-			_saveLoadRowCurPos = _numSaveGameRows;
-		goto strange_jump;
-	}
-
-	if (_keyPressed == 120)
-		return 205;
-
-	if (_keyPressed > 48 && _keyPressed < 55) {
-		return _keyPressed - 49;
-	}
-
-
-	delay(1);
-	goto start_over_3;
-
 }
 
 void SimonEngine::o_unk_132_helper_3() {
@@ -1606,7 +1471,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);
@@ -1625,21 +1490,14 @@
 
 void SimonEngine::o_unk_120(uint a) {
 	uint16 id = TO_BE_16(a);
-	if (_game & GF_SIMON2) {
-		_lockWord |= 0x8000;
-		_vcPtr = (byte *)&id;
-		vc15_wakeup_id();
-		_lockWord &= ~0x8000;
-	} else {
-		_lockWord |= 0x4000;
-		_vcPtr = (byte *)&id;
-		vc15_wakeup_id();
-		_lockWord &= ~0x4000;
-	}
+	_lockWord |= 0x8000;
+	_vcPtr = (byte *)&id;
+	vc15_wakeup_id();
+	_lockWord &= ~0x8000;
 }
 
 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.10.2.1
diff -u -d -r1.10 -r1.10.2.1
--- module.mk	16 Dec 2004 12:49:25 -0000	1.10
+++ module.mk	26 Jan 2006 03:35:20 -0000	1.10.2.1
@@ -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.37.2.2
retrieving revision 1.37.2.3
diff -u -d -r1.37.2.2 -r1.37.2.3
--- res.cpp	18 Jan 2006 18:07:35 -0000	1.37.2.2
+++ res.cpp	26 Jan 2006 03:35:21 -0000	1.37.2.3
@@ -96,30 +96,6 @@
 	" ", " ", "BT ", " ", "B "
 };
 
-static const char *const opcode_arg_table_feeblefiles[256] = {
-	" ", "I ", "I ", "I ", "I ", "I ", "I ", "II ", "II ", "II ", "II ", "B ", "B ", "BN ", "BN ",
-	"BN ", "BN ", "BB ", "BB ", "BB ", "BB ", "II ", "II ", "N ", "I ", "I ", "I ", "IN ", "IB ",
-	"II ", "I ", "I ", "II ", "II ", "IBB ", "BIB ", "BB ", "B ", "BI ", "IB ", "B ", "B ", "BN ",
-	"BN ", "BN ", "BB ", "BB ", "BN ", "BN ", "BB ", "BB ", "BN ", "BB ", "BN ", "B ", "I ", "IB ",
-	"IB ", "II ", "I ", "I ", "IN ", "B ", "T ", "T ", "NNNNNB ", "BT ", "BTS ", "T ", " ", "B ",
-	"N ", "IBN ", "I ", "I ", "I ", "NN ", " ", " ", "IT ", "II ", "I ", "B ", " ", "IB ", "IBB ",
-	"IIB ", "T ", " ", " ", "IB ", "IB ", "IB ", "B ", "BB ", "IBB ", "NB ", "N ", "NNBNNN ", "NN ",
-	" ", "BNNNNNN ", "B ", " ", "B ", "B ", "BB ", "NNNNNIN ", "N ", "N ", "N ", "NNN ", "NBNN ",
-	"IBNN ", "IB ", "IB ", "IB ", "IB ", "N ", "N ", "N ", "BI ", " ", " ", "N ", "I ", "IBB ",
-	"NNB ", "N ", "N ", "Ban ", " ", " ", " ", " ", " ", "IB ", "B ", " ", "II ", " ", "BI ",
-	"N ", "I ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "IB ", "BI ", "BB ", "B ", "B ", "B ",
-	"B ", "IBB ", "IBN ", "IB ", "B ", "BNNN ", "BBTS ", "N ", " ", "Ian ", "B ", "B ", "B ", "B ",
-	"T ", "N ", " ", " ", "I ", " ", " ", "BBI ", "NNBB ", "BBB ", " ", " ", "T ", " ", "N ", "N ",
-	" ", " ", "BT ", " ", "B ", " ", "BBBB ", " ", " ", "BBBB ", "B ", "B ", "B ", "B "
-};
-
-uint16 SimonEngine::readUint16Wrapper(const void *src) {
-	if (_game == GAME_FEEBLEFILES)
-		return READ_LE_UINT16(src);
-	else
-		return READ_BE_UINT16(src);
-}
-
 void SimonEngine::loadGamePcFile(const char *filename) {
 	Common::File in;
 	int num_inited_objects;
@@ -172,11 +148,8 @@
 	_tablesHeapPtrOrg = _tablesHeapPtr;
 	_tablesHeapCurPosOrg = _tablesHeapCurPos;
 
-	if (_game == GAME_FEEBLEFILES)
-		return;
-
 	/* Read list of TEXT resources */
-	if (_game == GAME_SIMON1ACORN)
+	if (getPlatform() == Common::kPlatformAcorn)
 		in.open("STRIPPED");
 	else
 		in.open("STRIPPED.TXT");
@@ -287,13 +260,11 @@
 
 	const char *const *table;
 
-	if (_game == GAME_FEEBLEFILES) {
-		table = opcode_arg_table_feeblefiles;
-	} else if ((_game & GF_SIMON2) && (_game & GF_TALKIE))
+	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.17.2.3
retrieving revision 1.17.2.4
diff -u -d -r1.17.2.3 -r1.17.2.4
--- saveload.cpp	18 Jan 2006 18:07:35 -0000	1.17.2.3
+++ saveload.cpp	26 Jan 2006 03:35:21 -0000	1.17.2.4
@@ -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;
@@ -227,7 +227,7 @@
 
 		fcs->textRow = unk132_result;
 
-		if (_language == 20) { //Hebrew
+		if (_language == Common::HB_ISR) { //Hebrew
 			// init x offset with a 2 character savegame number + a period (18 pix)
 			fcs->textColumn = 3;
 			fcs->textColumnOffset = 6;
@@ -244,7 +244,7 @@
 		// now process entire savegame name to get correct x offset for cursor
 		name_len = 0;
 		while (name[name_len]) {
-			if (_language == 20) { //Hebrew
+			if (_language == Common::HB_ISR) { //Hebrew
 				byte width = 6;
 				if (name[name_len] >= 64 && name[name_len] < 91)
 					width = _hebrew_char_widths [name[name_len] - 64];
@@ -412,11 +412,7 @@
 		return false;
 	}
 
-	if (_game == GAME_FEEBLEFILES) {
-		f->write(caption, 100);
-	} else {
-		f->write(caption, 18);
-	}
+	f->write(caption, 18);
 
 	f->writeUint32BE(_itemArrayInited - 1);
 	f->writeUint32BE(0xFFFFFFFF);
@@ -481,12 +477,6 @@
 	for (i = 0; i != 32; i++)
 		f->writeUint16BE(_bitArray[i]);
 
-	// Write the bits in array 3
-	if (_game == GAME_FEEBLEFILES) {
-		for (i = 33; i != 48; i++)
-			f->writeUint16BE(_bitArray[i]);
-	}
-
 	f->flush();
 	bool result = !f->ioFailed();
 
@@ -499,12 +489,7 @@
 char *SimonEngine::gen_savename(int slot) {
 	static char buf[15];
 
-	if (_game == GAME_FEEBLEFILES) {
-		if (slot == 999)
-			sprintf(buf, "save.%.3d", slot);
-		else
-			sprintf(buf, "feeble.%.3d", slot);
-	} else if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		sprintf(buf, "simon2.%.3d", slot);
 	} else {
 		sprintf(buf, "simon1.%.3d", slot);
@@ -525,11 +510,7 @@
 		return false;
 	}
 
-	if (_game == GAME_FEEBLEFILES) {
-		f->read(ident, 100);
-	} else {
-		f->read(ident, 18);
-	}
+	f->read(ident, 18);
 
 	num = f->readUint32BE();
 
@@ -611,12 +592,6 @@
 	for (i = 0; i != 32; i++)
 		_bitArray[i] = f->readUint16BE();
 
-	// Read the bits in array 3
-	if (_game == GAME_FEEBLEFILES) {
-		for (i = 33; i != 48; i++)
-			_bitArray[i] = f->readUint16BE();
-	}
-
 	if (f->ioFailed()) {
 		error("load failed");
 	}

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.520.2.6
retrieving revision 1.520.2.7
diff -u -d -r1.520.2.6 -r1.520.2.7
--- simon.cpp	18 Jan 2006 18:07:35 -0000	1.520.2.6
+++ simon.cpp	26 Jan 2006 03:35:21 -0000	1.520.2.7
@@ -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,89 @@
 
 using Common::File;
 
[...1282 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
@@ -4265,7 +4116,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.149.2.2
retrieving revision 1.149.2.3
diff -u -d -r1.149.2.2 -r1.149.2.3
--- simon.h	18 Jan 2006 18:07:35 -0000	1.149.2.2
+++ simon.h	26 Jan 2006 03:35:21 -0000	1.149.2.3
@@ -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,35 @@
 	VgaTimerEntry() { memset(this, 0, sizeof(*this)); }
 };
 
+enum SimonTypes {
+	GType_SIMON1,
+	GType_SIMON2
+};
+
+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;
@@ -109,6 +140,17 @@
 	friend class Debugger;
 
 	void errorString(const char *buf_input, char *buf_output);
+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);
 
@@ -380,8 +422,6 @@
 	virtual ~SimonEngine();
 
 protected:
-	uint16 readUint16Wrapper(const void *src);
-
 	int allocGamePcVars(Common::File *in);
 	void loginPlayerHelper(Item *item, int a, int b);
 	void loginPlayer();
@@ -694,16 +734,6 @@
 	void vc72_play_track_2();
 	void vc73_setMark();
 	void vc74_clearMark();
-	void vc75_setScale();
-	void vc76_setScaleXOffs();
-	void vc77_setScaleYOffs();
-	void vc78_pathUnk1();
-	void vc79_pathUnk2();
-	void vc80_setOverlayImage();
-	void vc81_setRandom();
-	void vc82_pathUnk3();
-	void vc83_playSoundLoop();
-	void vc84_stopSoundLoop();
 
 protected:
 	void delete_vga_timer(VgaTimerEntry * vte);

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.cpp,v
retrieving revision 1.91.2.3
retrieving revision 1.91.2.4
diff -u -d -r1.91.2.3 -r1.91.2.4
--- sound.cpp	18 Jan 2006 18:07:35 -0000	1.91.2.3
+++ sound.cpp	26 Jan 2006 03:35:21 -0000	1.91.2.4
@@ -22,6 +22,7 @@
 #include "common/file.h"
 #include "common/util.h"
 
+#include "simon/simon.h"
 #include "simon/sound.h"
 
 #include "sound/flac.h"
@@ -233,8 +234,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;
 
@@ -249,8 +250,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();
@@ -282,7 +283,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) {
@@ -314,7 +315,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]) {
@@ -385,7 +386,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);
@@ -394,7 +395,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);
@@ -446,7 +447,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) {
@@ -456,7 +457,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.27.2.2
retrieving revision 1.27.2.3
diff -u -d -r1.27.2.2 -r1.27.2.3
--- sound.h	18 Jan 2006 18:07:35 -0000	1.27.2.2
+++ sound.h	26 Jan 2006 03:35:21 -0000	1.27.2.3
@@ -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.29.2.2
retrieving revision 1.29.2.3
diff -u -d -r1.29.2.2 -r1.29.2.3
--- verb.cpp	18 Jan 2006 18:07:35 -0000	1.29.2.2
+++ verb.cpp	26 Jan 2006 03:35:21 -0000	1.29.2.3
@@ -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;
@@ -221,25 +221,53 @@
 
 	if (_showPreposition) {
 		switch (_language) {
-		case 21: verb_prep_names = russian_verb_prep_names; break;
-		case 20: verb_prep_names = hebrew_verb_prep_names; break;
-		case  5: verb_prep_names = spanish_verb_prep_names; break;
-		case  3: verb_prep_names = italian_verb_prep_names; break;
-		case  2: verb_prep_names = french_verb_prep_names; break;
-		case  1: verb_prep_names = german_verb_prep_names; break;
-		default: verb_prep_names = english_verb_prep_names; break;
+		case Common::RU_RUS:
+			verb_prep_names = russian_verb_prep_names;
+			break;
+		case Common::HB_ISR:
+			verb_prep_names = hebrew_verb_prep_names;
+			break;
+		case Common::ES_ESP:
+			verb_prep_names = spanish_verb_prep_names;
+			break;
+		case Common::IT_ITA:
+			verb_prep_names = italian_verb_prep_names; 
+			break;
+		case Common::FR_FRA:
+			verb_prep_names = french_verb_prep_names;
+			break;
+		case Common::DE_DEU:
+			verb_prep_names = german_verb_prep_names;
+			break;
+		default: 
+			verb_prep_names = english_verb_prep_names;
+			break;
 		}
 		CHECK_BOUNDS(hitarea_id, english_verb_prep_names);
 		txt = verb_prep_names[hitarea_id];
 	} else {
 		switch (_language) {
-		case 21: verb_names = russian_verb_names; break;
-		case 20: verb_names = hebrew_verb_names; break;
-		case  5: verb_names = spanish_verb_names; break;
-		case  3: verb_names = italian_verb_names; break;
-		case  2: verb_names = french_verb_names; break;
-		case  1: verb_names = german_verb_names; break;
-		default: verb_names = english_verb_names; break;
+		case Common::RU_RUS:
+			verb_names = russian_verb_names;
+			break;
+		case Common::HB_ISR:
+			verb_names = hebrew_verb_names;
+			break;
+		case Common::ES_ESP:
+			verb_names = spanish_verb_names;
+			break;
+		case Common::IT_ITA:
+			verb_names = italian_verb_names;
+			break;
+		case Common::FR_FRA:
+			verb_names = french_verb_names;
+			break;
+		case Common::DE_DEU:
+			verb_names = german_verb_names;
+			break;
+		default: 
+			verb_names = english_verb_names;
+			break;
 		}
 		CHECK_BOUNDS(hitarea_id, english_verb_names);
 		txt = verb_names[hitarea_id];
@@ -265,7 +293,7 @@
 void SimonEngine::hitareaChangedHelper() {
 	FillOrCopyStruct *fcs;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		if (_bitArray[4] & 0x8000)
 			return;
 	}
@@ -362,7 +390,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 +419,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 +442,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 +486,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 +556,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.139.2.2
retrieving revision 1.139.2.3
diff -u -d -r1.139.2.2 -r1.139.2.3
--- vga.cpp	18 Jan 2006 18:07:35 -0000	1.139.2.2
+++ vga.cpp	26 Jan 2006 03:35:21 -0000	1.139.2.3
@@ -108,16 +108,6 @@
 	&SimonEngine::vc72_play_track_2,
 	&SimonEngine::vc73_setMark,
 	&SimonEngine::vc74_clearMark,
-	&SimonEngine::vc75_setScale,
-	&SimonEngine::vc76_setScaleXOffs,
-	&SimonEngine::vc77_setScaleYOffs,
-	&SimonEngine::vc78_pathUnk1,
-	&SimonEngine::vc79_pathUnk2,
-	&SimonEngine::vc80_setOverlayImage,
-	&SimonEngine::vc81_setRandom,
-	&SimonEngine::vc82_pathUnk3,
-	&SimonEngine::vc83_playSoundLoop,
-	&SimonEngine::vc84_stopSoundLoop,
 };
 
 // Script parser
@@ -132,7 +122,7 @@
 			}
 		}
 
-		if (_game & GF_SIMON1) {
+		if (getGameType() == GType_SIMON1) {
 			opcode = READ_BE_UINT16(_vcPtr);
 			_vcPtr += 2;
 		} else {
@@ -158,7 +148,7 @@
 
 uint SimonEngine::vc_read_next_word() {
 	uint a;
-	a = readUint16Wrapper(_vcPtr);
+	a = READ_BE_UINT16(_vcPtr);
 	_vcPtr += 2;
 	return a;
 }
@@ -192,24 +182,7 @@
 		4, 2, 2
 	};
 
-	static const byte opcode_param_len_feeblefiles[] = {
-		0, 6, 2, 12, 6, 4, 2, 2,
-		4, 4, 9, 0, 1, 2, 2, 2,
-		2, 0, 2, 0, 4, 2, 4, 2,
-		7, 0, 10, 0, 8, 0, 2, 2,
-		4, 0, 0, 4, 4, 2, 2, 4,
-		4, 4, 4, 2, 2, 2, 2, 4,
-		0, 2, 2, 2, 6, 6, 6, 6,
-		2, 0, 6, 6, 4, 6, 0, 0,
-		0, 0, 4, 4, 4, 4, 4, 0,
-		4, 2, 2, 4, 6, 6, 0, 0,
-		6, 4, 2, 6, 0
-	};
-
-	if (_game == GAME_FEEBLEFILES) {
-		uint opcode = vc_read_next_byte();
-		_vcPtr += opcode_param_len_feeblefiles[opcode];
-	} else if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		uint opcode = vc_read_next_byte();
 		_vcPtr += opcode_param_len_simon2[opcode];
 	} else {
@@ -225,9 +198,9 @@
 	// Simon1 Only
 	if (_vgaRes328Loaded == true) {
 		_vgaRes328Loaded = false;
-		_lockWord |= 0x4000;
+		_lockWord |= 0x8000;
 		read_vga_from_datfile_1(23);
-		_lockWord &= ~0x4000;
+		_lockWord &= ~0x8000;
 	}
 }
 
@@ -235,9 +208,9 @@
 	// Simon1 Only
 	if (_vgaRes328Loaded == false) {
 		_vgaRes328Loaded = true;
-		_lockWord |= 0x4000;
+		_lockWord |= 0x8000;
 		read_vga_from_datfile_1(328);
-		_lockWord &= ~0x4000;
+		_lockWord &= ~0x8000;
 	}
 }
 
@@ -277,27 +250,15 @@
 
 
 	bb = _curVgaFile1;
-	if (_game == GAME_FEEBLEFILES) {
-		b = bb + READ_LE_UINT16(&((VgaFileHeader_Feeble *) bb)->hdr2_start);
-		b = bb + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) b)->imageTable);
-
-		while (READ_LE_UINT16(&((ImageHeader_Feeble *) b)->id) != num)
-			b += sizeof(ImageHeader_Feeble);
-	} else {
-		b = bb + READ_BE_UINT16(&((VgaFileHeader_Simon *) bb)->hdr2_start);
-		b = bb + READ_BE_UINT16(&((VgaFileHeader2_Simon *) b)->imageTable);
+	b = bb + READ_BE_UINT16(&((VgaFileHeader_Simon *) bb)->hdr2_start);
+	b = bb + READ_BE_UINT16(&((VgaFileHeader2_Simon *) b)->imageTable);
 
-		while (READ_BE_UINT16(&((ImageHeader_Simon *) b)->id) != num)
-			b += sizeof(ImageHeader_Simon);
-	}
+	while (READ_BE_UINT16(&((ImageHeader_Simon *) b)->id) != num)
+		b += sizeof(ImageHeader_Simon);
 
 	vc_ptr_org = _vcPtr;
 
-	if (_game == GAME_FEEBLEFILES) {
-		_vcPtr = _curVgaFile1 + READ_LE_UINT16(&((ImageHeader_Feeble *) b)->scriptOffs);
-	} else {
-		_vcPtr = _curVgaFile1 + READ_BE_UINT16(&((ImageHeader_Simon *) b)->scriptOffs);
-	}
+	_vcPtr = _curVgaFile1 + READ_BE_UINT16(&((ImageHeader_Simon *) b)->scriptOffs);
 
 	//dump_vga_script(_vcPtr, res, num);
 	run_vga_script();
@@ -318,12 +279,12 @@
 
 	windowNum = vc_read_next_word();		/* 0 */
 
-	if (_game & GF_SIMON2) {
-		fileId = vc_read_next_word();		/* 0 */
+	if (getGameType() == GType_SIMON1) {
 		vgaSpriteId = vc_read_next_word();	/* 2 */
+		fileId = vgaSpriteId / 100;
 	} else {
+		fileId = vc_read_next_word();		/* 0 */
 		vgaSpriteId = vc_read_next_word();	/* 2 */
-		fileId = vgaSpriteId / 100;
 	}
 
 	x = vc_read_next_word();			/* 4 */
@@ -363,19 +324,11 @@
 	}
 
 	pp = _curVgaFile1;
-	if (_game == GAME_FEEBLEFILES) {
-		p = pp + READ_LE_UINT16(&((VgaFileHeader_Feeble *) pp)->hdr2_start);
-		p = pp + READ_LE_UINT16(&((VgaFileHeader2_Feeble *) p)->animationTable);
-
-		while (READ_LE_UINT16(&((AnimationHeader_Feeble *) p)->id) != vgaSpriteId)
-			p += sizeof(AnimationHeader_Feeble);
-	} else {
-		p = pp + READ_BE_UINT16(&((VgaFileHeader_Simon *) pp)->hdr2_start);
-		p = pp + READ_BE_UINT16(&((VgaFileHeader2_Simon *) p)->animationTable);
+	p = pp + READ_BE_UINT16(&((VgaFileHeader_Simon *) pp)->hdr2_start);
+	p = pp + READ_BE_UINT16(&((VgaFileHeader2_Simon *) p)->animationTable);
 
-		while (READ_BE_UINT16(&((AnimationHeader_Simon *) p)->id) != vgaSpriteId)
-			p += sizeof(AnimationHeader_Simon);
-	}
+	while (READ_BE_UINT16(&((AnimationHeader_Simon *) p)->id) != vgaSpriteId)
+		p += sizeof(AnimationHeader_Simon);
 
 #ifdef DUMP_FILE_NR
 	{
@@ -398,19 +351,11 @@
 #endif
 
 	if (_startVgaScript) {
-		if (_game == GAME_FEEBLEFILES) {
-			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);
+		dump_vga_script(_curVgaFile1 + READ_BE_UINT16(&((AnimationHeader_Simon*)p)->scriptOffs), res, vgaSpriteId);
 
-		}
 	}
 
-	if (_game == GAME_FEEBLEFILES) {
-		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);
-	}
+	add_vga_timer(VGA_DELAY_BASE, _curVgaFile1 + READ_BE_UINT16(&((AnimationHeader_Simon *) p)->scriptOffs), vgaSpriteId, res);
 
 	_curVgaFile1 = old_file_1;
 }
@@ -665,12 +610,12 @@
 	state.palette = (_vcPtr[1] << 4);
 	_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_SIMON2)) {
+	if (getGameType() == GType_SIMON1) {
 		state.flags = vc_read_next_word();
 	} else {
 		state.flags = vc_read_next_byte();
@@ -681,28 +626,16 @@
 
 	p2 = _curVgaFile2 + state.image * 8;
 	state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
-
-	if (_game == GAME_FEEBLEFILES) {
-		width = READ_LE_UINT16(p2 + 6);
-	} else {
-		width = READ_BE_UINT16(p2 + 6) >> 4;
-	}
-
+	width = READ_BE_UINT16(p2 + 6) >> 4;
 	height = p2[5];
 	flags = p2[4];
 
-	debug(1, "Width %d Height %d Flags 0x%x", width, height, flags);
-
 	if (height == 0 || width == 0)
 		return;
 
 	if (_dumpImages)
 		dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width * 16, height,
 											 state.palette);
-	// TODO::Add support for image scaling
-	if (_game == GAME_FEEBLEFILES)
-		return;
-
 	if (flags & 0x80 && !(state.flags & 0x10)) {
 		if (state.flags & 1) {
 			state.flags &= ~1;
@@ -712,8 +645,7 @@
 		}
 	}
 
-	uint maxWidth = (_game == GAME_FEEBLEFILES) ? 641 : 21;
-	if (_game & GF_SIMON2 && width >= maxWidth) {
+	if (getGameType() == GType_SIMON2 && width > 20) {
 		const byte *src;
 		byte *dst;
 		uint w;
@@ -806,7 +738,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 {
@@ -836,7 +768,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) {
@@ -977,7 +909,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;
 		}
@@ -1086,7 +1018,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;
@@ -1094,7 +1026,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;
@@ -1153,8 +1085,7 @@
 	uint a = vc_read_next_word();
 	_pathFindArray[a - 1] = (const uint16 *)_vcPtr;
 
-	int end = (_game == GAME_FEEBLEFILES) ? 9999 : 999;
-	while (readUint16Wrapper(_vcPtr) != end)
+	while (READ_BE_UINT16(_vcPtr) != 999)
 		_vcPtr += 4;
 	_vcPtr += 2;
 }
@@ -1185,7 +1116,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;
@@ -1264,7 +1195,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();
@@ -1302,7 +1233,7 @@
 
 	vsp = _vgaSprites;
 	while (vsp->id) {
-		if ((_game & GF_SIMON1) && vsp->id == 0x80) {
+		if ((getGameType() == GType_SIMON1) && vsp->id == 0x80) {
 			memcpy(&bak, vsp, sizeof(VgaSprite));
 		}
 		vsp->id = 0;
@@ -1320,7 +1251,7 @@
 
 	vte = _vgaTimerList;
 	while (vte->delay) {
-		if ((_game & GF_SIMON1) && vsp->id == 0x80) {
+		if ((getGameType() == GType_SIMON1) && vsp->id == 0x80) {
 			vte++;
 		} else {
 			vte2 = vte;
@@ -1391,7 +1322,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 {
@@ -1424,7 +1355,7 @@
 	uint var = vc_read_next_word();
 	int16 value = vc_read_var(var) + vc_read_next_word();
 
-	if ((_game & GF_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
+	if ((getGameType() == GType_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_scrollCount != 0) {
@@ -1453,7 +1384,7 @@
 	uint var = vc_read_next_word();
 	int16 value = vc_read_var(var) - vc_read_next_word();
 
-	if ((_game & GF_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
+	if ((getGameType() == GType_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_scrollCount != 0) {
@@ -1536,9 +1467,9 @@
 	vp = &_variableArray[20];
 
 	do {
-		y2 = readUint16Wrapper(p);
+		y2 = READ_BE_UINT16(p);
 		p += step;
-		y1 = readUint16Wrapper(p) - y2;
+		y1 = READ_BE_UINT16(p) - y2;
 
 		vp[0] = y1 >> 1;
 		vp[1] = y1 - (y1 >> 1);
@@ -1571,19 +1502,15 @@
 
 void SimonEngine::vc52_playSound() {
 	uint16 sound_id = vc_read_next_word();
-
-	if (_game == GAME_FEEBLEFILES) {
-		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) {
+ 
+	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);
@@ -1625,16 +1552,17 @@
 }
 
 void SimonEngine::vc56_delay() {
-	if (_game & GF_SIMON2) {
-		uint num = vc_read_var_or_word() * _frameRate;
+	uint num = vc_read_var_or_word() * _frameRate;
 
-		add_vga_timer(num + VGA_DELAY_BASE, _vcPtr, _vgaCurSpriteId, _vgaCurFileId);
-		_vcPtr = (byte *)&_vc_get_out_of_code;
-	}
+	add_vga_timer(num + VGA_DELAY_BASE, _vcPtr, _vgaCurSpriteId, _vgaCurFileId);
+	_vcPtr = (byte *)&_vc_get_out_of_code;
 }
 
 void SimonEngine::vc59() {
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON1) {
+		if (!_sound->isVoiceActive())
+			vc_skip_next_instruction();
+	} else {
 		uint file = vc_read_next_word();
 		uint start = vc_read_next_word();
 		uint end = vc_read_next_word() + 1;
@@ -1642,9 +1570,6 @@
 		do {
 			vc_kill_sprite(file, start);
 		} while (++start != end);
-	} else {
-		if (!_sound->isVoiceActive())
-			vc_skip_next_instruction();
 	}
 }
 
@@ -1688,7 +1613,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++;
@@ -1704,7 +1629,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;
 			}
@@ -1720,7 +1645,7 @@
 void SimonEngine::vc60_killSprite() {
 	uint file;
 
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		file = vc_read_next_word();
 	} else {
 		file = _vgaCurFileId;
@@ -1762,7 +1687,7 @@
 			delay(5);
 		}
 
-		if (_game & GF_SIMON1) {
+		if (getGameType() == GType_SIMON1) {
 			uint16 params[5];						/* parameters to vc10_draw */
 			VgaSprite *vsp;
 			VgaPointersEntry *vpe;
@@ -1770,7 +1695,7 @@
 
 			vsp = _vgaSprites;
 			while (vsp->id != 0) {
-				if (vsp->id == 0x80) {
+				if (vsp->id == 128) {
 					byte *old_file_1 = _curVgaFile1;
 					byte *old_file_2 = _curVgaFile2;
 					uint palmode = _windowNum;
@@ -1800,12 +1725,13 @@
 
 		// 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
+		} else {
 			dx_clear_surfaces(_windowNum == 4 ? 134 : 200);
+		}
 	}
-	if (_game & GF_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		if (_nextMusicToPlay != -1)
 			loadMusic(_nextMusicToPlay);
 	}
@@ -1821,13 +1747,11 @@
 }
 
 void SimonEngine::vc64_skipIfSpeechEnded() {
-	// Simon2
-	if (!_sound->isVoiceActive() || (_subtitles && _language != 20))
+	if (!_sound->isVoiceActive() || (_subtitles && _language != Common::HB_ISR))
 		vc_skip_next_instruction();
 }
 
 void SimonEngine::vc65_slowFadeIn() {
-	// Simon2
 	_paletteColorCount = 624;
 	_videoNumPalColors = 208;
 	if (_windowNum != 4) {
@@ -1839,7 +1763,6 @@
 }
 
 void SimonEngine::vc66_skipIfNotEqual() {
-	// Simon2
 	uint a = vc_read_next_word();
 	uint b = vc_read_next_word();
 
@@ -1848,7 +1771,6 @@
 }
 
 void SimonEngine::vc67_skipIfGE() {
-	// Simon2
 	uint a = vc_read_next_word();
 	uint b = vc_read_next_word();
 
@@ -1857,7 +1779,6 @@
 }
 
 void SimonEngine::vc68_skipIfLE() {
-	// Simon2
 	uint a = vc_read_next_word();
 	uint b = vc_read_next_word();
 
@@ -1866,7 +1787,6 @@
 }
 
 void SimonEngine::vc69_playTrack() {
-	// Simon2
 	int16 track = vc_read_next_word();
 	int16 loop = vc_read_next_word();
 
@@ -1890,7 +1810,6 @@
 }
 
 void SimonEngine::vc70_queueMusic() {
-	// Simon2
 	uint16 track = vc_read_next_word();
 	uint16 loop = vc_read_next_word();
 
@@ -1906,7 +1825,6 @@
 }
 
 void SimonEngine::vc71_checkMusicQueue() {
-	// Simon2
 	// Jamieson630:
 	// This command skips the next instruction
 	// unless (1) there is a track playing, AND
@@ -1916,7 +1834,6 @@
 }
 
 void SimonEngine::vc72_play_track_2() {
-	// Simon2
 	// Jamieson630:
 	// This is a "play or stop track". Note that
 	// this opcode looks very similar in function
@@ -1942,85 +1859,13 @@
 }
 
 void SimonEngine::vc73_setMark() {
-	// Simon2
 	vc_read_next_byte();
 	_marks |= 1 << vc_read_next_byte();
 }
 
 void SimonEngine::vc74_clearMark() {
-	// Simon2
 	vc_read_next_byte();
 	_marks &= ~(1 << vc_read_next_byte());
 }
 
-void SimonEngine::vc75_setScale() {
-	// Set scale
-	int baseY = vc_read_next_word();
-	int scale = vc_read_next_word();
-	debug(0, "STUB: vc75_setScale: baseY %d scale %d", baseY, scale);
-}
-
-void SimonEngine::vc76_setScaleXOffs() {
-	// Scale X related
-	int image = vc_read_next_word();
-	int xoffs = vc_read_next_word();
-	int var = vc_read_next_word();
-	debug(0, "STUB: vc76_setScaleXOffs: image %d xoffs %d flag %d", image, xoffs, var);
-}
-
-void SimonEngine::vc77_setScaleYOffs() {
-	// Scale Y related
-	int image = vc_read_next_word();
-	int yoffs = vc_read_next_word();
-	int var = vc_read_next_word();
-	debug(0, "STUB: vc77_setScaleYOffs: image %d yoffs %d flag %d", image, yoffs, var);
-}
-
-void SimonEngine::vc78_pathUnk1() {
-	// Pathfinder related
-	debug(0, "STUB: vc78_pathUnk1");
-}
-
-void SimonEngine::vc79_pathUnk2() {
-	// Pathfinder related
-	debug(0, "STUB: vc79_pathUnk2");
-}
-
-void SimonEngine::vc80_setOverlayImage() {
-	VgaSprite *vsp = find_cur_sprite();
-
-	vsp->image = vc_read_var_or_word();
-
-	vsp->x += vc_read_next_word();
-	vsp->y += vc_read_next_word();
-	vsp->flags = 0x10;
-
-	_vgaSpriteChanged++;
-}
-
-void SimonEngine::vc81_setRandom() {
-	uint var = vc_read_next_word();
-	uint value = vc_read_next_word();
-	writeVariable(var, _rnd.getRandomNumber(value - 1));
-}
-
-void SimonEngine::vc82_pathUnk3() {
-	// Set var to path position
-	int var = vc_read_next_word();
-	debug(0, "STUB: vc82_pathUnk3: var %d", var);
-}
-
-void SimonEngine::vc83_playSoundLoop() {
-	// Start looping sound effect
-	int snd = vc_read_next_word();
-	int vol = vc_read_next_word();
-	int pan = vc_read_next_word();
-	debug(0, "STUB: vc83_playSoundLoop: snd %d vol %d pan %d", snd, vol, pan);
-}
-
-void SimonEngine::vc84_stopSoundLoop() {
-	// Stop looping sound effect
-	debug(0, "STUB: vc84_stopSoundLoop");
-}
-
 } // End of namespace Simon

Index: vga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.h,v
retrieving revision 1.13.2.2
retrieving revision 1.13.2.3
diff -u -d -r1.13.2.2 -r1.13.2.3
--- vga.h	18 Jan 2006 18:07:35 -0000	1.13.2.2
+++ vga.h	26 Jan 2006 03:35:21 -0000	1.13.2.3
@@ -28,37 +28,6 @@
 	#pragma START_PACK_STRUCTS
 #endif
 
-// Feeble Files
-struct VgaFileHeader_Feeble {
-	uint16 x_1;
-	uint16 hdr2_start;
-	uint16 x_2, x_3;
-} GCC_PACK;
-
-struct VgaFileHeader2_Feeble {
-	uint16 imageCount;
-	uint16 x_2;
-	uint16 animationCount;
-	uint16 x_3;
-	uint16 imageTable;
-	uint16 x_4;
-	uint16 animationTable;
-	uint16 x_5;
-} GCC_PACK;
-
-struct ImageHeader_Feeble {
-	uint16 id;
-	uint16 x_1;
-	uint16 scriptOffs;
-	uint16 x_2;
-} GCC_PACK;
-
-struct AnimationHeader_Feeble {
-	uint16 scriptOffs;
-	uint16 x_2;
-	uint16 id;
-} GCC_PACK;
-
 // Simon 1/2
 struct VgaFileHeader_Simon {
 	uint16 x_1, x_2;





More information about the Scummvm-git-logs mailing list