[Scummvm-cvs-logs] SF.net SVN: scummvm: [32804] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Thu Jun 26 19:29:21 CEST 2008


Revision: 32804
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32804&view=rev
Author:   buddha_
Date:     2008-06-26 10:29:21 -0700 (Thu, 26 Jun 2008)

Log Message:
-----------
Fixed opcode:
- 0x83: o2_isSeqRunning (Should it be named o2_isSeqNotRunning?)
-- Added previously missing test part
-- Negated the result (It was backwards before!)

Modified Paths:
--------------
    scummvm/trunk/engines/cine/script_os.cpp
    scummvm/trunk/engines/cine/various.cpp
    scummvm/trunk/engines/cine/various.h

Modified: scummvm/trunk/engines/cine/script_os.cpp
===================================================================
--- scummvm/trunk/engines/cine/script_os.cpp	2008-06-26 16:51:02 UTC (rev 32803)
+++ scummvm/trunk/engines/cine/script_os.cpp	2008-06-26 17:29:21 UTC (rev 32804)
@@ -462,11 +462,13 @@
 	return 0;
 }
 
+/*! \todo Check whether this opcode's name is backwards (i.e. should it be o2_isSeqNotRunning?)
+ */
 int FWScript::o2_isSeqRunning() {
 	byte a = getNextByte();
 	byte b = getNextByte();
 
-	debugC(5, kCineDebugScript, "Line: %d: OP83(%d,%d) -> TODO", _line, a, b);
+	debugC(5, kCineDebugScript, "Line: %d: o2_isSeqRunning(%d,%d)", _line, a, b);
 
 	if (isSeqRunning(a, 0, b)) {
 		_compare = 1;

Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2008-06-26 16:51:02 UTC (rev 32803)
+++ scummvm/trunk/engines/cine/various.cpp	2008-06-26 17:29:21 UTC (rev 32804)
@@ -1586,16 +1586,19 @@
 	}
 }
 
-uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3) {
+bool isSeqRunning(uint16 param1, uint16 param2, uint16 param3) {
 	Common::List<SeqListElement>::iterator it;
 
 	for (it = seqList.begin(); it != seqList.end(); ++it) {
 		if (it->objIdx == param1 && it->var4 == param2 && it->varE == param3) {
-			return 1;
+			// Just to be on the safe side there's a restriction of the
+			// addition's result to 16-bit arithmetic here like in the
+			// original. It's possible that it's not strictly needed.
+			return ((it->var14 + it->var16) & 0xFFFF) == 0;
 		}
 	}
 
-	return 0;
+	return true;
 }
 
 void addSeqListElement(uint16 objIdx, int16 param1, int16 param2, int16 frame, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8) {

Modified: scummvm/trunk/engines/cine/various.h
===================================================================
--- scummvm/trunk/engines/cine/various.h	2008-06-26 16:51:02 UTC (rev 32803)
+++ scummvm/trunk/engines/cine/various.h	2008-06-26 17:29:21 UTC (rev 32804)
@@ -137,7 +137,7 @@
 void removeMessages();
 
 void removeSeq(uint16 param1, uint16 param2, uint16 param3);
-uint16 isSeqRunning(uint16 param1, uint16 param2, uint16 param3);
+bool isSeqRunning(uint16 param1, uint16 param2, uint16 param3);
 void addSeqListElement(uint16 objIdx, int16 param1, int16 param2, int16 frame, int16 param4, int16 param5, int16 param6, int16 param7, int16 param8);
 void modifySeqListElement(uint16 objIdx, int16 var4Test, int16 param1, int16 param2, int16 param3, int16 param4);
 void processSeqList(void);


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