[Scummvm-cvs-logs] SF.net SVN: scummvm:[39876] scummvm/trunk/engines/sci/engine/kstring.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Apr 6 19:13:08 CEST 2009


Revision: 39876
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39876&view=rev
Author:   thebluegr
Date:     2009-04-06 17:13:07 +0000 (Mon, 06 Apr 2009)

Log Message:
-----------
Fixed an issue with the password screen in LSL5 and kStrAt(). The game password, saved in file memory.drv (which can either exist in the game directory, or is created in the saves folder by ScummVM) is now working correctly, and the game can be started. Note that it's NOT currently possible not to set a password (you'll get the password screen anyway the next time, and it won't work).

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kstring.cpp

Modified: scummvm/trunk/engines/sci/engine/kstring.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kstring.cpp	2009-04-06 17:09:02 UTC (rev 39875)
+++ scummvm/trunk/engines/sci/engine/kstring.cpp	2009-04-06 17:13:07 UTC (rev 39876)
@@ -420,12 +420,21 @@
 		return NULL_REG;
 	}
 
+	bool lsl5PasswordWorkaround = false;
+	// LSL5 stores the password at the beginning in memory.drv, using XOR encryption,
+	// which means that is_print_str() will fail. Therefore, do not use the heuristic to determine
+	// if we're handling a string or an array for LSL5's password screen (room 155)
+	// FIXME: implement function to get current room number
+	if (s->_gameName.equalsIgnoreCase("lsl5") && (KP_UINT(s->script_000->locals_block->locals[13]) == 155))
+		lsl5PasswordWorkaround = true;
+
+	const char* dst = (const char *)dest; // used just for code beautification purposes
+
 	if ((argc == 2) &&
 	        /* Our pathfinder already works around the issue we're trying to fix */
-	        (strcmp(s->seg_manager->getDescription(argv[0]), AVOIDPATH_DYNMEM_STRING) != 0)  &&
-	        ((strlen((const char*)dest) < 2) || (!is_print_str((const char*)dest))))
-		/* SQ4 array handling detected */
-	{
+	        (strcmp(s->seg_manager->getDescription(argv[0]), AVOIDPATH_DYNMEM_STRING) != 0) &&
+	        ((strlen(dst) < 2) || (!lsl5PasswordWorkaround && !is_print_str(dst)))) {
+		// SQ4 array handling detected
 #ifndef SCUMM_BIG_ENDIAN
 		int odd = KP_UINT(argv[1]) & 1;
 #else


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