aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/debugger.cpp34
-rw-r--r--engines/scumm/debugger.h4
-rw-r--r--engines/scumm/scumm.cpp4
-rw-r--r--engines/scumm/scumm.h2
-rw-r--r--engines/scumm/vars.cpp2
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;
}