[Scummvm-git-logs] scummvm master -> 9eabb18ca8782f65667ca678cb2fc16d86c4fc91
dreammaster
paulfgilbert at gmail.com
Mon Sep 14 01:46:54 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:
088ca9cf7a GLK: COMPREHEND: Fix spelling mistake of OO-Topos detection
55983aaa64 GLK: COMPREHEND: Add v2 object is nowhere opcode
9eabb18ca8 GLK: COMPREHEND: Implement v2 inventory full opcode
Commit: 088ca9cf7a34972e53d65ecc9d0626344fe8c2f1
https://github.com/scummvm/scummvm/commit/088ca9cf7a34972e53d65ecc9d0626344fe8c2f1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-09-13T18:33:59-07:00
Commit Message:
GLK: COMPREHEND: Fix spelling mistake of OO-Topos detection
Changed paths:
engines/glk/comprehend/comprehend.cpp
engines/glk/comprehend/detection_tables.h
diff --git a/engines/glk/comprehend/comprehend.cpp b/engines/glk/comprehend/comprehend.cpp
index 6fb3f15305..0416908de5 100644
--- a/engines/glk/comprehend/comprehend.cpp
+++ b/engines/glk/comprehend/comprehend.cpp
@@ -110,7 +110,7 @@ void Comprehend::createDebugger() {
void Comprehend::createGame() {
if (_gameDescription._gameId == "crimsoncrown")
_game = new CrimsonCrownGame();
- else if (_gameDescription._gameId == "ootopis")
+ else if (_gameDescription._gameId == "ootopos")
_game = new OOToposGame();
else if (_gameDescription._gameId == "talisman")
_game = new OOToposGame();
diff --git a/engines/glk/comprehend/detection_tables.h b/engines/glk/comprehend/detection_tables.h
index 17af9a09d5..28d90faf2e 100644
--- a/engines/glk/comprehend/detection_tables.h
+++ b/engines/glk/comprehend/detection_tables.h
@@ -29,7 +29,7 @@ namespace Comprehend {
const PlainGameDescriptor COMPREHEND_GAME_LIST[] = {
{"crimsoncrown", "Crimson Crown"},
- {"ootopis", "OO-Topos"},
+ {"ootopos", "OO-Topos"},
#ifndef RELEASE_BUILD
{"talisman", "Talisman: Challenging the Sands of Time"},
#endif
@@ -45,7 +45,7 @@ struct ComprehendDetectionEntry {
const ComprehendDetectionEntry COMPREHEND_GAMES[] = {
{"crimsoncrown", "cc1.gda", "f2abf019675ac5c9bcfd81032bc7787b"},
- {"ootopis", "g0", "56460c1ee669c253607534155d7e9db4"},
+ {"ootopos", "g0", "56460c1ee669c253607534155d7e9db4"},
#ifndef RELEASE_BUILD
{"talisman", "g0", "35770d4815e610b5252e3fcd9f11def3"},
#endif
Commit: 55983aaa6441082ed44134f2feb1f8b23b77f88e
https://github.com/scummvm/scummvm/commit/55983aaa6441082ed44134f2feb1f8b23b77f88e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-09-13T18:33:59-07:00
Commit Message:
GLK: COMPREHEND: Add v2 object is nowhere opcode
Changed paths:
engines/glk/comprehend/opcode_map.cpp
diff --git a/engines/glk/comprehend/opcode_map.cpp b/engines/glk/comprehend/opcode_map.cpp
index 3778a211b0..6b45241965 100644
--- a/engines/glk/comprehend/opcode_map.cpp
+++ b/engines/glk/comprehend/opcode_map.cpp
@@ -130,6 +130,7 @@ void OpcodeMap::loadVersion2() {
_opcodeMap[0x45] = OPCODE_NOT_IN_ROOM;
_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_NOT_PRESENT;
_opcodeMap[0x43] = OPCODE_OBJECT_NOT_IN_ROOM;
+ _opcodeMap[0x51] = OPCODE_OBJECT_IS_NOWHERE;
_opcodeMap[0x59] = OPCODE_TEST_NOT_FLAG;
_opcodeMap[0x5d] = OPCODE_TEST_NOT_ROOM_FLAG;
_opcodeMap[0x60] = OPCODE_NOT_HAVE_CURRENT_OBJECT;
Commit: 9eabb18ca8782f65667ca678cb2fc16d86c4fc91
https://github.com/scummvm/scummvm/commit/9eabb18ca8782f65667ca678cb2fc16d86c4fc91
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-09-13T18:33:59-07:00
Commit Message:
GLK: COMPREHEND: Implement v2 inventory full opcode
Changed paths:
engines/glk/comprehend/game.cpp
engines/glk/comprehend/game.h
engines/glk/comprehend/game_data.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 d84237af03..7c1238c1b4 100644
--- a/engines/glk/comprehend/game.cpp
+++ b/engines/glk/comprehend/game.cpp
@@ -750,10 +750,18 @@ void ComprehendGame::eval_instruction(FunctionState *func_state,
case OPCODE_INVENTORY_FULL:
item = get_item_by_noun(noun);
- func_set_test_result(func_state,
- _variables[VAR_INVENTORY_WEIGHT] +
- (item->_flags & ITEMF_WEIGHT_MASK) >
- _variables[VAR_INVENTORY_LIMIT]);
+
+ if (_comprehendVersion == 1) {
+ func_set_test_result(func_state,
+ _variables[VAR_INVENTORY_WEIGHT] +
+ (item->_flags & ITEMF_WEIGHT_MASK) >
+ _variables[VAR_INVENTORY_LIMIT]);
+ } else {
+ weighInventory();
+ func_set_test_result(func_state,
+ _totalInventoryWeight + (item->_flags & ITEMF_WEIGHT_MASK) <
+ _variables[VAR_INVENTORY_LIMIT]);
+ }
break;
case OPCODE_DESCRIBE_CURRENT_OBJECT:
@@ -1431,5 +1439,15 @@ bool ComprehendGame::isItemPresent(Item *item) const {
);
}
+void ComprehendGame::weighInventory() {
+ _totalInventoryWeight = 0;
+
+ for (int idx = _itemCount - 1; idx > 0; --idx) {
+ Item *item = get_item(idx);
+ if (item->_room == ROOM_INVENTORY)
+ _totalInventoryWeight += item->_flags & ITEMF_WEIGHT_MASK;
+ }
+}
+
} // namespace Comprehend
} // namespace Glk
diff --git a/engines/glk/comprehend/game.h b/engines/glk/comprehend/game.h
index d31070c737..d66cf82f1a 100644
--- a/engines/glk/comprehend/game.h
+++ b/engines/glk/comprehend/game.h
@@ -63,6 +63,7 @@ private:
void read_input();
void doMovementVerb(uint verbNum);
bool isItemPresent(Item *item) const;
+ void weighInventory();
protected:
void game_save();
diff --git a/engines/glk/comprehend/game_data.cpp b/engines/glk/comprehend/game_data.cpp
index a834a21438..26cafbd4e1 100644
--- a/engines/glk/comprehend/game_data.cpp
+++ b/engines/glk/comprehend/game_data.cpp
@@ -161,7 +161,7 @@ void GameData::clearGame() {
_updateFlags = 0;
_colorTable = 0;
_itemCount = 0;
- _itemsWeight = 0;
+ _totalInventoryWeight = 0;
_strings.clear();
_strings2.clear();
diff --git a/engines/glk/comprehend/game_data.h b/engines/glk/comprehend/game_data.h
index b1611a8c1b..aebff65dbf 100644
--- a/engines/glk/comprehend/game_data.h
+++ b/engines/glk/comprehend/game_data.h
@@ -374,7 +374,7 @@ public:
uint8 _currentRoom;
uint8 _startRoom;
uint8 _itemCount;
- uint8 _itemsWeight;
+ uint8 _totalInventoryWeight;
Common::Array<Item> _items;
diff --git a/engines/glk/comprehend/opcode_map.cpp b/engines/glk/comprehend/opcode_map.cpp
index 6b45241965..7415543c9f 100644
--- a/engines/glk/comprehend/opcode_map.cpp
+++ b/engines/glk/comprehend/opcode_map.cpp
@@ -125,7 +125,6 @@ void OpcodeMap::loadVersion2() {
_opcodeMap[0x2d] = OPCODE_OBJECT_CAN_TAKE;
_opcodeMap[0x30] = OPCODE_CURRENT_OBJECT_PRESENT;
_opcodeMap[0x31] = OPCODE_TEST_ROOM_FLAG;
- _opcodeMap[0x38] = OPCODE_INVENTORY_FULL;
_opcodeMap[0x41] = OPCODE_NOT_HAVE_OBJECT;
_opcodeMap[0x45] = OPCODE_NOT_IN_ROOM;
_opcodeMap[0x48] = OPCODE_CURRENT_OBJECT_NOT_PRESENT;
@@ -159,6 +158,7 @@ void OpcodeMap::loadVersion2() {
_opcodeMap[0x9e] = OPCODE_INVENTORY_ROOM;
_opcodeMap[0xa0] = OPCODE_TAKE_CURRENT_OBJECT;
_opcodeMap[0xa2] = OPCODE_SET_OBJECT_GRAPHIC;
+ _opcodeMap[0xa9] = OPCODE_INVENTORY_FULL;
_opcodeMap[0xb1] = OPCODE_MOVE_DIR;
_opcodeMap[0xb5] = OPCODE_DESCRIBE_CURRENT_OBJECT;
_opcodeMap[0xc1] = OPCODE_VAR_DEC;
More information about the Scummvm-git-logs
mailing list