[Scummvm-cvs-logs] CVS: scummvm/scumm script.cpp,1.118,1.119 scummvm.cpp,2.261,2.262 sound.cpp,1.152,1.153

Max Horn fingolfin at users.sourceforge.net
Fri Jul 4 05:35:07 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv15537

Modified Files:
	script.cpp scummvm.cpp sound.cpp 
Log Message:
added some very limited support for Mac Loom (text is now properly centered around x:160 instead of x:0); added (commented out) copyprot bypass (but since I am not sure if there was ever a Mac Loom w/o codes, am not sure if this ever should be enabled); added comment regarding the Mac Loom sound format

Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- script.cpp	25 Jun 2003 23:25:51 -0000	1.118
+++ script.cpp	4 Jul 2003 12:34:09 -0000	1.119
@@ -129,31 +129,6 @@
 		for (i = 0; i < 16; i++)
 			vm.localvar[slot][i] = vars[i];
 	}
-
-#if defined(BYPASS_COPY_PROT) && 0
-	// Loom will set bit 15 of variable 214 to 1 if the user enters the
-	// wrong code. But this bit is also used later in the game to determine
-	// if the user has already learned the fourth note. Therefore any
-	// interfering directly with this variable may be risky.
-	//
-	// Let's try an alternative solution instead. The correct code is
-	// stored in variables 82-85. Each time the user selects a symbol,
-	// its ID (0-11) is passed to room-69-203 as local variable 0. Variable
-	// 98 is 1, 2, 3 or 4 depending on how many symbols the player has
-	// selected yet.
-	//
-	// If the sum of variables 82-85 is 0, the "fail" bit will be set,
-	// regardless of the player's choice. I don't know why, but it does
-	// mean that it's safer to change local variable 0 than to change
-	// variables 82-85.
-	//
-	// Update: It has since occured to me that bit 15 could be set to
-	// indicate that the game is running in "demo" mode. In that case, this
-	// bypassing mechanism is needlessly complicated after all, and we
-	// could just make every read of that bit return zero.
-	if (_gameId == GID_LOOM && _currentRoom == 69 && vm.slot[slot].number == 203)
-		vm.localvar[slot][0] = _scummVars[81 + _scummVars[98]];
-#endif
 }
 
 int Scumm::getVerbEntrypoint(int obj, int entry) {
@@ -521,7 +496,8 @@
 			// during the game...
 			if (_gameId == GID_INDY3 && var == 94 && bit == 4) {
 				return 0;
-			} else if (_gameId == GID_LOOM && var == 214 && bit == 15) {
+//			} else if (_gameId == GID_LOOM && var == 221 && bit == 14) {	// For Mac Loom
+			} else if (_gameId == GID_LOOM && var == 214 && bit == 15) {	// For PC Loom
 				return 0;
 			} else if (_gameId == GID_ZAK256 && var == 151 && bit == 8) {
 				return 0;

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.261
retrieving revision 2.262
diff -u -d -r2.261 -r2.262
--- scummvm.cpp	3 Jul 2003 01:24:50 -0000	2.261
+++ scummvm.cpp	4 Jul 2003 12:34:09 -0000	2.262
@@ -959,7 +959,12 @@
 			VAR(VAR_V6_EMSSPACE) = 10000;
 
 		VAR(VAR_59) = 3;
-
+	}
+	
+	if (_gameId == GID_LOOM) {
+		// This is the for the Mac version of Loom. TODO: add code to properly
+		// distinguish the Mac version from the PC (and other) versions.
+		VAR(39) = 320;
 	}
 
 	if (!(_features & GF_NEW_OPCODES)) {
@@ -1036,7 +1041,11 @@
 		VAR(VAR_VIRT_MOUSE_Y) = _virtualMouse.y;
 		VAR(VAR_MOUSE_X) = _mouse.x;
 		VAR(VAR_MOUSE_Y) = _mouse.y;
-		VAR(VAR_DEBUGMODE) = _debugMode;
+		if (_gameId != GID_LOOM) {
+			// This is the for the Mac version of Loom. TODO: add code to properly
+			// distinguish the Mac version from the PC (and other) versions.
+			VAR(VAR_DEBUGMODE) = _debugMode;
+		}
 	}
 
 	if (_features & GF_AUDIOTRACKS) {
@@ -2501,7 +2510,11 @@
 		if (_version < 7)
 			VAR(VAR_VERSION) = 21;
 	
-		VAR(VAR_DEBUGMODE) = _debugMode;
+		if (_gameId != GID_LOOM) {
+			// This is the for the Mac version of Loom. TODO: add code to properly
+			// distinguish the Mac version from the PC (and other) versions.
+			VAR(VAR_DEBUGMODE) = _debugMode;
+		}
 	}
 
 	if (_gameId == GID_MONKEY || _gameId == GID_MONKEY_SEGA)

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- sound.cpp	2 Jul 2003 11:04:48 -0000	1.152
+++ sound.cpp	4 Jul 2003 12:34:09 -0000	1.153
@@ -407,14 +407,39 @@
 	
 	}
 	
