aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2010-07-17 18:38:42 +0000
committerMax Horn2010-07-17 18:38:42 +0000
commit1d4c82885ddcc0442671c863eef643aef2dc7dda (patch)
treeaba7524c27208b07bbf2e0e598b3d1b9fd21d769 /engines/scumm
parent625af1260b2b6a28b57726564547d740fce35cad (diff)
downloadscummvm-rg350-1d4c82885ddcc0442671c863eef643aef2dc7dda.tar.gz
scummvm-rg350-1d4c82885ddcc0442671c863eef643aef2dc7dda.tar.bz2
scummvm-rg350-1d4c82885ddcc0442671c863eef643aef2dc7dda.zip
DEBUGGER: Simplify how our console debugger works / is used
* Remove _isAttached member var and isAttached method * Engines now always call the onFrame method; whether it does something is decided by the debugger class resp. its subclasses * Make detach() protected instead of private, so that subclasses can invoke it * Remove _detach_now member var (call detach() instead). * Rename _frame_countdown to _frameCountdown and properly document it. * Add more doxygen comments * Cleanup svn-id: r50963
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/debugger.cpp12
-rw-r--r--engines/scumm/scumm.cpp3
2 files changed, 5 insertions, 10 deletions
diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index ea29e25a1f..b5a4070f0b 100644
--- a/engines/scumm/debugger.cpp
+++ b/engines/scumm/debugger.cpp
@@ -62,8 +62,6 @@ ScummDebugger::ScummDebugger(ScummEngine *s)
_vm = s;
// Register variables
- DVar_Register("debug_countdown", &_frame_countdown, DVAR_INT, 0);
-
DVar_Register("scumm_speed", &_vm->_fastMode, DVAR_BYTE, 0);
DVar_Register("scumm_room", &_vm->_currentRoom, DVAR_BYTE, 0);
DVar_Register("scumm_roomresource", &_vm->_roomResource, DVAR_INT, 0);
@@ -128,7 +126,7 @@ void ScummDebugger::postEnter() {
bool ScummDebugger::Cmd_Restart(int argc, const char **argv) {
_vm->restart();
- _detach_now = true;
+ detach();
return false;
}
@@ -202,7 +200,7 @@ bool ScummDebugger::Cmd_LoadGame(int argc, const char **argv) {
_vm->requestLoad(slot);
- _detach_now = true;
+ detach();
return false;
}
@@ -867,7 +865,7 @@ bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) {
}
_vm->_bootParam = 0;
- _detach_now = true;
+ detach();
} else {
DebugPrintf("Current Passcode is %d \nUse 'passcode <SEGA CD Passcode>'\n",_vm->_scummVars[411]);
@@ -878,9 +876,7 @@ bool ScummDebugger::Cmd_Passcode(int argc, const char **argv) {
bool ScummDebugger::Cmd_ResetCursors(int argc, const char **argv) {
_vm->resetCursors();
-
- _detach_now = true;
-
+ detach();
return false;
}
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 7c3b8a4a1d..b44184f5cb 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1840,8 +1840,7 @@ Common::Error ScummEngine::go() {
while (!shouldQuit()) {
- if (_debugger->isAttached())
- _debugger->onFrame();
+ _debugger->onFrame();
// Randomize the PRNG by calling it at regular intervals. This ensures
// that it will be in a different state each time you run the program.