[Scummvm-cvs-logs] CVS: scummvm/saga actor.cpp,1.173,1.174 sthread.cpp,1.101,1.102

Eugene Sandulenko sev at users.sourceforge.net
Wed Aug 10 12:14:15 CEST 2005


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

Modified Files:
	actor.cpp sthread.cpp 
Log Message:
More IHNM fixes. Now it tries to start Ellen part but crashes at invalid
opcode because it tries to execute string data.


Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/actor.cpp,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -d -r1.173 -r1.174
--- actor.cpp	10 Aug 2005 18:27:16 -0000	1.173
+++ actor.cpp	10 Aug 2005 19:12:09 -0000	1.174
@@ -892,13 +892,16 @@
 ActorFrameRange *Actor::getActorFrameRange(uint16 actorId, int frameType) {
 	ActorData *actor;
 	int fourDirection;
+	static ActorFrameRange def = {0, 0};
 
 	actor = getActor(actorId);
 	if (actor->_disabled)
 		error("Actor::getActorFrameRange Wrong actorId 0x%X", actorId);
 
-	if (frameType >= actor->_framesCount)
-		error("Actor::getActorFrameRange Wrong frameType 0x%X (%d) actorId 0x%X", frameType, actor->_framesCount, actorId);
+	if (frameType >= actor->_framesCount) {
+		warning("Actor::getActorFrameRange Wrong frameType 0x%X (%d) actorId 0x%X", frameType, actor->_framesCount, actorId);
+		return &def;
+	}
 
 	if ((actor->_facingDirection < kDirUp) || (actor->_facingDirection > kDirUpLeft))
 		error("Actor::getActorFrameRange Wrong direction 0x%X actorId 0x%X", actor->_facingDirection, actorId);

Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- sthread.cpp	10 Aug 2005 14:53:17 -0000	1.101
+++ sthread.cpp	10 Aug 2005 19:12:10 -0000	1.102
@@ -228,17 +228,17 @@
 #define CASEOP(opName)	case opName:												\
 							if (operandChar == opName) {							\
 								operandName = #opName;								\
-								debug(8, operandName);								\
+								debug(2, operandName);								\
 								_vm->_console->DebugPrintf("%s\n", operandName);	\
 							}
 
-//		debug(8, "Executing thread offset: %lu (%x) stack: %d", thread->_instructionOffset, operandChar, thread->pushedSize());
+		debug(8, "Executing thread offset: %lu (%x) stack: %d", thread->_instructionOffset, operandChar, thread->pushedSize());
 		operandName="";
 		switch (operandChar) {
 		CASEOP(opNextBlock)
 			// Some sort of "jump to the start of the next memory
 			// page" instruction, I think.
-			thread->_instructionOffset = 1024 * ((thread->_instructionOffset / 1024) + 1);
+			thread->_instructionOffset = (((thread->_instructionOffset) >> 10) + 1) << 10;
 			break;
 
 // STACK INSTRUCTIONS
@@ -615,6 +615,9 @@
 				int16 first;
 				const char *strings[ACTOR_SPEECH_STRING_MAX];
 
+				if (_vm->getGameType() == GType_IHNM)
+					break;
+
 				if (_vm->_actor->isSpeaking()) {
 					thread->wait(kWaitTypeSpeech);
 					return false;





More information about the Scummvm-git-logs mailing list