aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sci.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-07-07 07:21:32 +0000
committerTravis Howell2009-07-07 07:21:32 +0000
commit11717150e7c18286fa9b877830ddf5155ee99760 (patch)
tree26670c2ae71089d5748f0d47c1593dcb49b3b275 /engines/sci/sci.cpp
parentdd4b02c34aaa8f3c7a9bb0ae3ce6dd8fe8f7cb41 (diff)
parent1e568222e470eb711e1f1487de1642fd5c1725ea (diff)
downloadscummvm-rg350-11717150e7c18286fa9b877830ddf5155ee99760.tar.gz
scummvm-rg350-11717150e7c18286fa9b877830ddf5155ee99760.tar.bz2
scummvm-rg350-11717150e7c18286fa9b877830ddf5155ee99760.zip
Merged revisions 42201-42202 via svnmerge from
https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/trunk ........ r42201 | thebluegr | 2009-07-07 16:53:53 +1000 (Tue, 07 Jul 2009) | 1 line Prevent a crash when the engine errors out before the game state is initialized ........ r42202 | Kirben | 2009-07-07 17:02:04 +1000 (Tue, 07 Jul 2009) | 1 line Set the correct sound rate for Personal Nightmare. ........ svn-id: r42204
Diffstat (limited to 'engines/sci/sci.cpp')
-rw-r--r--engines/sci/sci.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 1f2e2cf1cd..7e2940dbd1 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -89,6 +89,8 @@ SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc)
Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded");
Common::addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging");
+ _gamestate = 0;
+
printf("SciEngine::SciEngine\n");
}
@@ -258,11 +260,14 @@ Common::Error SciEngine::run() {
// Invoked by error() when a severe error occurs
GUI::Debugger *SciEngine::getDebugger() {
- ExecStack *xs = &(_gamestate->_executionStack.back());
+ if (_gamestate) {
+ ExecStack *xs = &(_gamestate->_executionStack.back());
+ xs->addr.pc.offset = debugState.old_pc_offset;
+ xs->sp = debugState.old_sp;
+ }
+
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;
}