diff options
-rw-r--r-- | engines/sci/engine/vm.cpp | 4 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 1 | ||||
-rw-r--r-- | engines/sci/sci.h | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index f645e31fb7..65577e72e3 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1941,6 +1941,10 @@ static void _init_stack_base_with_selector(EngineState *s, Selector selector) { static EngineState *_game_run(EngineState *&s, int restoring) { EngineState *successor = NULL; int game_is_finished = 0; + + if (Common::isDebugChannelEnabled(kDebugLevelOnStartup)) + ((Sci::SciEngine*)g_engine)->getSciDebugger()->attach(); + do { s->_executionStackPosChanged = false; run_vm(s, (successor || restoring) ? 1 : 0); diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index a4c1fe7e27..9db3b6a061 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -74,6 +74,7 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc) Common::addDebugChannel(kDebugLevelScripts, "Scripts", "Notifies when scripts are unloaded"); Common::addDebugChannel(kDebugLevelGC, "GC", "Garbage Collector debugging"); Common::addDebugChannel(kDebugLevelSci0Pic, "Sci0Pic", "SCI0 pic drawing debugging"); + Common::addDebugChannel(kDebugLevelOnStartup, "OnStartup", "Enter debugger at start of game"); _gamestate = 0; diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 0d798ff2b1..ac2b32bd82 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -77,7 +77,8 @@ enum kDebugLevels { kDebugLevelScripts = 1 << 19, kDebugLevelGC = 1 << 20, kDebugLevelSci0Pic = 1 << 21, - kDebugLevelResMan = 1 << 22 + kDebugLevelResMan = 1 << 22, + kDebugLevelOnStartup = 1 << 23 }; extern const char *versionNames[]; |