[Scummvm-git-logs] scummvm master -> 30046650d27ae4f64d08a947fbf5b511241776a5

dreammaster paulfgilbert at gmail.com
Sun Jun 28 17:11:08 UTC 2020


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

Summary:
df6bb8d7eb GLK: COMPREHEND: Add NULL script opcode
261779f1d2 GLK: COMPREHEND: Implement opcode 4E TEST_FALSE
30046650d2 GLK: COMPREHEND: Sort out incorrect current object opcodes


Commit: df6bb8d7eba333b3cc714e13905a82cc6f8e232f
    https://github.com/scummvm/scummvm/commit/df6bb8d7eba333b3cc714e13905a82cc6f8e232f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-06-27T21:33:24-07:00

Commit Message:
GLK: COMPREHEND: Add NULL script opcode

Changed paths:
    engines/glk/comprehend/game.cpp
    engines/glk/comprehend/game_data.h
    engines/glk/comprehend/opcode_map.cpp


diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp
index bbe7d1351c..36bdbbf1f7 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -1072,6 +1072,9 @@ void ComprehendGame::eval_instruction(FunctionState *func_state,
 		doMovementVerb(instr->_operand[0]);
 		break;
 
+	case OPCODE_NULL:
+		break;
+
 	default:
 		if (instr->_opcode & 0x80) {
 			warning("Unhandled command opcode %.2x", instr->_opcode);
diff --git a/engines/glk/comprehend/game_data.h b/engines/glk/comprehend/game_data.h
index 196c12aaa0..503fa79629 100644
--- a/engines/glk/comprehend/game_data.h
+++ b/engines/glk/comprehend/game_data.h
@@ -117,7 +117,8 @@ enum {
 	OPCODE_CURRENT_IS_OBJECT,
 	OPCODE_DRAW_ROOM,
 	OPCODE_DRAW_OBJECT,
-	OPCODE_WAIT_KEY
+	OPCODE_WAIT_KEY,
+	OPCODE_NULL
 };
 
 /* Game state update flags */
diff --git a/engines/glk/comprehend/opcode_map.cpp b/engines/glk/comprehend/opcode_map.cpp
index 9d9e1137a4..a3be5c5c13 100644
--- a/engines/glk/comprehend/opcode_map.cpp
+++ b/engines/glk/comprehend/opcode_map.cpp
@@ -57,10 +57,11 @@ void OpcodeMap::loadVersion1() {
 	_opcodeMap[0x24] = OPCODE_CURRENT_OBJECT_PRESENT;
 	_opcodeMap[0x31] = OPCODE_TEST_ROOM_FLAG;
 	_opcodeMap[0x41] = OPCODE_NOT_HAVE_OBJECT;
+	_opcodeMap[0x43] = OPCODE_OBJECT_NOT_IN_ROOM;
 	_opcodeMap[0x45] = OPCODE_NOT_IN_ROOM;
 	_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_IS_NOWHERE;
 	_opcodeMap[0x49] = OPCODE_OBJECT_NOT_PRESENT;
-	_opcodeMap[0x43] = OPCODE_OBJECT_NOT_IN_ROOM;
+	_opcodeMap[0x4E] = OPCODE_NULL;
 	_opcodeMap[0x50] = OPCODE_TEST_FALSE;
 	_opcodeMap[0x59] = OPCODE_TEST_NOT_FLAG;
 	_opcodeMap[0x60] = OPCODE_NOT_HAVE_CURRENT_OBJECT;


Commit: 261779f1d20d94f767bb76d40cc1310e2c901368
    https://github.com/scummvm/scummvm/commit/261779f1d20d94f767bb76d40cc1310e2c901368
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-06-28T09:55:49-07:00

Commit Message:
GLK: COMPREHEND: Implement opcode 4E TEST_FALSE

Changed paths:
    engines/glk/comprehend/debugger_dumper.cpp
    engines/glk/comprehend/game.cpp
    engines/glk/comprehend/game_data.h
    engines/glk/comprehend/opcode_map.cpp


diff --git a/engines/glk/comprehend/debugger_dumper.cpp b/engines/glk/comprehend/debugger_dumper.cpp
index b596041f4c..4ad211cfbf 100644
--- a/engines/glk/comprehend/debugger_dumper.cpp
+++ b/engines/glk/comprehend/debugger_dumper.cpp
@@ -101,6 +101,7 @@ DebuggerDumper::DebuggerDumper() : _game(nullptr) {
 	_opcodes[OPCODE_DRAW_ROOM] = "draw_room";
 	_opcodes[OPCODE_DRAW_OBJECT] = "draw_object";
 	_opcodes[OPCODE_WAIT_KEY] = "wait_key";
+	_opcodes[OPCODE_TEST_FALSE] = "test_false";
 }
 
 Common::String DebuggerDumper::dumpInstruction(ComprehendGame *game,
diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp
index 36bdbbf1f7..6f9c044e84 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -1010,6 +1010,12 @@ void ComprehendGame::eval_instruction(FunctionState *func_state,
 		break;
 
 	case OPCODE_TEST_FALSE:
+		// The original had two opcodes mapped to the same code that does
+		// a test, but ignores the result, and is always false
+		func_set_test_result(func_state, false);
+		break;
+
+	case OPCODE_TEST_FALSE_FIXME:
 		/*
 		 * FIXME - not sure what this is for. In Transylvania
 		 * it is opcode 0x50 and is used when attempting to
@@ -1072,9 +1078,6 @@ void ComprehendGame::eval_instruction(FunctionState *func_state,
 		doMovementVerb(instr->_operand[0]);
 		break;
 
-	case OPCODE_NULL:
-		break;
-
 	default:
 		if (instr->_opcode & 0x80) {
 			warning("Unhandled command opcode %.2x", instr->_opcode);
diff --git a/engines/glk/comprehend/game_data.h b/engines/glk/comprehend/game_data.h
index 503fa79629..a2260ee7d9 100644
--- a/engines/glk/comprehend/game_data.h
+++ b/engines/glk/comprehend/game_data.h
@@ -51,7 +51,7 @@ enum {
 
 enum {
 	OPCODE_UNKNOWN,
-	OPCODE_TEST_FALSE,
+	OPCODE_TEST_FALSE_FIXME,
 	OPCODE_HAVE_OBJECT,
 	OPCODE_OR,
 	OPCODE_IN_ROOM,
@@ -118,7 +118,7 @@ enum {
 	OPCODE_DRAW_ROOM,
 	OPCODE_DRAW_OBJECT,
 	OPCODE_WAIT_KEY,
-	OPCODE_NULL
+	OPCODE_TEST_FALSE
 };
 
 /* Game state update flags */
diff --git a/engines/glk/comprehend/opcode_map.cpp b/engines/glk/comprehend/opcode_map.cpp
index a3be5c5c13..09704a76a0 100644
--- a/engines/glk/comprehend/opcode_map.cpp
+++ b/engines/glk/comprehend/opcode_map.cpp
@@ -61,9 +61,10 @@ void OpcodeMap::loadVersion1() {
 	_opcodeMap[0x45] = OPCODE_NOT_IN_ROOM;
 	_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_IS_NOWHERE;
 	_opcodeMap[0x49] = OPCODE_OBJECT_NOT_PRESENT;
-	_opcodeMap[0x4E] = OPCODE_NULL;
-	_opcodeMap[0x50] = OPCODE_TEST_FALSE;
+	_opcodeMap[0x4E] = OPCODE_TEST_FALSE;
+	_opcodeMap[0x50] = OPCODE_TEST_FALSE_FIXME;
 	_opcodeMap[0x59] = OPCODE_TEST_NOT_FLAG;
+	_opcodeMap[0x5D] = OPCODE_TEST_FALSE;
 	_opcodeMap[0x60] = OPCODE_NOT_HAVE_CURRENT_OBJECT;
 	_opcodeMap[0x61] = OPCODE_OBJECT_IS_NOWHERE;
 	_opcodeMap[0x64] = OPCODE_CURRENT_OBJECT_NOT_PRESENT;


Commit: 30046650d27ae4f64d08a947fbf5b511241776a5
    https://github.com/scummvm/scummvm/commit/30046650d27ae4f64d08a947fbf5b511241776a5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-06-28T10:10:23-07:00

Commit Message:
GLK: COMPREHEND: Sort out incorrect current object opcodes

Changed paths:
    engines/glk/comprehend/debugger_dumper.cpp
    engines/glk/comprehend/game.cpp
    engines/glk/comprehend/game_data.h
    engines/glk/comprehend/opcode_map.cpp


diff --git a/engines/glk/comprehend/debugger_dumper.cpp b/engines/glk/comprehend/debugger_dumper.cpp
index 4ad211cfbf..08846d5bdc 100644
--- a/engines/glk/comprehend/debugger_dumper.cpp
+++ b/engines/glk/comprehend/debugger_dumper.cpp
@@ -40,6 +40,7 @@ DebuggerDumper::DebuggerDumper() : _game(nullptr) {
 	_opcodes[OPCODE_CURRENT_OBJECT_TAKEABLE] = "current_object_takeable";
 	_opcodes[OPCODE_CURRENT_OBJECT_NOT_TAKEABLE] = "current_object_not_takeable";
 
+	_opcodes[OPCODE_CURRENT_OBJECT_IS_IN_INVENTORY] = "current_object_is_in_inventory";
 	_opcodes[OPCODE_CURRENT_OBJECT_IS_NOWHERE] = "current_object_is_nowhere";
 
 	_opcodes[OPCODE_CURRENT_OBJECT_NOT_PRESENT] = "current_object_not_present";
diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp
index 6f9c044e84..6cf71e91fc 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -803,25 +803,26 @@ void ComprehendGame::eval_instruction(FunctionState *func_state,
 			                     !(item->_flags & ITEMF_CAN_TAKE));
 		break;
 
-	case OPCODE_CURRENT_OBJECT_IS_NOWHERE:
+	case OPCODE_CURRENT_OBJECT_IS_IN_INVENTORY:
 		item = get_item_by_noun(noun);
-		if (!item)
-			func_set_test_result(func_state, false);
-		else
-			func_set_test_result(func_state,
-			                     item->_room == ROOM_NOWHERE);
+		assert(item);
+		func_set_test_result(func_state, item->_room == ROOM_INVENTORY);
 		break;
 
 	case OPCODE_OBJECT_IS_NOWHERE:
 		item = get_item(instr->_operand[0] - 1);
-		func_set_test_result(func_state,
-		                     item->_room == ROOM_NOWHERE);
+		func_set_test_result(func_state, item->_room == ROOM_NOWHERE);
+		break;
+
+	case OPCODE_CURRENT_OBJECT_IS_NOWHERE:
+		item = get_item_by_noun(noun);
+		assert(item);
+		func_set_test_result(func_state, item->_room == ROOM_NOWHERE);
 		break;
 
 	case OPCODE_OBJECT_IS_NOT_NOWHERE:
 		item = get_item(instr->_operand[0] - 1);
-		func_set_test_result(func_state,
-		                     item->_room != ROOM_NOWHERE);
+		func_set_test_result(func_state, item->_room != ROOM_NOWHERE);
 		break;
 
 	case OPCODE_OBJECT_NOT_PRESENT:
@@ -1015,16 +1016,6 @@ void ComprehendGame::eval_instruction(FunctionState *func_state,
 		func_set_test_result(func_state, false);
 		break;
 
-	case OPCODE_TEST_FALSE_FIXME:
-		/*
-		 * FIXME - not sure what this is for. In Transylvania
-		 * it is opcode 0x50 and is used when attempting to
-		 * take the bar in the cellar. If it returns true then
-		 * the response is "there's none here".
-		 */
-		func_set_test_result(func_state, false);
-		break;
-
 	case OPCODE_SAVE_ACTION:
 		/*
 		 * FIXME - This saves the current verb and allows the next
diff --git a/engines/glk/comprehend/game_data.h b/engines/glk/comprehend/game_data.h
index a2260ee7d9..0c58e24fb3 100644
--- a/engines/glk/comprehend/game_data.h
+++ b/engines/glk/comprehend/game_data.h
@@ -51,7 +51,6 @@ enum {
 
 enum {
 	OPCODE_UNKNOWN,
-	OPCODE_TEST_FALSE_FIXME,
 	OPCODE_HAVE_OBJECT,
 	OPCODE_OR,
 	OPCODE_IN_ROOM,
@@ -70,12 +69,13 @@ enum {
 	OPCODE_TEST_ROOM_FLAG,
 	OPCODE_NOT_HAVE_OBJECT,
 	OPCODE_NOT_IN_ROOM,
-	OPCODE_CURRENT_OBJECT_IS_NOWHERE,
+	OPCODE_CURRENT_OBJECT_IS_IN_INVENTORY,
 	OPCODE_OBJECT_NOT_PRESENT,
 	OPCODE_OBJECT_NOT_IN_ROOM,
 	OPCODE_TEST_NOT_FLAG,
 	OPCODE_NOT_HAVE_CURRENT_OBJECT,
 	OPCODE_OBJECT_IS_NOWHERE,
+	OPCODE_CURRENT_OBJECT_IS_NOWHERE,
 	OPCODE_CURRENT_OBJECT_NOT_PRESENT,
 	OPCODE_CURRENT_OBJECT_NOT_TAKEABLE,
 	OPCODE_TEST_NOT_ROOM_FLAG,
diff --git a/engines/glk/comprehend/opcode_map.cpp b/engines/glk/comprehend/opcode_map.cpp
index 09704a76a0..772396583d 100644
--- a/engines/glk/comprehend/opcode_map.cpp
+++ b/engines/glk/comprehend/opcode_map.cpp
@@ -59,10 +59,10 @@ void OpcodeMap::loadVersion1() {
 	_opcodeMap[0x41] = OPCODE_NOT_HAVE_OBJECT;
 	_opcodeMap[0x43] = OPCODE_OBJECT_NOT_IN_ROOM;
 	_opcodeMap[0x45] = OPCODE_NOT_IN_ROOM;
-	_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_IS_NOWHERE;
+	_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_IS_IN_INVENTORY;
 	_opcodeMap[0x49] = OPCODE_OBJECT_NOT_PRESENT;
 	_opcodeMap[0x4E] = OPCODE_TEST_FALSE;
-	_opcodeMap[0x50] = OPCODE_TEST_FALSE_FIXME;
+	_opcodeMap[0x50] = OPCODE_CURRENT_OBJECT_IS_NOWHERE;
 	_opcodeMap[0x59] = OPCODE_TEST_NOT_FLAG;
 	_opcodeMap[0x5D] = OPCODE_TEST_FALSE;
 	_opcodeMap[0x60] = OPCODE_NOT_HAVE_CURRENT_OBJECT;
@@ -120,7 +120,7 @@ void OpcodeMap::loadVersion2() {
 	_opcodeMap[0x38] = OPCODE_INVENTORY_FULL;
 	_opcodeMap[0x41] = OPCODE_NOT_HAVE_OBJECT;
 	_opcodeMap[0x45] = OPCODE_NOT_IN_ROOM;
-	_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_IS_NOWHERE;
+	_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_IS_IN_INVENTORY;
 	_opcodeMap[0x43] = OPCODE_OBJECT_NOT_IN_ROOM;
 	_opcodeMap[0x59] = OPCODE_TEST_NOT_FLAG;
 	_opcodeMap[0x5d] = OPCODE_TEST_NOT_ROOM_FLAG;




More information about the Scummvm-git-logs mailing list