[Scummvm-git-logs] scummvm master -> 0605af698f1ece45489784fc8f3318b1fe1e5817

neuromancer noreply at scummvm.org
Sun Jan 29 19:17:02 UTC 2023


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

Summary:
b1117e459d FREESCAPE: stop execution if some instruction is not implemented (except in castle)
fc8501a07b FREESCAPE: make sure skanner is invisible at start in driller
940a483554 FREESCAPE: fix corner case in 8bit instruction parsing
0605af698f FREESCAPE: avoid re-adding skanner objects


Commit: b1117e459de73820243451468924c002153e8caf
    https://github.com/scummvm/scummvm/commit/b1117e459de73820243451468924c002153e8caf
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-29T20:18:17+01:00

Commit Message:
FREESCAPE: stop execution if some instruction is not implemented (except in castle)

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


diff --git a/engines/freescape/language/instruction.cpp b/engines/freescape/language/instruction.cpp
index 473b3748cd3..f4a61b8245b 100644
--- a/engines/freescape/language/instruction.cpp
+++ b/engines/freescape/language/instruction.cpp
@@ -104,6 +104,8 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 		debugC(1, kFreescapeDebugCode, "Executing ip: %d in code with size: %d", ip, codeSize);
 		switch (instruction.getType()) {
 		default:
+			if (!isCastle())
+				error("Instruction %x at ip: %d not implemented!", instruction.getType(), ip);
 			break;
 		case Token::COLLIDEDQ:
 			if (collided)


Commit: fc8501a07bd7f03b31ce5a766226f23f9c8a4777
    https://github.com/scummvm/scummvm/commit/fc8501a07bd7f03b31ce5a766226f23f9c8a4777
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-29T20:18:17+01:00

Commit Message:
FREESCAPE: make sure skanner is invisible at start in driller

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 129cf255948..1e6c31ea665 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -1498,6 +1498,7 @@ void DrillerEngine::addSkanner(Area *area) {
 	obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
 	assert(obj);
 	obj = (GeometricObject *)obj->duplicate();
+	obj->makeInvisible();
 	area->addObject(obj);
 
 	id = 249;
@@ -1505,6 +1506,7 @@ void DrillerEngine::addSkanner(Area *area) {
 	obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
 	assert(obj);
 	obj = (GeometricObject *)obj->duplicate();
+	obj->makeInvisible();
 	area->addObject(obj);
 
 	id = 250;
@@ -1512,6 +1514,7 @@ void DrillerEngine::addSkanner(Area *area) {
 	obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
 	assert(obj);
 	obj = (GeometricObject *)obj->duplicate();
+	obj->makeInvisible();
 	area->addObject(obj);
 }
 


Commit: 940a483554e03411981fb908d3fd9671398aeb56
    https://github.com/scummvm/scummvm/commit/940a483554e03411981fb908d3fd9671398aeb56
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-29T20:18:17+01:00

Commit Message:
FREESCAPE: fix corner case in 8bit instruction parsing

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


diff --git a/engines/freescape/language/8bitDetokeniser.cpp b/engines/freescape/language/8bitDetokeniser.cpp
index 20eb2d0733a..db1e0dc3223 100644
--- a/engines/freescape/language/8bitDetokeniser.cpp
+++ b/engines/freescape/language/8bitDetokeniser.cpp
@@ -111,6 +111,7 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 
 		case 0:
 			detokenisedStream += "NOP ";
+			currentInstruction = FCLInstruction(Token::NOP);
 			break; // NOP
 		case 1:    // add three-byte value to score
 		{
@@ -180,6 +181,8 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 			currentInstruction.setDestination(1);
 			conditionalInstructions->push_back(currentInstruction);
 			currentInstruction = FCLInstruction(Token::UNKNOWN);
+			bytePointer++;
+			numberOfArguments = 0;
 			break;
 		case 10:
 			detokenisedStream += "SUBVAR (1, v";
@@ -188,7 +191,8 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 			currentInstruction.setDestination(1);
 			conditionalInstructions->push_back(currentInstruction);
 			currentInstruction = FCLInstruction(Token::UNKNOWN);
-			break;
+			bytePointer++;
+			numberOfArguments = 0;
 			break;
 
 		case 11: // end condition if a variable doesn't have a particular value
@@ -347,6 +351,7 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 
 		case 35:
 			detokenisedStream += "SCREEN (";
+			currentInstruction = FCLInstruction(Token::SCREEN);
 			break;
 
 		case 44:
@@ -394,6 +399,7 @@ Common::String detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition,
 			}
 
 			detokenisedStream += ")";
+			assert(currentInstruction.getType() != Token::UNKNOWN);
 			conditionalInstructions->push_back(currentInstruction);
 			currentInstruction = FCLInstruction(Token::UNKNOWN);
 		}
diff --git a/engines/freescape/language/instruction.cpp b/engines/freescape/language/instruction.cpp
index f4a61b8245b..ef9e656ffa9 100644
--- a/engines/freescape/language/instruction.cpp
+++ b/engines/freescape/language/instruction.cpp
@@ -171,6 +171,9 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
 		case Token::SPFX:
 			executeSPFX(instruction);
 			break;
+		case Token::SCREEN:
+			// TODO
+			break;
 		case Token::BITNOTEQ:
 			if (executeEndIfBitNotEqual(instruction))
 				ip = codeSize;
diff --git a/engines/freescape/language/token.h b/engines/freescape/language/token.h
index 90149d495e1..77ec65b2dde 100644
--- a/engines/freescape/language/token.h
+++ b/engines/freescape/language/token.h
@@ -54,6 +54,7 @@ public:
 		MOVE,
 		MOVETO,
 		NOTV,
+		NOP,
 		OR,
 		ORV,
 		GETXPOS,
@@ -63,6 +64,7 @@ public:
 		RESTART,
 		REDRAW,
 		REMOVE,
+		SCREEN,
 		SOUND,
 		SETVAR,
 		SHOTQ,


Commit: 0605af698f1ece45489784fc8f3318b1fe1e5817
    https://github.com/scummvm/scummvm/commit/0605af698f1ece45489784fc8f3318b1fe1e5817
Author: neuromancer (gustavo.grieco at gmail.com)
Date: 2023-01-29T20:18:17+01:00

Commit Message:
FREESCAPE: avoid re-adding skanner objects

Changed paths:
    engines/freescape/games/driller.cpp


diff --git a/engines/freescape/games/driller.cpp b/engines/freescape/games/driller.cpp
index 1e6c31ea665..52d9a51cca1 100644
--- a/engines/freescape/games/driller.cpp
+++ b/engines/freescape/games/driller.cpp
@@ -1494,6 +1494,10 @@ void DrillerEngine::addSkanner(Area *area) {
 	int16 id;
 
 	id = 248;
+	// If first object is already added, do not re-add any
+	if (area->objectWithID(id) != nullptr)
+		return;
+
 	debugC(1, kFreescapeDebugParser, "Adding object %d to room structure", id);
 	obj = (GeometricObject *)_areaMap[255]->objectWithID(id);
 	assert(obj);




More information about the Scummvm-git-logs mailing list