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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Thu Jun 24 11:52:08 CEST 2010


Revision: 50207
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50207&view=rev
Author:   thebluegr
Date:     2010-06-24 09:52:08 +0000 (Thu, 24 Jun 2010)

Log Message:
-----------
Initialize the stack with 'S' or 's' characters, like SSCI does (ultimately, we should not change the stack again like we do in op_link - this is what Sierra is doing). Some cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/klists.cpp
    scummvm/trunk/engines/sci/engine/seg_manager.cpp

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-06-24 08:17:46 UTC (rev 50206)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-06-24 09:52:08 UTC (rev 50207)
@@ -540,7 +540,7 @@
 
 	// WORKAROUND for a problem in LSL1VGA. This allows the casino door to be opened,
 	// till the actual problem is found
-	if (g_sci->getGameId() == "lsl1sci" && s->currentRoomNumber() == 300) {
+	if (s->currentRoomNumber() == 300 && g_sci->getGameId() == "lsl1sci") {
 		int top = readSelectorValue(s->_segMan, object, SELECTOR(brTop));
 		writeSelectorValue(s->_segMan, object, SELECTOR(brTop), top + 2);
 	}

Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp	2010-06-24 08:17:46 UTC (rev 50206)
+++ scummvm/trunk/engines/sci/engine/klists.cpp	2010-06-24 09:52:08 UTC (rev 50207)
@@ -115,8 +115,7 @@
 
 reg_t kNewList(EngineState *s, int argc, reg_t *argv) {
 	reg_t listbase;
-	List *l;
-	l = s->_segMan->allocateList(&listbase);
+	List *l = s->_segMan->allocateList(&listbase);
 	l->first = l->last = NULL_REG;
 	debugC(2, kDebugLevelNodes, "New listbase at %04x:%04x", PRINT_REG(listbase));
 

Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp	2010-06-24 08:17:46 UTC (rev 50206)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp	2010-06-24 09:52:08 UTC (rev 50207)
@@ -402,6 +402,12 @@
 	retval->_entries = (reg_t *)calloc(size, sizeof(reg_t));
 	retval->_capacity = size;
 
+	// SSCI initializes the stack with "S" characters (uppercase S in SCI0-SCI1,
+	// lowercase s in SCI0 and SCI11) - probably stands for "stack"
+	byte filler = (getSciVersion() >= SCI_VERSION_01 && getSciVersion() <= SCI_VERSION_1_LATE) ? 'S' : 's';
+	for (int i = 0; i < size; i++)
+		retval->_entries[i] = make_reg(0, filler);
+
 	return retval;
 }
 
@@ -448,7 +454,7 @@
 	HunkTable *ht = (HunkTable *)getSegment(addr.segment, SEG_TYPE_HUNK);
 
 	if (!ht || !ht->isValidEntry(addr.offset)) {
-		warning("getHunkPointer() with invalid handle");
+		warning("getHunkPointer() with invalid handle %04x:%04x", PRINT_REG(addr));
 		return NULL;
 	}
 


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