[Scummvm-git-logs] scummvm master -> 311b13ecb47cf4c452f0bfdbebefd4402bd7ac3d

neuromancer noreply at scummvm.org
Sat Apr 22 20:44:44 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:
df938612e8 FREESCAPE: attempt to fix effect execution when stepping up
311b13ecb4 FREESCAPE: some fixes in the parsing of fcl opcodes


Commit: df938612e8764cecb03b35fca86ce42ed016ac1f
    https://github.com/scummvm/scummvm/commit/df938612e8764cecb03b35fca86ce42ed016ac1f
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-04-22T22:46:28+02:00

Commit Message:
FREESCAPE: attempt to fix effect execution when stepping up

Changed paths:
    engines/freescape/movement.cpp


diff --git a/engines/freescape/movement.cpp b/engines/freescape/movement.cpp
index f914780359e..aa432f1e3ee 100644
--- a/engines/freescape/movement.cpp
+++ b/engines/freescape/movement.cpp
@@ -260,6 +260,19 @@ void FreescapeEngine::move(CameraMovement direction, uint8 scale, float deltaTim
 				if (stepUp) {
 					if (!isPlayingSound())
 						playSound(4, false);
+
+					positionY = _position.y();
+					int fallen;
+					for (fallen = 1; fallen < 64; fallen++) {
+						_position.set(_position.x(), positionY - fallen , _position.z());
+						if (tryStepDown(_position))
+							break;
+					}
+					assert(fallen < 64);
+					fallen++;
+					fallen++;
+					_position.set(_position.x(), positionY - fallen, _position.z());
+
 					debugC(1, kFreescapeDebugCode, "Runing effects:");
 					checkCollisions(true); // run the effects (again)
 				} else {
@@ -358,7 +371,7 @@ bool FreescapeEngine::checkCollisions(bool executeCode) {
 		// FIXME: find a better workaround of this
 		if (gobj->getSize().length() > 3000) {
 			if (largeObjectWasBlocking)
-				break;
+				continue;
 			largeObjectWasBlocking = true;
 		}
 


Commit: 311b13ecb47cf4c452f0bfdbebefd4402bd7ac3d
    https://github.com/scummvm/scummvm/commit/311b13ecb47cf4c452f0bfdbebefd4402bd7ac3d
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-04-22T22:46:28+02:00

Commit Message:
FREESCAPE: some fixes in the parsing of fcl opcodes

Changed paths:
    engines/freescape/language/8bitDetokeniser.cpp
    engines/freescape/language/instruction.cpp


diff --git a/engines/freescape/language/8bitDetokeniser.cpp b/engines/freescape/language/8bitDetokeniser.cpp
index c4ac1c47621..1d28314779c 100644
--- a/engines/freescape/language/8bitDetokeniser.cpp
+++ b/engines/freescape/language/8bitDetokeniser.cpp
@@ -77,15 +77,15 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 			FCLInstruction branch;
 			branch = FCLInstruction(oldConditional);
 
-			branch.setBranches(conditionalInstructions, nullptr);
-			instructions.push_back(branch);
-
 			if (bytePointer > 0) {
 				detokenisedStream += "ENDIF\n";
 				// Allocate the next vector of instructions
 				conditionalInstructions = new FCLInstructionVector();
 			}
 
+			branch.setBranches(conditionalInstructions, nullptr);
+			instructions.push_back(branch);
+
 			if (oldConditional == Token::SHOTQ)
 				detokenisedStream += "IF SHOT? THEN\n";
 			else if (oldConditional == Token::TIMERQ)
@@ -124,6 +124,8 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 		case 0:
 			detokenisedStream += "NOP ";
 			currentInstruction = FCLInstruction(Token::NOP);
+			conditionalInstructions->push_back(currentInstruction);
+			currentInstruction = FCLInstruction(Token::UNKNOWN);
 			break; // NOP
 		case 1:    // add three-byte value to score
 		{
@@ -188,6 +190,7 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 
 		case 9:
 			detokenisedStream += "ADDVAR (1, v";
+			detokenisedStream += Common::String::format("%d)", tokenisedCondition[bytePointer]);
 			currentInstruction = FCLInstruction(Token::ADDVAR);
 			currentInstruction.setSource(tokenisedCondition[bytePointer]);
 			currentInstruction.setDestination(1);
@@ -198,6 +201,7 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 			break;
 		case 10:
 			detokenisedStream += "SUBVAR (1, v";
+			detokenisedStream += Common::String::format("%d)", tokenisedCondition[bytePointer]);
 			currentInstruction = FCLInstruction(Token::SUBVAR);
 			currentInstruction.setSource(tokenisedCondition[bytePointer]);
 			currentInstruction.setDestination(1);
@@ -357,8 +361,7 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 		case 20:
 			detokenisedStream += "SETVAR ";
 			detokenisedStream += Common::String::format("(v%d, %d)", (int)tokenisedCondition[bytePointer], (int)tokenisedCondition[bytePointer + 1]);
-			bytePointer += 2;
-			numberOfArguments = 0;
+			currentInstruction = FCLInstruction(Token::SETVAR);
 			break;
 
 		case 35:
diff --git a/engines/freescape/language/instruction.cpp b/engines/freescape/language/instruction.cpp
index 509e060f142..5fc29ed61df 100644
--- a/engines/freescape/language/instruction.cpp
+++ b/engines/freescape/language/instruction.cpp
@@ -127,6 +127,7 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 	assert(!(shot && collided));
 	int ip = 0;
 	int codeSize = code.size();
+	assert(codeSize > 0);
 	while (ip <= codeSize - 1) {
 		FCLInstruction &instruction = code[ip];
 		debugC(1, kFreescapeDebugCode, "Executing ip: %d with type %d in code with size: %d", ip, instruction.getType(), codeSize);
@@ -135,6 +136,10 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 			if (!isCastle())
 				error("Instruction %x at ip: %d not implemented!", instruction.getType(), ip);
 			break;
+		case Token::NOP:
+			debugC(1, kFreescapeDebugCode, "Executing NOP at ip: %d", ip);
+			break;
+
 		case Token::COLLIDEDQ:
 			if (collided)
 				executeCode(*instruction._thenInstructions, shot, collided, timer);
@@ -199,6 +204,9 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 		case Token::CLEARBIT:
 			executeClearBit(instruction);
 			break;
+		case Token::TOGGLEBIT:
+			executeToggleBit(instruction);
+			break;
 		case Token::PRINT:
 			executePrint(instruction);
 			break;




More information about the Scummvm-git-logs mailing list