aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2008-03-27 16:12:48 +0000
committerJohannes Schickel2008-03-27 16:12:48 +0000
commit165c937e20853d704efd56e383e0bb3042e92ddb (patch)
treee79a04cf770a1b9cb516b69551a983840a9577dc
parent3e98286af97495aff8d6f4b5e412009ed1f59521 (diff)
downloadscummvm-rg350-165c937e20853d704efd56e383e0bb3042e92ddb.tar.gz
scummvm-rg350-165c937e20853d704efd56e383e0bb3042e92ddb.tar.bz2
scummvm-rg350-165c937e20853d704efd56e383e0bb3042e92ddb.zip
Enabled gamespeed debug command also for Kyra1.
svn-id: r31267
-rw-r--r--engines/kyra/debugger.cpp40
-rw-r--r--engines/kyra/debugger.h2
-rw-r--r--engines/kyra/kyra.h1
3 files changed, 22 insertions, 21 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp
index e80131ade8..0b4703332e 100644
--- a/engines/kyra/debugger.cpp
+++ b/engines/kyra/debugger.cpp
@@ -42,6 +42,7 @@ Debugger::Debugger(KyraEngine *vm)
DCmd_Register("screen_debug_mode", WRAP_METHOD(Debugger, cmd_setScreenDebug));
DCmd_Register("load_palette", WRAP_METHOD(Debugger, cmd_loadPalette));
DCmd_Register("facings", WRAP_METHOD(Debugger, cmd_showFacings));
+ DCmd_Register("gamespeed", WRAP_METHOD(Debugger, cmd_gameSpeed));
}
bool Debugger::cmd_setScreenDebug(int argc, const char **argv) {
@@ -63,7 +64,7 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) {
uint8 palette[768];
if (argc <= 1) {
- DebugPrintf("Use load_palette <file> [start_col] [end_col]");
+ DebugPrintf("Use load_palette <file> [start_col] [end_col]\n");
return true;
}
@@ -73,7 +74,7 @@ bool Debugger::cmd_loadPalette(int argc, const char **argv) {
memcpy(palette, _vm->screen()->getCPagePtr(5), 768);
_vm->screen()->loadPageFromDisk("TEMP", 5);
} else if (!_vm->screen()->loadPalette(argv[1], palette)) {
- DebugPrintf("Palette '%s' not found!", argv[1]);
+ DebugPrintf("ERROR: Palette '%s' not found!\n", argv[1]);
return true;
}
@@ -105,6 +106,23 @@ bool Debugger::cmd_showFacings(int argc, const char **argv) {
return true;
}
+bool Debugger::cmd_gameSpeed(int argc, const char **argv) {
+ if (argc == 2) {
+ int val = atoi(argv[1]);
+
+ if (val < 1 || val > 1000) {
+ DebugPrintf("speed must lie between 1 and 1000 (default: 60)\n");
+ return true;
+ }
+
+ _vm->_tickLength = (uint8)(1000.0 / val);
+ } else {
+ DebugPrintf("Syntax: gamespeed <value>\n");
+ }
+
+ return true;
+}
+
#pragma mark -
Debugger_v1::Debugger_v1(KyraEngine_v1 *vm)
@@ -275,7 +293,6 @@ Debugger_v2::Debugger_v2(KyraEngine_v2 *vm) : Debugger(vm), _vm(vm) {
DCmd_Register("scene_to_facing", WRAP_METHOD(Debugger_v2, cmd_sceneToFacing));
DCmd_Register("give", WRAP_METHOD(Debugger_v2, cmd_giveItem));
DCmd_Register("pass_codes", WRAP_METHOD(Debugger_v2, cmd_passcodes));
- DCmd_Register("gamespeed", WRAP_METHOD(Debugger_v2, cmd_gamespeed));
}
bool Debugger_v2::cmd_enterScene(int argc, const char **argv) {
@@ -436,22 +453,5 @@ bool Debugger_v2::cmd_passcodes(int argc, const char **argv) {
return true;
}
-bool Debugger_v2::cmd_gamespeed(int argc, const char **argv) {
- if (argc == 2) {
- int val = atoi(argv[1]);
-
- if (val < 1 || val > 1000) {
- DebugPrintf("speed must lie between 1 and 1000 (default: 60)\n");
- return true;
- }
-
- _vm->_tickLength = (uint8)(1000.0 / val);
- } else {
- DebugPrintf("Syntax: gamespeed <value>\n");
- }
-
- return true;
-}
-
} // End of namespace Kyra
diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h
index 0bbc1d5b5a..6a7b26ad93 100644
--- a/engines/kyra/debugger.h
+++ b/engines/kyra/debugger.h
@@ -45,6 +45,7 @@ protected:
bool cmd_setScreenDebug(int argc, const char **argv);
bool cmd_loadPalette(int argc, const char **argv);
bool cmd_showFacings(int argc, const char **argv);
+ bool cmd_gameSpeed(int argc, const char **argv);
};
class Debugger_v1 : public Debugger {
@@ -84,7 +85,6 @@ protected:
bool cmd_sceneToFacing(int argc, const char **argv);
bool cmd_giveItem(int argc, const char **argv);
bool cmd_passcodes(int argc, const char **argv);
- bool cmd_gamespeed(int argc, const char **argv);
};
} // End of namespace Kyra
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index 593990188f..8bb8e159b2 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -100,6 +100,7 @@ class TimerManager;
class ScriptHelper;
class KyraEngine : public Engine {
+friend class Debugger;
public:
KyraEngine(OSystem *system, const GameFlags &flags);
virtual ~KyraEngine();