[Scummvm-cvs-logs] CVS: scummvm/scumm script_v2.cpp,2.152,2.153

Jochen Hoenicke hoenicke at users.sourceforge.net
Mon Jul 14 12:57:24 CEST 2003


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

Modified Files:
	script_v2.cpp 
Log Message:
Compares in V2 are unsigned (at least in Zak).
This fixes a problem with the parachute scene in Zak.


Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.152
retrieving revision 2.153
diff -u -d -r2.152 -r2.153
--- script_v2.cpp	14 Jul 2003 18:20:20 -0000	2.152
+++ script_v2.cpp	14 Jul 2003 19:56:56 -0000	2.153
@@ -38,7 +38,7 @@
 		OPCODE(o5_startMusic),
 		OPCODE(o5_getActorRoom),
 		/* 04 */
-		OPCODE(o5_isGreaterEqual),
+		OPCODE(o2_isGreaterEqual),
 		OPCODE(o2_drawObject),
 		OPCODE(o2_getActorElevation),
 		OPCODE(o2_setState08),
@@ -103,7 +103,7 @@
 		OPCODE(o2_walkActorToObject),
 		OPCODE(o2_setState01),
 		/* 38 */
-		OPCODE(o5_lessOrEqual),
+		OPCODE(o2_isLessEqual),
 		OPCODE(o2_doSentence),
 		OPCODE(o2_subtract),
 		OPCODE(o2_waitForActor),
@@ -118,7 +118,7 @@
 		OPCODE(o2_startScript),
 		OPCODE(o2_getActorX),
 		/* 44 */
-		OPCODE(o5_isLess),
+		OPCODE(o2_isLess),
 		OPCODE(o2_drawObject),
 		OPCODE(o5_increment),
 		OPCODE(o2_clearState08),
@@ -183,7 +183,7 @@
 		OPCODE(o2_walkActorToObject),
 		OPCODE(o2_clearState01),
 		/* 78 */
-		OPCODE(o5_isGreater),
+		OPCODE(o2_isGreater),
 		OPCODE(o2_doSentence),
 		OPCODE(o2_verbOps),
 		OPCODE(o2_getActorWalkBox),
@@ -198,7 +198,7 @@
 		OPCODE(o5_startMusic),
 		OPCODE(o5_getActorRoom),
 		/* 84 */
-		OPCODE(o5_isGreaterEqual),
+		OPCODE(o2_isGreaterEqual),
 		OPCODE(o2_drawObject),
 		OPCODE(o2_getActorElevation),
 		OPCODE(o2_setState08),
@@ -263,7 +263,7 @@
 		OPCODE(o2_walkActorToObject),
 		OPCODE(o2_setState01),
 		/* B8 */
-		OPCODE(o5_lessOrEqual),
+		OPCODE(o2_isLessEqual),
 		OPCODE(o2_doSentence),
 		OPCODE(o2_subtract),
 		OPCODE(o2_waitForActor),
@@ -278,7 +278,7 @@
 		OPCODE(o2_startScript),
 		OPCODE(o2_getActorX),
 		/* C4 */
-		OPCODE(o5_isLess),
+		OPCODE(o2_isLess),
 		OPCODE(o2_drawObject),
 		OPCODE(o5_decrement),
 		OPCODE(o2_clearState08),
@@ -343,7 +343,7 @@
 		OPCODE(o2_walkActorToObject),
 		OPCODE(o2_clearState01),
 		/* F8 */
-		OPCODE(o5_isGreater),
+		OPCODE(o2_isGreater),
 		OPCODE(o2_doSentence),
 		OPCODE(o2_verbOps),
 		OPCODE(o2_getActorWalkBox),
@@ -1140,6 +1140,43 @@
 
 	a = getVarOrDirectByte(0x80);
 	setResult(getObjY(a) / 2);
+}
+
+void Scumm_v2::o2_isGreater() {
+	uint16 a = getVar();
+	uint16 b = getVarOrDirectWord(0x80);
+	if (b > a)
+		ignoreScriptWord();
+	else
+		o5_jumpRelative();
+}
+
+void Scumm_v2::o2_isGreaterEqual() {
+	uint16 a = getVar();
+	uint16 b = getVarOrDirectWord(0x80);
+	if (b >= a)
+		ignoreScriptWord();
+	else
+		o5_jumpRelative();
+}
+
+void Scumm_v2::o2_isLess() {
+	uint16 a = getVar();
+	uint16 b = getVarOrDirectWord(0x80);
+
+	if (b < a)
+		ignoreScriptWord();
+	else
+		o5_jumpRelative();
+}
+
+void Scumm_v2::o2_isLessEqual() {
+	uint16 a = getVar();
+	uint16 b = getVarOrDirectWord(0x80);
+	if (b <= a)
+		ignoreScriptWord();
+	else
+		o5_jumpRelative();
 }
 
 void Scumm_v2::o2_loadRoomWithEgo() {





More information about the Scummvm-git-logs mailing list