+	if (_scumm->_gameId = GID_LOOM && (READ_LE_UINT16(ptr + 4) == 'so')) {
+		// Mac version of Loom uses yet another sound format
+		/*
+		playSound #9 (room 70)
+		000000: 55 00 00 45  73 6f 00 64  01 00 00 00  00 00 00 00   |U..Eso.d........|
+		000010: 00 05 00 8e  2a 8f 2d 1c  2a 8f 2a 8f  2d 1c 00 28   |....*.-.*.*.-..(|
+		000020: 00 31 00 3a  00 43 00 4c  00 01 00 00  00 01 00 64   |.1.:.C.L.......d|
+		000030: 5a 00 01 00  00 00 01 00  64 00 00 01  00 00 00 01   |Z.......d.......|
+		000040: 00 64 5a 00  01 00 00 00  01 00 64 5a  00 01 00 00   |.dZ.......dZ....|
+		000050: 00 01 00 64  00 00 00 00  00 00 00 07  00 00 00 64   |...d...........d|
+		000060: 64 00 00 4e  73 6f 00 64  01 00 00 00  00 00 00 00   |d..Nso.d........|
+		000070: 00 05 00 89  3d 57 2d 1c  3d 57 3d 57  2d 1c 00 28   |....=W-.=W=W-..(|
+		playSound #16 (room 69)
+		000000: dc 00 00 a5  73 6f 00 64  01 00 00 00  00 00 00 00   |....so.d........|
+		000010: 00 05 00 00  2a 8f 03 e8  03 e8 03 e8  03 e8 00 28   |....*..........(|
+		000020: 00 79 00 7f  00 85 00 d6  00 01 00 00  00 19 01 18   |.y..............|
+		000030: 2f 00 18 00  01 18 32 00  18 00 01 18  36 00 18 00   |/.....2.....6...|
+		000040: 01 18 3b 00  18 00 01 18  3e 00 18 00  01 18 42 00   |..;.....>.....B.|
+		000050: 18 00 01 18  47 00 18 00  01 18 4a 00  18 00 01 18   |....G.....J.....|
+		000060: 4e 00 10 00  01 18 53 00  10 00 01 18  56 00 10 00   |N.....S.....V...|
+		000070: 01 18 5a 00  10 00 02 28  5f 00 01 00  00 00 00 00   |..Z....(_.......|
+		*/
+		return;
+	}
+	
 	if (_scumm->_features & GF_OLD_BUNDLE && _scumm->_version != 1) {
-		// FIXME: support amiga sounds
-		uint16 amigatest;
-		amigatest = READ_LE_UINT16(ptr + 12);
 		// other versions seem to be 0000 at this point...
 		// hopefully this test is correct
 		// 0xfe7f seems to be sound and 0x764a music
-		if ((amigatest != 0xfe7f) && (amigatest != 0x764a)) {
+		bool amigatest = (READ_LE_UINT16(ptr + 12) == 0xfe7f) || (READ_LE_UINT16(ptr + 12) == 0x764a);
+		if (amigatest) {
+			// TODO: support amiga sounds
+		} else {
 			if (_scumm->_playerV2)
 				_scumm->_playerV2->startSound (soundID, ptr);
 		}





More information about the Scummvm-git-logs mailing list