diff options
-rw-r--r-- | engines/sci/engine/kparse.cpp | 4 | ||||
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 2 | ||||
-rw-r--r-- | engines/sci/parser/vocabulary.cpp | 7 | ||||
-rw-r--r-- | engines/sci/parser/vocabulary.h | 1 |
4 files changed, 9 insertions, 5 deletions
diff --git a/engines/sci/engine/kparse.cpp b/engines/sci/engine/kparse.cpp index 45493a95d2..80a1c10e59 100644 --- a/engines/sci/engine/kparse.cpp +++ b/engines/sci/engine/kparse.cpp @@ -60,8 +60,8 @@ reg_t kSaid(EngineState *s, int argc, reg_t *argv) { } #ifdef DEBUG_PARSER - debugC(2, kDebugLevelParser, "Said block:", 0); - s->_voc->decipherSaidBlock(said_block); + printf("Said block: "); + g_sci->getVocabulary()->decipherSaidBlock(said_block); #endif if (voc->parser_event.isNull() || (readSelectorValue(s->_segMan, voc->parser_event, SELECTOR(claimed)))) { diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 915a6fa994..4521995123 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -489,7 +489,7 @@ void Kernel::dissectScript(int scriptNumber, Vocabulary *vocab) { printf("%04x: ", seeker); while (seeker < _seeker) { - unsigned char nextitem = script->data [seeker++]; + uint16 nextitem = script->data [seeker++]; if (nextitem == 0xFF) printf("\n%04x: ", seeker); else if (nextitem >= 0xF0) { diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index e48a9cdfda..7b115a815d 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -142,10 +142,13 @@ bool Vocabulary::loadParserWords() { const char *Vocabulary::getAnyWordFromGroup(int group) { if (group == VOCAB_MAGIC_NUMBER_GROUP) return "{number}"; + if (group == VOCAB_MAGIC_NOTHING_GROUP) + return "{nothing}"; - for (WordMap::const_iterator i = _parserWords.begin(); i != _parserWords.end(); ++i) + for (WordMap::const_iterator i = _parserWords.begin(); i != _parserWords.end(); ++i) { if (i->_value._group == group) return i->_key.c_str(); + } return "{invalid}"; } @@ -301,7 +304,7 @@ ResultWord Vocabulary::lookupWord(const char *word, int word_len) { } void Vocabulary::decipherSaidBlock(byte *addr) { - byte nextitem; + uint16 nextitem; do { nextitem = *addr++; diff --git a/engines/sci/parser/vocabulary.h b/engines/sci/parser/vocabulary.h index dccef0f5f3..3317b6dfba 100644 --- a/engines/sci/parser/vocabulary.h +++ b/engines/sci/parser/vocabulary.h @@ -78,6 +78,7 @@ enum { /* This word class is used for numbers */ #define VOCAB_MAGIC_NUMBER_GROUP 0xffd /* 0xffe ? */ +#define VOCAB_MAGIC_NOTHING_GROUP 0xffe /* Number of nodes for each parse_tree_node structure */ #define VOCAB_TREE_NODES 500 |