diff options
author | D G Turner | 2014-05-13 15:14:54 +0100 |
---|---|---|
committer | D G Turner | 2014-05-13 15:14:54 +0100 |
commit | e065b24d56bac1e6c929c8b9b03553055a285878 (patch) | |
tree | e24c00b08beb16c067390d31f31f94ecb16ca95b /engines | |
parent | c81d0b680eb4f65ab23f02799de3b465a5758803 (diff) | |
download | scummvm-rg350-e065b24d56bac1e6c929c8b9b03553055a285878.tar.gz scummvm-rg350-e065b24d56bac1e6c929c8b9b03553055a285878.tar.bz2 scummvm-rg350-e065b24d56bac1e6c929c8b9b03553055a285878.zip |
SCUMM: Remove "level" command from debugger. Replaced by "debuglevel".
This required a small amount of extra code changes to ensure that
_debugMode is kept in sync when the debugger is used to change the
level.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/debugger.cpp | 34 | ||||
-rw-r--r-- | engines/scumm/debugger.h | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 4 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 2 | ||||
-rw-r--r-- | engines/scumm/vars.cpp | 2 |
5 files changed, 19 insertions, 27 deletions
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp index a792d63149..3dd7b4caf5 100644 --- a/engines/scumm/debugger.cpp +++ b/engines/scumm/debugger.cpp @@ -89,7 +89,6 @@ ScummDebugger::ScummDebugger(ScummEngine *s) DCmd_Register("loadgame", WRAP_METHOD(ScummDebugger, Cmd_LoadGame)); DCmd_Register("savegame", WRAP_METHOD(ScummDebugger, Cmd_SaveGame)); - DCmd_Register("level", WRAP_METHOD(ScummDebugger, Cmd_DebugLevel)); DCmd_Register("debug", WRAP_METHOD(ScummDebugger, Cmd_Debug)); DCmd_Register("show", WRAP_METHOD(ScummDebugger, Cmd_Show)); @@ -104,6 +103,18 @@ ScummDebugger::~ScummDebugger() { // we need this destructor, even if it is empty, for __SYMBIAN32__ } +void ScummDebugger::preEnter() { +} + +void ScummDebugger::postEnter() { + // Runtime debug level change is dealt with by the base class "debuglevel" command + // but need to ensure that the _debugMode parameter is updated in sync. + _vm->_debugMode = (gDebugLevel >= 0); + // Boot params often need debugging switched on to work + if (_vm->_bootParam) + _vm->_debugMode = true; +} + /////////////////////////////////////////////////// // Now the fun stuff: @@ -523,27 +534,6 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) { return true; } -bool ScummDebugger::Cmd_DebugLevel(int argc, const char **argv) { - if (argc == 1) { - if (_vm->_debugMode == false) - DebugPrintf("Debugging is not enabled at this time\n"); - else - DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel); - } else { // set level - gDebugLevel = atoi(argv[1]); - if (gDebugLevel >= 0) { - _vm->_debugMode = true; - DebugPrintf("Debug level set to level %d\n", gDebugLevel); - } else if (gDebugLevel < 0) { - _vm->_debugMode = false; - DebugPrintf("Debugging is now disabled\n"); - } else - DebugPrintf("Not a valid debug level\n"); - } - - return true; -} - bool ScummDebugger::Cmd_Camera(int argc, const char **argv) { DebugPrintf("Camera: cur (%d,%d) - dest (%d,%d) - accel (%d,%d) -- last (%d,%d)\n", _vm->camera._cur.x, _vm->camera._cur.y, _vm->camera._dest.x, _vm->camera._dest.y, diff --git a/engines/scumm/debugger.h b/engines/scumm/debugger.h index 43bf9d6fd4..657f6be286 100644 --- a/engines/scumm/debugger.h +++ b/engines/scumm/debugger.h @@ -37,6 +37,9 @@ public: private: ScummEngine *_vm; + virtual void preEnter(); + virtual void postEnter(); + // Commands bool Cmd_Room(int argc, const char **argv); bool Cmd_LoadGame(int argc, const char **argv); @@ -58,7 +61,6 @@ private: bool Cmd_Passcode(int argc, const char **argv); bool Cmd_Debug(int argc, const char **argv); - bool Cmd_DebugLevel(int argc, const char **argv); bool Cmd_Show(int argc, const char **argv); bool Cmd_Hide(int argc, const char **argv); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 54f22ecad3..34c231e5d4 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -205,7 +205,7 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr) _lastInputScriptTime = 0; _bootParam = 0; _dumpScripts = false; - _debugMode = 0; + _debugMode = false; _objectOwnerTable = NULL; _objectRoomTable = NULL; _objectStateTable = NULL; @@ -2281,7 +2281,7 @@ void ScummEngine::scummLoop_updateScummVars() { VAR(VAR_MOUSE_Y) = _mouse.y; if (VAR_DEBUGMODE != 0xFF) { // This is NOT for the Mac version of Indy3/Loom - VAR(VAR_DEBUGMODE) = _debugMode; + VAR(VAR_DEBUGMODE) = (_debugMode ? 1 : 0); } } else if (_game.version >= 1) { // We use shifts below instead of dividing by V12_X_MULTIPLIER resp. diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index b4afa09bb2..be5a83d8c9 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -586,7 +586,7 @@ protected: bool _dumpScripts; bool _hexdumpScripts; bool _showStack; - uint16 _debugMode; + bool _debugMode; // Save/Load class - some of this may be GUI byte _saveLoadFlag, _saveLoadSlot; diff --git a/engines/scumm/vars.cpp b/engines/scumm/vars.cpp index 73028c8513..79d7ed03da 100644 --- a/engines/scumm/vars.cpp +++ b/engines/scumm/vars.cpp @@ -805,7 +805,7 @@ void ScummEngine::resetScummVars() { } if (VAR_DEBUGMODE != 0xFF) { - VAR(VAR_DEBUGMODE) = _debugMode; + VAR(VAR_DEBUGMODE) = (_debugMode ? 1 : 0); if (_game.heversion >= 80 && _debugMode) VAR(85) = 1; } |