diff options
author | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-13 03:57:44 +0000 |
commit | 75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch) | |
tree | f29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/sci/engine/kstring.cpp | |
parent | 48ee83b88957dab86bc763e9ef21a70179fa8679 (diff) | |
parent | e9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff) | |
download | scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2 scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip |
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend
changes into the branch. I suppose the gp2x backend and probably all new
backends, i.e. gph, dingux etc., might not compile anymore.
Since I have no way of testing those it would be nice if porters could look
into getting those up to speed in this branch.
svn-id: r53399
Diffstat (limited to 'engines/sci/engine/kstring.cpp')
-rw-r--r-- | engines/sci/engine/kstring.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 9254bce9c1..5ea3178ae5 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -275,7 +275,7 @@ reg_t kFormat(EngineState *s, int argc, reg_t *argv) { reg = readSelector(s->_segMan, reg, SELECTOR(data)); #endif - Common::String tempsource = (reg == NULL_REG) ? "" : g_sci->getKernel()->lookupText(reg, + Common::String tempsource = g_sci->getKernel()->lookupText(reg, arguments[paramindex + 1]); int slen = strlen(tempsource.c_str()); int extralen = str_leng - slen; @@ -486,10 +486,12 @@ reg_t kMessage(EngineState *s, int argc, reg_t *argv) { } #endif - if ((func != K_MESSAGE_NEXT) && (argc < 2)) { - warning("Message: not enough arguments passed to subfunction %d", func); - return NULL_REG; - } +// TODO: Perhaps fix this check, currently doesn't work with PUSH and POP subfunctions +// Pepper uses them to to handle the glossary +// if ((func != K_MESSAGE_NEXT) && (argc < 2)) { +// warning("Message: not enough arguments passed to subfunction %d", func); +// return NULL_REG; +// } MessageTuple tuple; @@ -558,6 +560,12 @@ reg_t kMessage(EngineState *s, int argc, reg_t *argv) { return NULL_REG; } + case K_MESSAGE_PUSH: + s->_msgState->pushCursorStack(); + break; + case K_MESSAGE_POP: + s->_msgState->popCursorStack(); + break; default: warning("Message: subfunction %i invoked (not implemented)", func); } @@ -779,6 +787,20 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { return NULL_REG; } +/** + * Debug function, used in the demo of Shivers. It's marked as a stub + * in the original interpreter, but it gets called by the game scripts. + */ +reg_t kPrintDebug(EngineState *s, int argc, reg_t *argv) { + Common::String debugTemplate = s->_segMan->getString(argv[0]); + char debugString[500]; + + sprintf(debugString, debugTemplate.c_str(), argv[1].toUint16()); + debugC(2, "kPrintDebug: \"%s\"\n", debugString); + + return s->r_acc; +} + #endif } // End of namespace Sci |