diff options
author | Walter van Niftrik | 2010-01-29 01:31:05 +0000 |
---|---|---|
committer | Walter van Niftrik | 2010-01-29 01:31:05 +0000 |
commit | 52ef12547feee896c632b842f5aebbdcc9c84bd8 (patch) | |
tree | 17d12d6b456d6490dfe99fac1e7e883cc46b80f1 /engines | |
parent | 5ffba8631dfba4bfb35b39a476911701b7d1034d (diff) | |
download | scummvm-rg350-52ef12547feee896c632b842f5aebbdcc9c84bd8.tar.gz scummvm-rg350-52ef12547feee896c632b842f5aebbdcc9c84bd8.tar.bz2 scummvm-rg350-52ef12547feee896c632b842f5aebbdcc9c84bd8.zip |
SCI: Added OnStartup debug flag to start the debugger at the start of the game.
svn-id: r47663
Diffstat (limited to 'engines')
-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[]; |