diff options
-rw-r--r-- | engines/sci/engine/kernel.cpp | 1 | ||||
-rw-r--r-- | engines/sci/engine/kernel.h | 1 | ||||
-rw-r--r-- | engines/sci/engine/kstring.cpp | 42 | ||||
-rw-r--r-- | engines/sci/engine/message.cpp | 2 | ||||
-rw-r--r-- | engines/sci/scicore/vocab_debug.cpp | 7 |
5 files changed, 26 insertions, 27 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index d5a1ba2bf5..a507a2b89a 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -201,7 +201,6 @@ SciKernelFunction kfunct_mappers[] = { /*(?)*/ DEFUN("TimesCot", kTimesCot, "ii"), /*(?)*/ DEFUN("TimesTan", kTimesTan, "ii"), DEFUN("Message", kMessage, ".*"), - DEFUN("GetMessage", kGetMessage, "iiir"), DEFUN("DoAudio", kDoAudio, ".*"), DEFUN("DoSync", kDoSync, ".*"), diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index ece37d1f6c..e8d2e82caf 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -451,7 +451,6 @@ reg_t kGetSaveDir(EngineState *s, int funct_nr, int argc, reg_t *argv); reg_t kTextSize(EngineState *s, int funct_nr, int argc, reg_t *argv); reg_t kIsItSkip(EngineState *s, int funct_nr, int argc, reg_t *argv); reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv); -reg_t kGetMessage(EngineState *s, int funct_nr, int argc, reg_t *argv); reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv); reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv); reg_t k_Unknown(EngineState *s, int funct_nr, int argc, reg_t *argv); diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 21ca298d18..046c8a8419 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -729,6 +729,27 @@ static MessageState state; reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv) { MessageTuple tuple; + if (argc == 4) { + // Earlier version of of this function (GetMessage) + tuple.noun = UKPV(0); + int module = UKPV(1); + tuple.verb = UKPV(2); + tuple.cond = 0; + tuple.seq = 1; + + if (state.loadRes(s->resmgr, module, true) && state.getMessage(&tuple)) { + int len = state.getLength(); + char *buffer = kernel_dereference_char_pointer(s, argv[3], len + 1); + + if (buffer) { + state.getText(buffer); + return argv[3]; + } + } + + return NULL_REG; + } + switch (UKPV(0)) { case 0: case 2: @@ -807,25 +828,4 @@ reg_t kMessage(EngineState *s, int funct_nr, int argc, reg_t *argv) { return NULL_REG; } -reg_t kGetMessage(EngineState *s, int funct_nr, int argc, reg_t *argv) { - MessageTuple tuple; - tuple.noun = UKPV(0); - int module = UKPV(1); - tuple.verb = UKPV(2); - tuple.cond = 0; - tuple.seq = 0; - - if (state.loadRes(s->resmgr, module, true) && state.getMessage(&tuple)) { - int len = state.getLength(); - char *buffer = kernel_dereference_char_pointer(s, argv[3], len + 1); - - if (buffer) { - state.getText(buffer); - return argv[3]; - } - } - - return NULL_REG; -} - } // End of namespace Sci diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp index 3e06ee419a..0a6754fa03 100644 --- a/engines/sci/engine/message.cpp +++ b/engines/sci/engine/message.cpp @@ -33,7 +33,7 @@ void MessageState::parse(IndexRecordCursor *cursor, MessageTuple *t) { t->verb = *(cursor->index_record + 1); if (_version == 2101) { t->cond = 0; - t->seq = 0; + t->seq = 1; } else { t->cond = *(cursor->index_record + 2); t->seq = *(cursor->index_record + 3); diff --git a/engines/sci/scicore/vocab_debug.cpp b/engines/sci/scicore/vocab_debug.cpp index 70c02672b3..058c81c337 100644 --- a/engines/sci/scicore/vocab_debug.cpp +++ b/engines/sci/scicore/vocab_debug.cpp @@ -276,7 +276,7 @@ static const char *sci1_default_knames[SCI1_KNAMES_DEFAULT_ENTRIES_NR] = { /*0x79*/ "ATan", /*0x7a*/ "Lock", /*0x7b*/ "StrSplit", - /*0x7c*/ "GetMessage", + /*0x7c*/ "Message", /*0x7d*/ "IsItSkip" }; @@ -456,7 +456,7 @@ static void vocabulary_get_knames1(ResourceManager *resmgr, Common::StringList & names[i] = sci1_default_knames[i]; } -// +#ifdef ENABLE_SCI32 static void vocabulary_get_knames11(ResourceManager *resmgr, Common::StringList &names) { /* 999.voc format for SCI1.1 games: @@ -481,6 +481,7 @@ static void vocabulary_get_knames11(ResourceManager *resmgr, Common::StringList names[i] = Common::String((char *)r->data + off + 2, len); } } +#endif void vocabulary_get_knames(ResourceManager *resmgr, Common::StringList &names) { names.clear(); @@ -502,7 +503,7 @@ void vocabulary_get_knames(ResourceManager *resmgr, Common::StringList &names) { vocabulary_get_knames1(resmgr, names); break; case SCI_VERSION_1_1: - vocabulary_get_knames11(resmgr, names); + vocabulary_get_knames1(resmgr, names); break; #ifdef ENABLE_SCI32 case SCI_VERSION_32: |