[Scummvm-cvs-logs] SF.net SVN: scummvm: [25520] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Mon Feb 12 13:53:29 CET 2007


Revision: 25520
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25520&view=rev
Author:   drmccoy
Date:     2007-02-12 04:53:28 -0800 (Mon, 12 Feb 2007)

Log Message:
-----------
- Some fixes for demos and Amiga versions
- Improved language finding a bit

Modified Paths:
--------------
    scummvm/trunk/engines/gob/detection.cpp
    scummvm/trunk/engines/gob/game.cpp
    scummvm/trunk/engines/gob/game_v1.cpp
    scummvm/trunk/engines/gob/game_v2.cpp
    scummvm/trunk/engines/gob/global.cpp
    scummvm/trunk/engines/gob/global.h
    scummvm/trunk/engines/gob/gob.cpp
    scummvm/trunk/engines/gob/init.cpp
    scummvm/trunk/engines/gob/inter.h
    scummvm/trunk/engines/gob/inter_v2.cpp
    scummvm/trunk/engines/gob/video_v2.cpp

Modified: scummvm/trunk/engines/gob/detection.cpp
===================================================================
--- scummvm/trunk/engines/gob/detection.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/detection.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -54,8 +54,8 @@
 	{"gob3cd", "Goblins Quest 3 CD"},
 	{"gob3-demo", "Goblins Quest 3 Demo"},
 	{"bargon", "Bargon Attack"},
-	{"ween", "Ween: The Prohpecy"},
-	{"ween-demo", "Ween: The Prohpecy Demo"},
+	{"ween", "Ween: The Prophecy"},
+	{"ween-demo", "Ween: The Prophecy Demo"},
 	{"woodruff", "The Bizarre Adventures of Woodruff and the Schnibble"},
 	{0, 0}
 };
@@ -529,7 +529,7 @@
 			"ween",
 			"",
 			AD_ENTRY1("intro.stk", "2bb8878a8042244dd2b96ff682381baa"),
-			UNK_LANG,
+			EN_GRB,
 			kPlatformPC,
 		},
 		GF_GOB2,
