[Scummvm-git-logs] scummvm master -> dfb183d42fe4b6bba52a76393a61e7b2d12a8ff8

elasota noreply at scummvm.org
Sun May 21 03:15:08 UTC 2023


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
abeed603ce VCRUISE: Fix changeL infinite loop in Schizm.  Add GetDigit opcode.
dfb183d42f VCRUISE: Fix game not starting, for real this time.


Commit: abeed603ce9da5b78e49c92b4537b59ccdb5fd74
    https://github.com/scummvm/scummvm/commit/abeed603ce9da5b78e49c92b4537b59ccdb5fd74
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-20T23:14:19-04:00

Commit Message:
VCRUISE: Fix changeL infinite loop in Schizm.  Add GetDigit opcode.

Changed paths:
    engines/vcruise/runtime.cpp
    engines/vcruise/runtime.h
    engines/vcruise/script.cpp
    engines/vcruise/script.h


diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index ffba76073e3..97fafddf387 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -2167,7 +2167,7 @@ bool Runtime::runScript() {
 			DISPATCH_OP(Mul);
 			DISPATCH_OP(Div);
 			DISPATCH_OP(Mod);
-			DISPATCH_OP(CyfraGet);
+			DISPATCH_OP(GetDigit);
 			DISPATCH_OP(PuzzleInit);
 			DISPATCH_OP(PuzzleCanPress);
 			DISPATCH_OP(PuzzleDoMove1);
@@ -5323,11 +5323,15 @@ void Runtime::scriptOpSAnimL(ScriptArg_t arg) {
 void Runtime::scriptOpChangeL(ScriptArg_t arg) {
 	TAKE_STACK_INT(1);
 
-	// ChangeL changes the screen number, but it also forces screen entry scripts to replay, which is
-	// needed for things like the fountain.
+	// ChangeL changes the screen number.
+	// In Reah, it also forces screen entry scripts to replay, which is needed for things like the fountain.
+	// In Schizm, doing this causes an infinite loop in the temple when approaching the bells puzzle
+	// (Room 65 screen 0b2h) due to fnMlynekZerowanie -> 1 fnMlynkiLokacja -> changeL to MLYNKIZLEWEJ1
 	_screenNumber = stackArgs[0];
 	_havePendingScreenChange = true;
-	_forceScreenChange = true;
+
+	if (_gameID == GID_REAH)
+		_forceScreenChange = true;
 }
 
 void Runtime::scriptOpAnimR(ScriptArg_t arg) {
@@ -7021,7 +7025,22 @@ void Runtime::scriptOpMod(ScriptArg_t arg) {
 	_scriptStack.push_back(StackValue(stackArgs[0] % stackArgs[1]));
 }
 
-OPCODE_STUB(CyfraGet)
+void Runtime::scriptOpGetDigit(ScriptArg_t arg) {
+	TAKE_STACK_INT(2);
+
+	StackInt_t power = stackArgs[1];
+	StackInt_t divisor = 1;
+
+	while (power > 0) {
+		power--;
+		divisor *= 10;
+	}
+
+	StackInt_t digit = (stackArgs[0] / divisor) % 10;
+
+	_scriptStack.push_back(StackValue(digit));
+}
+
 OPCODE_STUB(PuzzleInit)
 OPCODE_STUB(PuzzleCanPress)
 OPCODE_STUB(PuzzleDoMove1)
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index 743d50f3516..501cab947e9 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -1061,7 +1061,7 @@ private:
 	void scriptOpMul(ScriptArg_t arg);
 	void scriptOpDiv(ScriptArg_t arg);
 	void scriptOpMod(ScriptArg_t arg);
-	void scriptOpCyfraGet(ScriptArg_t arg);
+	void scriptOpGetDigit(ScriptArg_t arg);
 	void scriptOpPuzzleInit(ScriptArg_t arg);
 	void scriptOpPuzzleCanPress(ScriptArg_t arg);
 	void scriptOpPuzzleDoMove1(ScriptArg_t arg);
diff --git a/engines/vcruise/script.cpp b/engines/vcruise/script.cpp
index 54a50f9fa04..326bec2002c 100644
--- a/engines/vcruise/script.cpp
+++ b/engines/vcruise/script.cpp
@@ -764,7 +764,7 @@ static ScriptNamedInstruction g_schizmNamedInstructions[] = {
 	{"ItemPlace@", ProtoOp::kProtoOpScript, ScriptOps::kItemHaveSpace},
 	{"ItemPutInto!", ProtoOp::kProtoOpScript, ScriptOps::kItemAdd},
 	{"ItemRemove!", ProtoOp::kProtoOpScript, ScriptOps::kItemRemove},
-	{"cyfra@", ProtoOp::kProtoOpScript, ScriptOps::kCyfraGet},
+	{"cyfra@", ProtoOp::kProtoOpScript, ScriptOps::kGetDigit},	// Cyfra = digit
 	{"puzzleInit", ProtoOp::kProtoOpScript, ScriptOps::kPuzzleInit},
 	{"puzzleCanPress", ProtoOp::kProtoOpScript, ScriptOps::kPuzzleCanPress},
 	{"puzzleDoMove1", ProtoOp::kProtoOpScript, ScriptOps::kPuzzleDoMove1},
diff --git a/engines/vcruise/script.h b/engines/vcruise/script.h
index e146dc77caf..2d62ec015ba 100644
--- a/engines/vcruise/script.h
+++ b/engines/vcruise/script.h
@@ -208,7 +208,7 @@ enum ScriptOp {
 	kMul,
 	kDiv,
 	kMod,
-	kCyfraGet,	// Cyfra = digit?
+	kGetDigit,
 	kPuzzleInit,
 	kPuzzleCanPress,
 	kPuzzleDoMove1,


Commit: dfb183d42fe4b6bba52a76393a61e7b2d12a8ff8
    https://github.com/scummvm/scummvm/commit/dfb183d42fe4b6bba52a76393a61e7b2d12a8ff8
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-20T23:14:19-04:00

Commit Message:
VCRUISE: Fix game not starting, for real this time.

Changed paths:
    engines/vcruise/runtime.cpp


diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 97fafddf387..c004fed741e 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -2636,7 +2636,7 @@ void Runtime::loadAllSchizmScreenNames() {
 
 		// Rooms 1 and 3 are always compiled.  2 is a cheat room that contains garbage.  We still need to compile room 1
 		// to get the START screen to start the game though.
-		if (roomNumber > 3 && roomNumber != 1)
+		if (roomNumber > 3 || roomNumber == 1)
 			roomsToCompile.push_back(roomNumber);
 	}
 




More information about the Scummvm-git-logs mailing list