[Scummvm-git-logs] scummvm master -> 0bf2dc6d7ba8650e7070484c1cd7707d307a9137
dreammaster
paulfgilbert at gmail.com
Mon Jun 17 02:05:14 CEST 2019
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:
c7a9306415 GLK: ADVSYS: Fixes for get action
0bf2dc6d7b GLK: ADVSYS: Fix actions using OP_SEND
Commit: c7a93064159395faf340109cd96b54874b8c2d14
https://github.com/scummvm/scummvm/commit/c7a93064159395faf340109cd96b54874b8c2d14
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-06-16T16:03:58-07:00
Commit Message:
GLK: ADVSYS: Fixes for get action
Changed paths:
engines/glk/advsys/game.cpp
engines/glk/advsys/vm.cpp
diff --git a/engines/glk/advsys/game.cpp b/engines/glk/advsys/game.cpp
index eca1451..0465583 100644
--- a/engines/glk/advsys/game.cpp
+++ b/engines/glk/advsys/game.cpp
@@ -134,7 +134,7 @@ bool Game::init(Common::SeekableReadStream *s) {
decrypt(&_data[0], _size);
_wordTable = &_data[_wordTableOffset];
- _wordTypeTable = &_data[_wordTypeTableOffset];
+ _wordTypeTable = &_data[_wordTypeTableOffset - 1];
_objectTable = &_data[_objectTableOffset];
_actionTable = &_data[_actionTableOffset];
_variableTable = &_data[_variableTableOffset];
diff --git a/engines/glk/advsys/vm.cpp b/engines/glk/advsys/vm.cpp
index 33712bc..bfc22e7 100644
--- a/engines/glk/advsys/vm.cpp
+++ b/engines/glk/advsys/vm.cpp
@@ -467,7 +467,7 @@ bool VM::parseInput() {
// Get direct object, preposition, and/or indirect object
if (_wordPtr != _words.end()) {
// Get any direct objects
- noun1 = _adjectiveList.size();
+ noun1 = _adjectiveList.size() + 1;
for (;;) {
// Get the next direct object
if (!getNoun())
@@ -475,7 +475,7 @@ bool VM::parseInput() {
++cnt1;
// Check for more direct objects
- if (_wordPtr == _words.end() || getWordType(*_wordPtr))
+ if (_wordPtr == _words.end() || getWordType(*_wordPtr) != WT_CONJUNCTION)
break;
++_wordPtr;
}
@@ -617,7 +617,7 @@ uint VM::getNoun() {
// Add a noun entry to the list
Noun n;
n._adjective = &_adjectiveList[alStart];
- n._noun = *_wordPtr++;
+ n._noun = (_wordPtr == _words.end()) ? 0 : *_wordPtr++;
n._num = _wordPtr - _words.begin() - 1;
_nouns.push_back(n);
@@ -641,6 +641,7 @@ bool VM::getVerb() {
if (checkVerb(_verbs)) {
++_wordPtr;
} else {
+ _verbs.pop_back();
_verbs.push_back(_words.back());
if (checkVerb(_verbs)) {
Commit: 0bf2dc6d7ba8650e7070484c1cd7707d307a9137
https://github.com/scummvm/scummvm/commit/0bf2dc6d7ba8650e7070484c1cd7707d307a9137
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-06-16T17:04:53-07:00
Commit Message:
GLK: ADVSYS: Fix actions using OP_SEND
Changed paths:
engines/glk/advsys/advsys.cpp
engines/glk/advsys/vm.cpp
engines/glk/advsys/vm.h
diff --git a/engines/glk/advsys/advsys.cpp b/engines/glk/advsys/advsys.cpp
index a61033a..c65cd18 100644
--- a/engines/glk/advsys/advsys.cpp
+++ b/engines/glk/advsys/advsys.cpp
@@ -83,6 +83,7 @@ void AdvSys::deinitialize() {
}
bool AdvSys::singleAction() {
+ debug("------------------");
// Do the before code
switch (execute(_beforeOffset)) {
case ABORT:
diff --git a/engines/glk/advsys/vm.cpp b/engines/glk/advsys/vm.cpp
index bfc22e7..70b0359 100644
--- a/engines/glk/advsys/vm.cpp
+++ b/engines/glk/advsys/vm.cpp
@@ -93,6 +93,7 @@ ExecutionResult VM::execute(int offset) {
_pc = offset;
// Clear the stack
+ _fp.clear();
_stack.clear();
// Iterate through the script
@@ -398,9 +399,9 @@ void VM::opSEND() {
if (val)
val = getObjectField(val, O_CLASS);
else
- val = _fp[_fp[FP_ARGS_SIZE] + FP_ARGS];
+ val = _fp[_fp[FP_ARGS_SIZE] + FP_ARGS - 1];
- if (val && (val = getObjectProperty(val, _fp[_fp[FP_ARGS_SIZE] + 1])) != 0) {
+ if (val && (val = getObjectProperty(val, _fp[_fp[FP_ARGS_SIZE] + FP_ARGS - 2])) != 0) {
_pc = getActionField(val, A_CODE);
} else {
// Return NIL if there's no action for the given message
diff --git a/engines/glk/advsys/vm.h b/engines/glk/advsys/vm.h
index 5868917..4531b2e 100644
--- a/engines/glk/advsys/vm.h
+++ b/engines/glk/advsys/vm.h
@@ -181,6 +181,11 @@ public:
}
/**
+ * Clear the function pointer
+ */
+ void clear() { _index = 0; }
+
+ /**
* Returns the index in the stack of the function pointer
*/
operator int() const { return _index; }
More information about the Scummvm-git-logs
mailing list