@@ -550,6 +550,17 @@
 		{
 			"ween",
 			"",
+			AD_ENTRY1("intro.stk", "257fe669705ac4971efdfd5656eef16a"),
+			FR_FRA,
+			kPlatformAmiga,
+		},
+		GF_GOB2,
+		"intro"
+	},
+	{
+		{
+			"ween",
+			"",
 			AD_ENTRY1("intro.stk", "4b10525a3782aa7ecd9d833b5c1d308b"),
 			FR_FRA,
 			kPlatformPC,
@@ -581,6 +592,17 @@
 	},
 	{
 		{
+			"ween-demo",
+			"",
+			AD_ENTRY1("intro.stk", "15fb91a1b9b09684b28ac75edf66e504"),
+			EN_USA,
+			kPlatformPC,
+		},
+		GF_GOB2,
+		"show"
+	},
+	{
+		{
 			"bargon",
 			"",
 			AD_ENTRY1("intro.stk", "da3c54be18ab73fbdb32db24624a9c23"),

Modified: scummvm/trunk/engines/gob/game.cpp
===================================================================
--- scummvm/trunk/engines/gob/game.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/game.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -690,6 +690,7 @@
 }
 
 char *Game::loadLocTexts(void) {
+	static bool found = false;
 	char locTextFile[20];
 	int16 handle;
 	int i;
@@ -697,18 +698,20 @@
 	strcpy(locTextFile, _curTotFile);
 
 	handle = openLocTextFile(locTextFile, _vm->_global->_language);
-	if ((handle < 0) && !scumm_stricmp(_vm->_game->_curTotFile, _vm->_startTot0)) {
-		warning("Your game version doesn't support the requested language, using the first one available");
+	if ((handle < 0) && !found) {
 		for (i = 0; i < 10; i++) {
 			handle = openLocTextFile(locTextFile, i);
 			if (handle >= 0) {
+				warning("Your game version doesn't support the requested language, using the first one available (%d)", i);
 				_vm->_global->_language = i;
+				found = true;
 				break;
 			}
 		}
 	}
 
 	if (handle >= 0) {
+		found = true;
 		_vm->_dataio->closeData(handle);
 		return _vm->_dataio->getData(locTextFile);
 	}

Modified: scummvm/trunk/engines/gob/game_v1.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v1.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/game_v1.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -171,7 +171,7 @@
 
 			_vm->_global->_inter_animDataSize = READ_LE_UINT16((char *)_totFileData + 0x38);
 			if (_vm->_global->_inter_variables == 0) {
-				variablesCount = READ_LE_UINT32((char *)_totFileData + 0x2c);
+				variablesCount = READ_LE_UINT16((char *)_totFileData + 0x2c);
 				_vm->_global->_inter_variables = new char[variablesCount * 4];
 				_vm->_global->_inter_variablesSizes = new byte[variablesCount * 4];
 				_vm->_global->clearVars(variablesCount);

Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/game_v2.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -196,7 +196,7 @@
 
 			_vm->_global->_inter_animDataSize = READ_LE_UINT16((char *)_totFileData + 0x38);
 			if (_vm->_global->_inter_variables == 0) {
-				variablesCount = READ_LE_UINT32((char *)_totFileData + 0x2c);
+				variablesCount = READ_LE_UINT16((char *)_totFileData + 0x2c);
 				_vm->_global->_inter_variables = new char[variablesCount * 4];
 				_vm->_global->_inter_variablesSizes = new byte[variablesCount * 4];
 				_vm->_global->clearVars(variablesCount);
@@ -209,7 +209,7 @@
 
 			WRITE_VAR(13, _vm->_global->_useMouse);
 			WRITE_VAR(14, _vm->_global->_soundFlags);
-			WRITE_VAR(15, _vm->_global->_videoMode);
+			WRITE_VAR(15, _vm->_global->_fakeVideoMode);
 			WRITE_VAR(16, _vm->_global->_language);
 
 			_vm->_inter->callSub(2);

Modified: scummvm/trunk/engines/gob/global.cpp
===================================================================
--- scummvm/trunk/engines/gob/global.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/global.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -35,14 +35,13 @@
 	_presentHER = UNDEF;
 
 	_videoMode = 0;
+	_fakeVideoMode = 0;
 
 	/* Sound */
 	_soundFlags = 0;
 	_blasterPort = 0;
 	_disableSoundCfg = 0;
 
-	//char _playingSound = 0;
-
 	/* Mouse */
 	_disableMouseCfg = 0;
 

Modified: scummvm/trunk/engines/gob/global.h
===================================================================
--- scummvm/trunk/engines/gob/global.h	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/global.h	2007-02-12 12:53:28 UTC (rev 25520)
@@ -77,6 +77,7 @@
 	int16 _presentHER;
 
 	int16 _videoMode;
+	int16 _fakeVideoMode;
 
 	int16 _disableVideoCfg;
 

Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/gob.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -648,6 +648,10 @@
 	_global->_debugFlag = 1;
 	_global->_doRangeClamp = 1;
 
+	// WORKAROUND: Some Amiga versions only play music when the video mode is
+	// Amiga-ish
+	_global->_fakeVideoMode = (_platform == Common::kPlatformAmiga) ? 0x11 : 0x13;
+
 	_global->_videoMode = 0x13;
 	_global->_useMouse = 1;
 	_global->_soundFlags = MIDI_FLAG | SPEAKER_FLAG | BLASTER_FLAG | ADLIB_FLAG;

Modified: scummvm/trunk/engines/gob/init.cpp
===================================================================
--- scummvm/trunk/engines/gob/init.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/init.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -189,8 +189,8 @@
 	if (handle >= 0) {
 		// Get variables count
 		_vm->_dataio->seekData(handle, 0x2c, SEEK_SET);
-		_vm->_dataio->readData(handle, (char *)&varsCount, 4);
-		varsCount = FROM_LE_32(varsCount);
+		_vm->_dataio->readData(handle, (char *)&varsCount, 2);
+		varsCount = FROM_LE_16(varsCount);
 		_vm->_dataio->closeData(handle);
 
 		_vm->_global->_inter_variables = new char[varsCount * 4];

Modified: scummvm/trunk/engines/gob/inter.h
===================================================================
--- scummvm/trunk/engines/gob/inter.h	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/inter.h	2007-02-12 12:53:28 UTC (rev 25520)
@@ -372,6 +372,7 @@
 	void o2_initScreen(void);
 	void o2_setScrollOffset(void);
 	void o2_handleGoblins(int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc);
+	void o2_loadInfogramesIns(int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc);
 	void o2_playInfogrames(int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc);
 };
 

Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/inter_v2.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -45,7 +45,7 @@
 #define OPCODE(x) _OPCODE(Inter_v2, x)
 
 const int Inter_v2::_goblinFuncLookUp[][2] = {
-	{1, 0},
+	{0, 0},
 	{2, 1},
 	{3, 2},
 	{4, 3},
@@ -551,10 +551,10 @@
 
 	static const OpcodeGoblinEntryV2 opcodesGoblin[71] = {
 		/* 00 */
+		OPCODE(o2_loadInfogramesIns),
 		{NULL, ""},
 		{NULL, ""},
 		{NULL, ""},
-		{NULL, ""},
 		/* 04 */
 		{NULL, ""},
 		{NULL, ""},
@@ -1403,6 +1403,10 @@
 	if (((dataVar >> 2) == 59) && (size == 4)) {
 		retSize = _vm->_dataio->readData(handle, tmp, 4);
 		WRITE_VAR(59, READ_LE_UINT32(tmp));
+		// The scripts in some Amiga versions divide through 256^3 then,
+		// effectively doing a LE->BE conversion
+		if ((_vm->_platform == Common::kPlatformAmiga) && (VAR(59) < 256))
+			WRITE_VAR(59, SWAP_BYTES_32(VAR(59)));
 	} else
 		retSize = _vm->_dataio->readData(handle, buf, size);
 
@@ -1737,7 +1741,8 @@
 		break;
 
 	case 52:
-		if ((_vm->_global->_videoMode != 0x0D) || (_vm->_global->_colorCount == 256)) {
+		if ((_vm->_platform != Common::kPlatformAmiga) &&
+				((_vm->_global->_videoMode != 0x0D) || (_vm->_global->_colorCount == 256))) {
 			_vm->_global->_inter_execPtr += 48;
 			return false;
 		}
@@ -1821,12 +1826,11 @@
 
 	case 52:
 		for (i = 0; i < 16; i++, _vm->_global->_inter_execPtr += 3) {
-			_vm->_draw->_vgaSmallPalette[i].red = _vm->_global->_inter_execPtr[0];
-			_vm->_draw->_vgaSmallPalette[i].green = _vm->_global->_inter_execPtr[1];
-			_vm->_draw->_vgaSmallPalette[i].blue = _vm->_global->_inter_execPtr[2];
+			_vm->_draw->_vgaPalette[i].red = _vm->_global->_inter_execPtr[0];
+			_vm->_draw->_vgaPalette[i].green = _vm->_global->_inter_execPtr[1];
+			_vm->_draw->_vgaPalette[i].blue = _vm->_global->_inter_execPtr[2];
 		}
-		_vm->_global->_inter_execPtr += 48;
-		if (_vm->_global->_videoMode >= 0x13)
+		if ((_vm->_platform != Common::kPlatformAmiga) && _vm->_global->_videoMode >= 0x13)
 			return false;
 		break;
 
@@ -2218,6 +2222,12 @@
 	width = _vm->_parse->parseValExpr();
 	height = _vm->_parse->parseValExpr();
 
+	_vm->_global->_fakeVideoMode = videoMode;
+
+	// Some Amiga versions require this
+	if (videoMode == 0xD)
+		videoMode = 0x14;
+
 	if ((videoMode == _vm->_global->_videoMode) && (width == -1))
 		return;
 
@@ -2242,7 +2252,7 @@
 		_vm->_global->_videoMode = videoMode;
 		_vm->_video->initPrimary(videoMode);
 	}
-	WRITE_VAR(15, _vm->_global->_videoMode);
+	WRITE_VAR(15, _vm->_global->_fakeVideoMode);
 
 	_vm->_global->_setAllPalette = 1;
 
@@ -2372,7 +2382,8 @@
 	_vm->_goblin->handleGoblins();
 }
 
-void Inter_v2::o2_playInfogrames(int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc) {
+void Inter_v2::o2_loadInfogramesIns(int16 &extraData, int32 *retVarPtr,
+		Goblin::Gob_Object *objDesc) {
 	int16 varName;
 	char fileName[20];
 
@@ -2382,6 +2393,36 @@
 		return;
 
 	strcpy(fileName, GET_VAR_STR(varName));
+	strcat(fileName, ".INS");
+	debugC(1, kDebugMusic, "Loading Infogrames instrument file \"%s\"", fileName);
+
+	if (_vm->_game->_infogrames) {
+		_vm->_mixer->stopHandle(_vm->_game->_infHandle);
+		_vm->_game->_infogrames = 0;
+	}
+
+	if (_vm->_game->_infIns)
+		delete _vm->_game->_infIns;
+
+	_vm->_game->_infIns = new Audio::Infogrames::Instruments;
+	if (!_vm->_game->_infIns->load(fileName)) {
+		warning("Couldn't load instruments file");
+		delete _vm->_game->_infIns;
+		_vm->_game->_infIns = 0;
+	}
+}
+
+void Inter_v2::o2_playInfogrames(int16 &extraData, int32 *retVarPtr,
+		Goblin::Gob_Object *objDesc) {
+	int16 varName;
+	char fileName[20];
+
+	varName = load16();
+
+	if (_vm->_noMusic)
+		return;
+
+	strcpy(fileName, GET_VAR_STR(varName));
 	strcat(fileName, ".DUM");
 	debugC(1, kDebugMusic, "Playing Infogrames music file \"%s\"", fileName);
 	if (!_vm->_game->_infIns) {

Modified: scummvm/trunk/engines/gob/video_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/video_v2.cpp	2007-02-12 11:35:49 UTC (rev 25519)
+++ scummvm/trunk/engines/gob/video_v2.cpp	2007-02-12 12:53:28 UTC (rev 25520)
@@ -99,6 +99,9 @@
 	int16 someFlags = 1;
 	SurfaceDesc *descPtr;
 
+	if (_vm->_platform == Common::kPlatformAmiga)
+		flags &= ~RETURN_PRIMARY;
+
 	if (flags != PRIMARY_SURFACE)
 		_vm->_global->_sprAllocated++;
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list