[Scummvm-git-logs] scummvm master -> 280e44f706194cfe33b9af43a0988b8659d4900f
dreammaster
paulfgilbert at gmail.com
Sat Oct 24 04:28:36 UTC 2020
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:
d220fb1adc GLK: COMPREHEND: Further fix OO-Topos strings
280e44f706 GLK: COMPREHEND: Verified v2 opcodes, added OPCODE_RANDOM_MSG
Commit: d220fb1adc8508d704d84d87364e88b2307b07f3
https://github.com/scummvm/scummvm/commit/d220fb1adc8508d704d84d87364e88b2307b07f3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-10-23T20:59:54-07:00
Commit Message:
GLK: COMPREHEND: Further fix OO-Topos strings
Changed paths:
engines/glk/comprehend/game_data.cpp
diff --git a/engines/glk/comprehend/game_data.cpp b/engines/glk/comprehend/game_data.cpp
index c8922859e0..ec4db6fc7f 100644
--- a/engines/glk/comprehend/game_data.cpp
+++ b/engines/glk/comprehend/game_data.cpp
@@ -670,12 +670,13 @@ void GameData::load_extra_string_files() {
_strings2.clear();
_strings2.reserve(STRING_FILE_COUNT * _stringFiles.size() + 1);
- // TODO: Is this needed for other than OO-Topos?
- if (_comprehendVersion == 2)
- _strings2.push_back("");
+ for (uint i = 0; i < _stringFiles.size(); i++) {
+ // TODO: Is this needed for other than OO-Topos?
+ if (_comprehendVersion == 2 && (i == 0 || i == 4))
+ _strings2.push_back("");
- for (uint i = 0; i < _stringFiles.size(); i++)
load_extra_string_file(_stringFiles[i]);
+ }
}
void GameData::loadGameData() {
Commit: 280e44f706194cfe33b9af43a0988b8659d4900f
https://github.com/scummvm/scummvm/commit/280e44f706194cfe33b9af43a0988b8659d4900f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-10-23T21:28:13-07:00
Commit Message:
GLK: COMPREHEND: Verified v2 opcodes, added OPCODE_RANDOM_MSG
Changed paths:
engines/glk/comprehend/debugger_dumper.cpp
engines/glk/comprehend/game_data.h
engines/glk/comprehend/game_opcodes.cpp
diff --git a/engines/glk/comprehend/debugger_dumper.cpp b/engines/glk/comprehend/debugger_dumper.cpp
index e48ad3dcf0..fc736971ad 100644
--- a/engines/glk/comprehend/debugger_dumper.cpp
+++ b/engines/glk/comprehend/debugger_dumper.cpp
@@ -115,6 +115,7 @@ DebuggerDumper::DebuggerDumper() : _game(nullptr) {
_opcodes[OPCODE_SET_CAN_TAKE] = "set_can_take";
_opcodes[OPCODE_SET_FLAG40] = "set_flag40";
_opcodes[OPCODE_CLEAR_FLAG40] = "clear_flag40";
+ _opcodes[OPCODE_RANDOM_MSG] = "random_msg";
}
Common::String DebuggerDumper::dumpInstruction(ComprehendGame *game,
diff --git a/engines/glk/comprehend/game_data.h b/engines/glk/comprehend/game_data.h
index c7bc837525..3ae4c6bd5e 100644
--- a/engines/glk/comprehend/game_data.h
+++ b/engines/glk/comprehend/game_data.h
@@ -133,7 +133,8 @@ enum ScriptOpcode {
OPCODE_CLEAR_CAN_TAKE,
OPCODE_SET_CAN_TAKE,
OPCODE_CLEAR_FLAG40,
- OPCODE_SET_FLAG40
+ OPCODE_SET_FLAG40,
+ OPCODE_RANDOM_MSG
};
/* Game state update flags */
diff --git a/engines/glk/comprehend/game_opcodes.cpp b/engines/glk/comprehend/game_opcodes.cpp
index 75345f4ef7..19f47d48a4 100644
--- a/engines/glk/comprehend/game_opcodes.cpp
+++ b/engines/glk/comprehend/game_opcodes.cpp
@@ -170,6 +170,13 @@ void ComprehendGameOpcodes::execute_opcode(const Instruction *instr, const Sente
console_println(instrStringLookup(instr->_operand[0], instr->_operand[1]).c_str());
break;
+ case OPCODE_RANDOM_MSG: {
+ int msgId = (instr->_operand[2] << 8 | instr->_operand[1]) +
+ getRandomNumber(instr->_operand[0] - 1);
+ console_println(stringLookup(msgId).c_str());
+ break;
+ }
+
case OPCODE_REMOVE_OBJECT:
item = getItem(instr);
move_object(item, ROOM_NOWHERE);
@@ -365,6 +372,7 @@ ComprehendGameV1::ComprehendGameV1() {
_opcodeMap[0x80] = OPCODE_INVENTORY;
_opcodeMap[0x81] = OPCODE_TAKE_OBJECT;
_opcodeMap[0x82] = OPCODE_MOVE_OBJECT_TO_ROOM;
+ _opcodeMap[0x83] = OPCODE_RANDOM_MSG;
_opcodeMap[0x84] = OPCODE_SAVE_ACTION;
_opcodeMap[0x85] = OPCODE_MOVE_TO_ROOM;
_opcodeMap[0x86] = OPCODE_VAR_ADD;
@@ -599,11 +607,6 @@ void ComprehendGameV1::execute_opcode(const Instruction *instr, const Sentence *
item->_stringDesc = (instr->_operand[2] << 8) | instr->_operand[1];
break;
- case OPCODE_SET_OBJECT_LONG_DESCRIPTION:
- item = getItem(instr);
- item->_longString = (instr->_operand[2] << 8) | instr->_operand[1];
- break;
-
case OPCODE_SET_OBJECT_GRAPHIC:
item = getItem(instr);
item->_graphic = instr->_operand[1];
@@ -643,10 +646,6 @@ void ComprehendGameV1::execute_opcode(const Instruction *instr, const Sentence *
#endif
break;
- case OPCODE_DRAW_ROOM:
- g_comprehend->drawLocationPicture(instr->_operand[0] - 1);
- break;
-
case OPCODE_DRAW_OBJECT:
g_comprehend->drawItemPicture(instr->_operand[0] - 1);
break;
@@ -688,6 +687,7 @@ ComprehendGameV2::ComprehendGameV2() {
_opcodeMap[0x2d] = OPCODE_OBJECT_CAN_TAKE;
_opcodeMap[0x80] = OPCODE_INVENTORY;
_opcodeMap[0x81] = OPCODE_TAKE_OBJECT;
+ _opcodeMap[0x83] = OPCODE_RANDOM_MSG;
_opcodeMap[0x84] = OPCODE_SAVE_ACTION;
_opcodeMap[0x85] = OPCODE_MOVE_TO_ROOM;
_opcodeMap[0x86] = OPCODE_VAR_ADD;
@@ -696,6 +696,7 @@ ComprehendGameV2::ComprehendGameV2() {
_opcodeMap[0x8a] = OPCODE_VAR_SUB;
_opcodeMap[0x8c] = OPCODE_MOVE_DEFAULT;
_opcodeMap[0x8e] = OPCODE_PRINT;
+ _opcodeMap[0x8f] = OPCODE_SET_OBJECT_LONG_DESCRIPTION;
_opcodeMap[0x92] = OPCODE_CALL_FUNC;
_opcodeMap[0x99] = OPCODE_SET_FLAG;
_opcodeMap[0x9d] = OPCODE_CLEAR_FLAG;
@@ -710,6 +711,7 @@ ComprehendGameV2::ComprehendGameV2() {
_opcodeMap[0xc9] = OPCODE_SET_STRING_REPLACEMENT1;
_opcodeMap[0xcd] = OPCODE_SET_STRING_REPLACEMENT2;
_opcodeMap[0xd1] = OPCODE_MOVE_DIR;
+ _opcodeMap[0xd5] = OPCODE_DRAW_ROOM;
_opcodeMap[0xdd] = OPCODE_VAR_INC;
_opcodeMap[0xe1] = OPCODE_MOVE_OBJECT_TO_CURRENT_ROOM;
_opcodeMap[0xe5] = OPCODE_SET_CAN_TAKE;
@@ -730,13 +732,11 @@ ComprehendGameV2::ComprehendGameV2() {
_opcodeMap[0x60] = OPCODE_NOT_HAVE_CURRENT_OBJECT;
_opcodeMap[0x70] = OPCODE_CURRENT_OBJECT_NOT_PRESENT;
_opcodeMap[0x8b] = OPCODE_SET_OBJECT_DESCRIPTION;
- _opcodeMap[0x8f] = OPCODE_SET_OBJECT_LONG_DESCRIPTION;
_opcodeMap[0x90] = OPCODE_WAIT_KEY;
_opcodeMap[0x98] = OPCODE_TURN_TICK;
_opcodeMap[0x9e] = OPCODE_INVENTORY_ROOM;
_opcodeMap[0xc2] = OPCODE_SET_ROOM_GRAPHIC;
_opcodeMap[0xc6] = OPCODE_SET_OBJECT_GRAPHIC;
- _opcodeMap[0xd5] = OPCODE_DRAW_ROOM;
_opcodeMap[0xd9] = OPCODE_DRAW_OBJECT;
_opcodeMap[0xf0] = OPCODE_DROP_CURRENT_OBJECT;
_opcodeMap[0xfc] = OPCODE_REMOVE_CURRENT_OBJECT;
@@ -767,6 +767,10 @@ void ComprehendGameV2::execute_opcode(const Instruction *instr, const Sentence *
item->_flags &= ~ITEMF_INVISIBLE;
break;
+ case OPCODE_DRAW_ROOM:
+ g_comprehend->drawLocationPicture(instr->_operand[0] - 1);
+ break;
+
case OPCODE_INVENTORY_FULL:
item = get_item_by_noun(noun);
@@ -800,6 +804,11 @@ void ComprehendGameV2::execute_opcode(const Instruction *instr, const Sentence *
func_set_test_result(func_state, item->_flags & ITEMF_CAN_TAKE);
break;
+ case OPCODE_SET_OBJECT_LONG_DESCRIPTION:
+ item = getItem(instr);
+ item->_longString = (instr->_operand[2] << 8) | instr->_operand[1];
+ break;
+
case OPCODE_SET_STRING_REPLACEMENT3:
warning("TODO: Figure out OPCODE_SET_STRING_REPLACEMENT3 offset");
_currentReplaceWord = instr->_operand[0] - 1;
More information about the Scummvm-git-logs
mailing list