diff options
author | Neeraj Kumar | 2010-06-08 17:24:29 +0000 |
---|---|---|
committer | Neeraj Kumar | 2010-06-08 17:24:29 +0000 |
commit | 207a5e0779de9f0002b0b1984bde90ce6597e1f2 (patch) | |
tree | 98883ef89261afd4288f6dadbffe436d5d966dfc /engines/sci/engine/kmisc.cpp | |
parent | e00e94ae18aeb1ed460476f822e20b5bdfe171a4 (diff) | |
parent | 356728dab7f2c4cedf73684d7fe3b968be7396fd (diff) | |
download | scummvm-rg350-207a5e0779de9f0002b0b1984bde90ce6597e1f2.tar.gz scummvm-rg350-207a5e0779de9f0002b0b1984bde90ce6597e1f2.tar.bz2 scummvm-rg350-207a5e0779de9f0002b0b1984bde90ce6597e1f2.zip |
updated my outdate copy of trunk, added couple of more tests in gfxtests
svn-id: r49510
Diffstat (limited to 'engines/sci/engine/kmisc.cpp')
-rw-r--r-- | engines/sci/engine/kmisc.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp index 450dca3770..f91ba0fd82 100644 --- a/engines/sci/engine/kmisc.cpp +++ b/engines/sci/engine/kmisc.cpp @@ -32,16 +32,16 @@ #include "sci/engine/kernel.h" #include "sci/engine/gc.h" #include "sci/graphics/gui.h" +#include "sci/graphics/maciconbar.h" namespace Sci { reg_t kRestartGame(EngineState *s, int argc, reg_t *argv) { s->restarting_flags |= SCI_GAME_IS_RESTARTING_NOW; - s->restarting_flags &= ~SCI_GAME_WAS_RESTARTED_AT_LEAST_ONCE; // This appears to help - shrink_execution_stack(s, s->execution_stack_base + 1); + s->shrinkStackToBase(); - script_abort_flag = 1; // Force vm to abort ASAP + s->script_abort_flag = 1; // Force vm to abort ASAP return NULL_REG; } @@ -62,9 +62,9 @@ reg_t kGameIsRestarting(EngineState *s, int argc, reg_t *argv) { // LSL3 calculates a machinespeed variable during game startup (right after the filthy questions) // This one would go through w/o throttling resulting in having to do 1000 pushups or something // Another way of handling this would be delaying incrementing of "machineSpeed" selector - if (s->_gameId == "lsl3" && s->currentRoomNumber() == 290) + if (!strcmp(g_sci->getGameID(), "lsl3") && s->currentRoomNumber() == 290) s->_throttleTrigger = true; - if (s->_gameId == "iceman" && s->currentRoomNumber() == 27) { + if (!strcmp(g_sci->getGameID(), "iceman") && s->currentRoomNumber() == 27) { s->_throttleTrigger = true; neededSleep = 60; } @@ -252,10 +252,15 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) { break; } case K_MEMORY_PEEK : { + if (!argv[1].segment) { + // This occurs in KQ5CD when interacting with certain objects + warning("Attempt to peek invalid memory at %04x:%04x", PRINT_REG(argv[1])); + return s->r_acc; + } + SegmentRef ref = s->_segMan->dereference(argv[1]); if (!ref.isValid() || ref.maxSize < 2) { - // This occurs in KQ5CD when interacting with certain objects warning("Attempt to peek invalid memory at %04x:%04x", PRINT_REG(argv[1])); return s->r_acc; } @@ -298,9 +303,12 @@ reg_t kMemory(EngineState *s, int argc, reg_t *argv) { reg_t kIconBar(EngineState *s, int argc, reg_t *argv) { // TODO... - if (argv[0].toUint16() == 4 && argv[1].toUint16() == 0) + if (argv[0].toUint16() == 4 && argv[1].toUint16() == 0) { for (int i = 0; i < argv[2].toUint16(); i++) - warning("kIconBar: Icon Object %d = %04x:%04x", i, PRINT_REG(argv[i + 3])); + g_sci->_gfxMacIconBar->addIcon(argv[i + 3]); + + g_sci->_gfxMacIconBar->drawIcons(); + } // Other calls seem to handle selecting/deselecting them |