diff options
author | Filippos Karapetis | 2009-07-03 14:22:50 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-07-03 14:22:50 +0000 |
commit | 6fa8541aed68e72fd4f1cdeb13a46ec95547b275 (patch) | |
tree | 6d4fd58ddf8c42bb34ccf153273cb9e441e30534 /engines/sci/sci.cpp | |
parent | 69da51e71d71bb700a4e5e5419f64f482cb9fabc (diff) | |
download | scummvm-rg350-6fa8541aed68e72fd4f1cdeb13a46ec95547b275.tar.gz scummvm-rg350-6fa8541aed68e72fd4f1cdeb13a46ec95547b275.tar.bz2 scummvm-rg350-6fa8541aed68e72fd4f1cdeb13a46ec95547b275.zip |
- Pushed debugstate into debug.h
- When an error occurs, manipulate the execution stack before error() opens the console inside getDebugger(), like FreeSCI did. Added another method for obtaining the SCI console for use by the engine itself.
svn-id: r42062
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r-- | engines/sci/sci.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index f58d729bf6..aa9e2415f5 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -29,6 +29,7 @@ #include "engines/advancedDetector.h" #include "sci/sci.h" +#include "sci/debug.h" #include "sci/console.h" #include "sci/engine/state.h" @@ -254,7 +255,19 @@ Common::Error SciEngine::run() { return Common::kNoError; } +// Invoked by error() when a severe error occurs GUI::Debugger *SciEngine::getDebugger() { + ExecStack *xs = &(_gamestate->_executionStack.back()); + debugState.runningStep = 0; // Stop multiple execution + debugState.seeking = kDebugSeekNothing; // Stop special seeks + xs->addr.pc.offset = debugState.old_pc_offset; + xs->sp = debugState.old_sp; + + return _console; +} + +// Used to obtain the engine's console in order to print messages to it +Console *SciEngine::getSciDebugger() { return _console; } |