[Scummvm-cvs-logs] scummvm master -> e0b82f0ced3ca965c490cea8d0bc060de7a8c4ba

lordhoto lordhoto at gmail.com
Sat May 17 04:43:49 CEST 2014


This automated email contains information about 16 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
bc7af1de19 GUI: Add "debuglevel" command to Debugger base class.
1506b96bd0 AGOS: Remove redundant "level" command from debugger.
0844ba0dde PARALLACTION: Remove leftover "debugLevel" command prototype.
6856b09d5a AGOS: Switch opcode debugging to a debug flag, rather than level 2 hack.
be68682946 AGOS: Switch VGA opcode debugging to debug flag, rather than level 3.
0c9390fb27 AGOS: Remove leftover unused _debugMode variable.
55d8a46177 AGOS: Switch script debugging to debug flag, rather than level 4.
41da9a2df7 AGOS: Change "script" debugflag to "subroutine" as more accurate.
3d3a791085 AGOS: Switch VGA script debug output to debug flag, rather than level 5.
b32ca0aaae AGOS: Add image dumping to file enable by debugflag.
c81d0b680e GUI: Minor further fixes to "debuglevel" command in Debugger base class.
e065b24d56 SCUMM: Remove "level" command from debugger. Replaced by "debuglevel".
bac58f3e18 GUI: Clarify "debuglevel" command output in Debugger base class.
fbb923daee GUI: Add usage for "debuglevel" command output in Debugger base class.
f7b5c50064 AGOS: Disable image_dump debug command.
e0b82f0ced Merge pull request #462 from digitall/debugConsoleChangeLevel


Commit: bc7af1de19e249c2928dd8df9da6250334a9b652
    https://github.com/scummvm/scummvm/commit/bc7af1de19e249c2928dd8df9da6250334a9b652
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-10T17:12:14+01:00

Commit Message:
GUI: Add "debuglevel" command to Debugger base class.

This allows the debug level to be changed at runtime from the debug
console.

Changed paths:
    gui/debugger.cpp
    gui/debugger.h



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 2ec9937..832f49f 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -61,6 +61,7 @@ Debugger::Debugger() {
 	DCmd_Register("help",				WRAP_METHOD(Debugger, Cmd_Help));
 	DCmd_Register("openlog",			WRAP_METHOD(Debugger, Cmd_OpenLog));
 
+	DCmd_Register("debuglevel",		WRAP_METHOD(Debugger, Cmd_DebugLevel));
 	DCmd_Register("debugflag_list",		WRAP_METHOD(Debugger, Cmd_DebugFlagsList));
 	DCmd_Register("debugflag_enable",	WRAP_METHOD(Debugger, Cmd_DebugFlagEnable));
 	DCmd_Register("debugflag_disable",	WRAP_METHOD(Debugger, Cmd_DebugFlagDisable));
@@ -501,6 +502,22 @@ bool Debugger::Cmd_OpenLog(int argc, const char **argv) {
 }
 
 
+bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
+	if (argc == 1) {
+		DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel);
+	} else { // set level
+		gDebugLevel = atoi(argv[1]);
+		if (gDebugLevel >= 0 && gDebugLevel < 11) {
+			DebugPrintf("Debug level set to level %d\n", gDebugLevel);
+		} else if (gDebugLevel < 0) {
+			DebugPrintf("Debugging is now disabled\n");
+		} else
+			DebugPrintf("Not a valid debug level (0 - 10)\n");
+	}
+
+	return true;
+}
+
 bool Debugger::Cmd_DebugFlagsList(int argc, const char **argv) {
 	const Common::DebugManager::DebugChannelList &debugLevels = DebugMan.listDebugChannels();
 
diff --git a/gui/debugger.h b/gui/debugger.h
index 4ce5481..7481f89 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -193,6 +193,7 @@ protected:
 	bool Cmd_Exit(int argc, const char **argv);
 	bool Cmd_Help(int argc, const char **argv);
 	bool Cmd_OpenLog(int argc, const char **argv);
+	bool Cmd_DebugLevel(int argc, const char **argv);
 	bool Cmd_DebugFlagsList(int argc, const char **argv);
 	bool Cmd_DebugFlagEnable(int argc, const char **argv);
 	bool Cmd_DebugFlagDisable(int argc, const char **argv);


Commit: 1506b96bd0fd65682a90ed594e838182922055b1
    https://github.com/scummvm/scummvm/commit/1506b96bd0fd65682a90ed594e838182922055b1
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-10T17:25:35+01:00

Commit Message:
AGOS: Remove redundant "level" command from debugger.

The base class "debuglevel" command now provides the same functionality.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/debugger.cpp
    engines/agos/debugger.h



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 7266c75..2fc8977 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -243,7 +243,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	_backFlag = false;
 
-	_debugMode = 0;
 	_dumpScripts = false;
 	_dumpOpcodes = false;
 	_dumpVgaScripts = false;
@@ -676,7 +675,6 @@ Common::Error AGOSEngine::init() {
 	}
 
 	// TODO: Use special debug levels instead of the following hack.
-	_debugMode = (gDebugLevel >= 0);
 	switch (gDebugLevel) {
 	case 2: _dumpOpcodes    = true; break;
 	case 3: _dumpVgaOpcodes = true; break;
diff --git a/engines/agos/debugger.cpp b/engines/agos/debugger.cpp
index 512137b..b5233be 100644
--- a/engines/agos/debugger.cpp
+++ b/engines/agos/debugger.cpp
@@ -33,7 +33,6 @@ Debugger::Debugger(AGOSEngine *vm)
 	_vm = vm;
 
 	DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
-	DCmd_Register("level",    WRAP_METHOD(Debugger, Cmd_DebugLevel));
 	DCmd_Register("music",    WRAP_METHOD(Debugger, Cmd_PlayMusic));
 	DCmd_Register("sound",    WRAP_METHOD(Debugger, Cmd_PlaySound));
 	DCmd_Register("voice",    WRAP_METHOD(Debugger, Cmd_PlayVoice));
@@ -48,28 +47,6 @@ Debugger::Debugger(AGOSEngine *vm)
 
 }
 
-
-bool Debugger::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 (0 <= gDebugLevel && gDebugLevel < 11) {
-			_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 (0 - 10)\n");
-	}
-
-	return true;
-}
-
 bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
 	if (argc > 1) {
 		uint music = atoi(argv[1]);
diff --git a/engines/agos/debugger.h b/engines/agos/debugger.h
index caac6e2..0261944 100644
--- a/engines/agos/debugger.h
+++ b/engines/agos/debugger.h
@@ -37,7 +37,6 @@ public:
 private:
 	AGOSEngine *_vm;
 
-	bool Cmd_DebugLevel(int argc, const char **argv);
 	bool Cmd_PlayMusic(int argc, const char **argv);
 	bool Cmd_PlaySound(int argc, const char **argv);
 	bool Cmd_PlayVoice(int argc, const char **argv);


Commit: 0844ba0ddeb9b3560660d275cc999b14055e285c
    https://github.com/scummvm/scummvm/commit/0844ba0ddeb9b3560660d275cc999b14055e285c
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-10T19:02:50+01:00

Commit Message:
PARALLACTION: Remove leftover "debugLevel" command prototype.

Changed paths:
    engines/parallaction/debug.h



diff --git a/engines/parallaction/debug.h b/engines/parallaction/debug.h
index 887d08e..551d746 100644
--- a/engines/parallaction/debug.h
+++ b/engines/parallaction/debug.h
@@ -22,7 +22,6 @@ private:
 	Parallaction *_vm;
 	MouseTriState _mouseState;
 
-	bool Cmd_DebugLevel(int argc, const char **argv);
 	bool Cmd_Location(int argc, const char **argv);
 	bool Cmd_Give(int argc, const char **argv);
 	bool Cmd_Zones(int argc, const char **argv);


Commit: 6856b09d5a0024397895984aeb8d79d4a77e9111
    https://github.com/scummvm/scummvm/commit/6856b09d5a0024397895984aeb8d79d4a77e9111
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-11T12:27:38+01:00

Commit Message:
AGOS: Switch opcode debugging to a debug flag, rather than level 2 hack.

This is now set by --debugflags=opcode rather than -d 2, though it will
still require a debug level greater than 0.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/script.cpp
    engines/agos/subroutine.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 2fc8977..8754b11 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -21,6 +21,7 @@
  */
 
 #include "common/config-manager.h"
+#include "common/debug-channels.h"
 #include "common/file.h"
 #include "common/fs.h"
 #include "common/textconsole.h"
@@ -144,6 +145,8 @@ AGOSEngine_Elvira1::AGOSEngine_Elvira1(OSystem *system, const AGOSGameDescriptio
 AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	: Engine(system), _rnd("agos"), _gameDescription(gd) {
 
+	DebugMan.addDebugChannel(kDebugOpcode, "opcode", "Opcode debug level");
+
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
 	_gameOffsetsPtr = 0;
@@ -244,7 +247,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	_backFlag = false;
 
 	_dumpScripts = false;
-	_dumpOpcodes = false;
 	_dumpVgaScripts = false;
 	_dumpVgaOpcodes = false;
 	_dumpImages = false;
@@ -676,7 +678,6 @@ Common::Error AGOSEngine::init() {
 
 	// TODO: Use special debug levels instead of the following hack.
 	switch (gDebugLevel) {
-	case 2: _dumpOpcodes    = true; break;
 	case 3: _dumpVgaOpcodes = true; break;
 	case 4: _dumpScripts    = true; break;
 	case 5: _dumpVgaScripts = true; break;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 5e49fce..c23f16b 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -61,6 +61,10 @@ struct Surface;
 
 namespace AGOS {
 
+enum {
+	kDebugOpcode = 1 << 0
+};
+
 uint fileReadItemID(Common::SeekableReadStream *in);
 
 #define CHECK_BOUNDS(x, y) assert((uint)(x) < ARRAYSIZE(y))
@@ -329,7 +333,6 @@ protected:
 	bool _copyProtection;
 	bool _pause;
 	bool _dumpScripts;
-	bool _dumpOpcodes;
 	bool _dumpVgaScripts;
 	bool _dumpVgaOpcodes;
 	bool _dumpImages;
diff --git a/engines/agos/script.cpp b/engines/agos/script.cpp
index 6f809d9..1dbb9c2 100644
--- a/engines/agos/script.cpp
+++ b/engines/agos/script.cpp
@@ -22,6 +22,7 @@
 
 // Item script opcodes for Simon1/Simon2
 
+#include "common/debug-channels.h"
 #include "common/endian.h"
 #include "common/system.h"
 #include "common/textconsole.h"
@@ -987,7 +988,7 @@ int AGOSEngine::runScript() {
 		return 1;
 
 	do {
-		if (_dumpOpcodes)
+		if (DebugMan.isDebugChannelEnabled(kDebugOpcode))
 			dumpOpcode(_codePtr);
 
 		if (getGameType() == GType_ELVIRA1) {
diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index 39bc468..a54a6c3 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -564,8 +564,7 @@ restart:
 			else
 				_codePtr += 8;
 
-			if (_dumpOpcodes)
-				debug("; %d", sub->id);
+				debugC(kDebugOpcode, "; %d", sub->id);
 			result = runScript();
 			if (result != 0) {
 				break;


Commit: be686829469b1007f3dec00f658431774a734189
    https://github.com/scummvm/scummvm/commit/be686829469b1007f3dec00f658431774a734189
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-11T12:46:55+01:00

Commit Message:
AGOS: Switch VGA opcode debugging to debug flag, rather than level 3.

This is now set by --debugflags=vga_opcode rather than -d 3, though it
will still require a debug level greater than 0.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/vga.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 8754b11..8093112 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -146,6 +146,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	: Engine(system), _rnd("agos"), _gameDescription(gd) {
 
 	DebugMan.addDebugChannel(kDebugOpcode, "opcode", "Opcode debug level");
+	DebugMan.addDebugChannel(kDebugVGAOpcode, "vga_opcode", "VGA Opcode debug level");
 
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
@@ -248,7 +249,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	_dumpScripts = false;
 	_dumpVgaScripts = false;
-	_dumpVgaOpcodes = false;
 	_dumpImages = false;
 
 	_copyProtection = false;
@@ -678,7 +678,6 @@ Common::Error AGOSEngine::init() {
 
 	// TODO: Use special debug levels instead of the following hack.
 	switch (gDebugLevel) {
-	case 3: _dumpVgaOpcodes = true; break;
 	case 4: _dumpScripts    = true; break;
 	case 5: _dumpVgaScripts = true; break;
 	}
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index c23f16b..cfe84de 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -62,7 +62,8 @@ struct Surface;
 namespace AGOS {
 
 enum {
-	kDebugOpcode = 1 << 0
+	kDebugOpcode = 1 << 0,
+	kDebugVGAOpcode = 1 << 1
 };
 
 uint fileReadItemID(Common::SeekableReadStream *in);
@@ -334,7 +335,6 @@ protected:
 	bool _pause;
 	bool _dumpScripts;
 	bool _dumpVgaScripts;
-	bool _dumpVgaOpcodes;
 	bool _dumpImages;
 	bool _speech;
 	bool _subtitles;
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index c656c01..3119179 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -27,6 +27,7 @@
 #include "agos/intern.h"
 #include "agos/vga.h"
 
+#include "common/debug-channels.h"
 #include "common/endian.h"
 #include "common/system.h"
 #include "common/textconsole.h"
@@ -152,7 +153,7 @@ void AGOSEngine::runVgaScript() {
 	for (;;) {
 		uint opcode;
 
-		if (_dumpVgaOpcodes) {
+		if (DebugMan.isDebugChannelEnabled(kDebugVGAOpcode)) {
 			if (_vcPtr != (const byte *)&_vcGetOutOfCode) {
 				debugN("%.5d %.5X: %5d %4d ", _vgaTickCounter, (unsigned int)(_vcPtr - _curVgaFile1), _vgaCurSpriteId, _vgaCurZoneNum);
 				dumpVideoScript(_vcPtr, true);
@@ -381,8 +382,7 @@ void AGOSEngine::vcSkipNextInstruction() {
 		_vcPtr += opcodeParamLenPN[opcode];
 	}
 
-	if (_dumpVgaOpcodes)
-		debugN("; skipped\n");
+	debugCN(kDebugVGAOpcode, "; skipped\n");
 }
 
 // VGA Script commands


Commit: 0c9390fb271bf49377443d9712a270ada4210249
    https://github.com/scummvm/scummvm/commit/0c9390fb271bf49377443d9712a270ada4210249
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-11T13:15:53+01:00

Commit Message:
AGOS: Remove leftover unused _debugMode variable.

Changed paths:
    engines/agos/agos.h



diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index cfe84de..3eff6a8 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -329,7 +329,6 @@ protected:
 	bool _fastMode;
 	bool _backFlag;
 
-	uint16 _debugMode;
 	Common::Language _language;
 	bool _copyProtection;
 	bool _pause;


Commit: 55d8a461774f24db3f6f9a428469ca11353707e5
    https://github.com/scummvm/scummvm/commit/55d8a461774f24db3f6f9a428469ca11353707e5
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-11T13:17:16+01:00

Commit Message:
AGOS: Switch script debugging to debug flag, rather than level 4.

This is now set by --debugflags=script rather than -d 4, though
it will still require a debug level greater than 0.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/subroutine.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 8093112..cf444bc 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -147,6 +147,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	DebugMan.addDebugChannel(kDebugOpcode, "opcode", "Opcode debug level");
 	DebugMan.addDebugChannel(kDebugVGAOpcode, "vga_opcode", "VGA Opcode debug level");
+	DebugMan.addDebugChannel(kDebugScript, "script", "Script debug level");
 
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
@@ -247,7 +248,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	_backFlag = false;
 
-	_dumpScripts = false;
 	_dumpVgaScripts = false;
 	_dumpImages = false;
 
@@ -678,7 +678,6 @@ Common::Error AGOSEngine::init() {
 
 	// TODO: Use special debug levels instead of the following hack.
 	switch (gDebugLevel) {
-	case 4: _dumpScripts    = true; break;
 	case 5: _dumpVgaScripts = true; break;
 	}
 
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 3eff6a8..e1d7a54 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -63,7 +63,8 @@ namespace AGOS {
 
 enum {
 	kDebugOpcode = 1 << 0,
-	kDebugVGAOpcode = 1 << 1
+	kDebugVGAOpcode = 1 << 1,
+	kDebugScript = 1 << 2
 };
 
 uint fileReadItemID(Common::SeekableReadStream *in);
@@ -332,7 +333,6 @@ protected:
 	Common::Language _language;
 	bool _copyProtection;
 	bool _pause;
-	bool _dumpScripts;
 	bool _dumpVgaScripts;
 	bool _dumpImages;
 	bool _speech;
diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index a54a6c3..f7eec9c 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -20,8 +20,7 @@
  *
  */
 
-
-
+#include "common/debug-channels.h"
 #include "common/file.h"
 #include "common/textconsole.h"
 
@@ -531,7 +530,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
 	_classMode1 = 0;
 	_classMode2 = 0;
 
-	if (_dumpScripts)
+	if (DebugMan.isDebugChannelEnabled(kDebugScript))
 		dumpSubroutine(sub);
 
 	if (++_recursionDepth > 40)


Commit: 41da9a2df798112cc71bae401ed0202e3a605ea7
    https://github.com/scummvm/scummvm/commit/41da9a2df798112cc71bae401ed0202e3a605ea7
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-11T13:28:33+01:00

Commit Message:
AGOS: Change "script" debugflag to "subroutine" as more accurate.

This flag is used to enable dumping of subroutine scripts at start.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/subroutine.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index cf444bc..8763872 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -147,7 +147,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	DebugMan.addDebugChannel(kDebugOpcode, "opcode", "Opcode debug level");
 	DebugMan.addDebugChannel(kDebugVGAOpcode, "vga_opcode", "VGA Opcode debug level");
-	DebugMan.addDebugChannel(kDebugScript, "script", "Script debug level");
+	DebugMan.addDebugChannel(kDebugSubroutine, "subroutine", "Subroutine debug level");
 
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index e1d7a54..43afdb7 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -64,7 +64,7 @@ namespace AGOS {
 enum {
 	kDebugOpcode = 1 << 0,
 	kDebugVGAOpcode = 1 << 1,
-	kDebugScript = 1 << 2
+	kDebugSubroutine = 1 << 2
 };
 
 uint fileReadItemID(Common::SeekableReadStream *in);
diff --git a/engines/agos/subroutine.cpp b/engines/agos/subroutine.cpp
index f7eec9c..1e6ecaa 100644
--- a/engines/agos/subroutine.cpp
+++ b/engines/agos/subroutine.cpp
@@ -530,7 +530,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
 	_classMode1 = 0;
 	_classMode2 = 0;
 
-	if (DebugMan.isDebugChannelEnabled(kDebugScript))
+	if (DebugMan.isDebugChannelEnabled(kDebugSubroutine))
 		dumpSubroutine(sub);
 
 	if (++_recursionDepth > 40)


Commit: 3d3a79108514d1e5b10fc079246501925b1bc813
    https://github.com/scummvm/scummvm/commit/3d3a79108514d1e5b10fc079246501925b1bc813
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-11T15:26:58+01:00

Commit Message:
AGOS: Switch VGA script debug output to debug flag, rather than level 5.

This is now set by --debugflags=vga_script rather than -d 5, though
it will still require a debug level greater than 0.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/gfx.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 8763872..0ee6bb5 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -148,6 +148,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	DebugMan.addDebugChannel(kDebugOpcode, "opcode", "Opcode debug level");
 	DebugMan.addDebugChannel(kDebugVGAOpcode, "vga_opcode", "VGA Opcode debug level");
 	DebugMan.addDebugChannel(kDebugSubroutine, "subroutine", "Subroutine debug level");
+	DebugMan.addDebugChannel(kDebugVGAScript, "vga_script", "VGA Script debug level");
 
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
@@ -248,7 +249,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	_backFlag = false;
 
-	_dumpVgaScripts = false;
 	_dumpImages = false;
 
 	_copyProtection = false;
@@ -676,11 +676,6 @@ Common::Error AGOSEngine::init() {
 		_subtitles = true;
 	}
 
-	// TODO: Use special debug levels instead of the following hack.
-	switch (gDebugLevel) {
-	case 5: _dumpVgaScripts = true; break;
-	}
-
 	return Common::kNoError;
 }
 
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 43afdb7..e2f5100 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -64,7 +64,8 @@ namespace AGOS {
 enum {
 	kDebugOpcode = 1 << 0,
 	kDebugVGAOpcode = 1 << 1,
-	kDebugSubroutine = 1 << 2
+	kDebugSubroutine = 1 << 2,
+	kDebugVGAScript = 1 << 3
 };
 
 uint fileReadItemID(Common::SeekableReadStream *in);
@@ -333,7 +334,6 @@ protected:
 	Common::Language _language;
 	bool _copyProtection;
 	bool _pause;
-	bool _dumpVgaScripts;
 	bool _dumpImages;
 	bool _speech;
 	bool _subtitles;
diff --git a/engines/agos/gfx.cpp b/engines/agos/gfx.cpp
index 6e97084..33145b7 100644
--- a/engines/agos/gfx.cpp
+++ b/engines/agos/gfx.cpp
@@ -20,6 +20,7 @@
  *
  */
 
+#include "common/debug-channels.h"
 #include "common/endian.h"
 #include "common/system.h"
 #include "common/textconsole.h"
@@ -1129,7 +1130,7 @@ void AGOSEngine::animate(uint16 windowNum, uint16 zoneNum, uint16 vgaSpriteId, i
 		assert(READ_BE_UINT16(&((AnimationHeader_WW *) p)->id) == vgaSpriteId);
 	}
 
-	if (_dumpVgaScripts) {
+	if (DebugMan.isDebugChannelEnabled(kDebugVGAScript)) {
 		if (getGameType() == GType_FF || getGameType() == GType_PP) {
 			dumpVgaScript(_curVgaFile1 + READ_LE_UINT16(&((AnimationHeader_Feeble*)p)->scriptOffs), zoneNum, vgaSpriteId);
 		} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {
@@ -1235,7 +1236,7 @@ void AGOSEngine::setImage(uint16 vgaSpriteId, bool vgaScript) {
 		}
 	}
 
-	if (_dumpVgaScripts) {
+	if (DebugMan.isDebugChannelEnabled(kDebugVGAScript)) {
 		if (getGameType() == GType_FF || getGameType() == GType_PP) {
 			dumpVgaScript(_curVgaFile1 + READ_LE_UINT16(&((ImageHeader_Feeble*)b)->scriptOffs), zoneNum, vgaSpriteId);
 		} else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) {


Commit: b32ca0aaae88a7dbd3445a5611d4a59f0684a99b
    https://github.com/scummvm/scummvm/commit/b32ca0aaae88a7dbd3445a5611d4a59f0684a99b
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-12T00:44:13+01:00

Commit Message:
AGOS: Add image dumping to file enable by debugflag.

This previously required a code change and recompile to enable.
It can now be enabled or disabled at runtime using the "image_dump"
debug flag.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/vga.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 0ee6bb5..dab839b 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -149,6 +149,7 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	DebugMan.addDebugChannel(kDebugVGAOpcode, "vga_opcode", "VGA Opcode debug level");
 	DebugMan.addDebugChannel(kDebugSubroutine, "subroutine", "Subroutine debug level");
 	DebugMan.addDebugChannel(kDebugVGAScript, "vga_script", "VGA Script debug level");
+	DebugMan.addDebugChannel(kDebugImageDump, "image_dump", "Enable dumping of images to files");
 
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
@@ -249,8 +250,6 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 
 	_backFlag = false;
 
-	_dumpImages = false;
-
 	_copyProtection = false;
 	_pause = false;
 	_speech = false;
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index e2f5100..b6b5e42 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -65,7 +65,8 @@ enum {
 	kDebugOpcode = 1 << 0,
 	kDebugVGAOpcode = 1 << 1,
 	kDebugSubroutine = 1 << 2,
-	kDebugVGAScript = 1 << 3
+	kDebugVGAScript = 1 << 3,
+	kDebugImageDump = 1 << 4
 };
 
 uint fileReadItemID(Common::SeekableReadStream *in);
@@ -334,7 +335,6 @@ protected:
 	Common::Language _language;
 	bool _copyProtection;
 	bool _pause;
-	bool _dumpImages;
 	bool _speech;
 	bool _subtitles;
 	bool _vgaVar9;
diff --git a/engines/agos/vga.cpp b/engines/agos/vga.cpp
index 3119179..f761c3f 100644
--- a/engines/agos/vga.cpp
+++ b/engines/agos/vga.cpp
@@ -648,7 +648,7 @@ void AGOSEngine::drawImage_init(int16 image, uint16 palette, int16 x, int16 y, u
 	if (height == 0 || width == 0)
 		return;
 
-	if (_dumpImages)
+	if (DebugMan.isDebugChannelEnabled(kDebugImageDump))
 		dumpSingleBitmap(_vgaCurZoneNum, state.image, state.srcPtr, width, height,
 											 state.palette);
 	state.width = state.draw_width = width;		/* cl */


Commit: c81d0b680eb4f65ab23f02799de3b465a5758803
    https://github.com/scummvm/scummvm/commit/c81d0b680eb4f65ab23f02799de3b465a5758803
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-12T00:56:20+01:00

Commit Message:
GUI: Minor further fixes to "debuglevel" command in Debugger base class.

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 832f49f..b2ef193 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -504,15 +504,20 @@ bool Debugger::Cmd_OpenLog(int argc, const char **argv) {
 
 bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
 	if (argc == 1) {
-		DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel);
+		if (gDebugLevel < 0) {
+			DebugPrintf("Debugging is disabled\n");
+		} else {
+			DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel);
+		}
 	} else { // set level
 		gDebugLevel = atoi(argv[1]);
 		if (gDebugLevel >= 0 && gDebugLevel < 11) {
 			DebugPrintf("Debug level set to level %d\n", gDebugLevel);
 		} else if (gDebugLevel < 0) {
 			DebugPrintf("Debugging is now disabled\n");
-		} else
+		} else {
 			DebugPrintf("Not a valid debug level (0 - 10)\n");
+		}
 	}
 
 	return true;


Commit: e065b24d56bac1e6c929c8b9b03553055a285878
    https://github.com/scummvm/scummvm/commit/e065b24d56bac1e6c929c8b9b03553055a285878
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-13T15:14:54+01:00

Commit Message:
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.

Changed paths:
    engines/scumm/debugger.cpp
    engines/scumm/debugger.h
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/vars.cpp



diff --git a/engines/scumm/debugger.cpp b/engines/scumm/debugger.cpp
index a792d63..3dd7b4c 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 43bf9d6..657f6be 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 54f22ec..34c231e 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 b4afa09..be5a83d 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 73028c8..79d7ed0 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;
 	}


Commit: bac58f3e1878bed442766bc03c4f43adb1cb05de
    https://github.com/scummvm/scummvm/commit/bac58f3e1878bed442766bc03c4f43adb1cb05de
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-13T19:39:47+01:00

Commit Message:
GUI: Clarify "debuglevel" command output in Debugger base class.

This should make it clear that -1 is used for disable.

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index b2ef193..da342e2 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -503,12 +503,8 @@ bool Debugger::Cmd_OpenLog(int argc, const char **argv) {
 
 
 bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
-	if (argc == 1) {
-		if (gDebugLevel < 0) {
-			DebugPrintf("Debugging is disabled\n");
-		} else {
-			DebugPrintf("Debugging is currently set at level %d\n", gDebugLevel);
-		}
+	if (argc == 1) { // print level
+		DebugPrintf("Debugging is currently %s (set at level %d)\n", (gDebugLevel >= 0) ? "enabled" : "disabled", gDebugLevel);
 	} else { // set level
 		gDebugLevel = atoi(argv[1]);
 		if (gDebugLevel >= 0 && gDebugLevel < 11) {
@@ -516,7 +512,7 @@ bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
 		} else if (gDebugLevel < 0) {
 			DebugPrintf("Debugging is now disabled\n");
 		} else {
-			DebugPrintf("Not a valid debug level (0 - 10)\n");
+			DebugPrintf("Invalid debug level value (0 to 10 or -1 to disable)\n");
 		}
 	}
 


Commit: fbb923daee62567aa8d9a6a5b02faf647e6233fa
    https://github.com/scummvm/scummvm/commit/fbb923daee62567aa8d9a6a5b02faf647e6233fa
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-15T01:35:48+01:00

Commit Message:
GUI: Add usage for "debuglevel" command output in Debugger base class.

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index da342e2..3cfa9f9 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -505,6 +505,7 @@ bool Debugger::Cmd_OpenLog(int argc, const char **argv) {
 bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
 	if (argc == 1) { // print level
 		DebugPrintf("Debugging is currently %s (set at level %d)\n", (gDebugLevel >= 0) ? "enabled" : "disabled", gDebugLevel);
+		DebugPrintf("Usage: %s <n> where n is 0 to 10 or -1 to disable debugging\n", argv[0]);
 	} else { // set level
 		gDebugLevel = atoi(argv[1]);
 		if (gDebugLevel >= 0 && gDebugLevel < 11) {
@@ -512,7 +513,8 @@ bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
 		} else if (gDebugLevel < 0) {
 			DebugPrintf("Debugging is now disabled\n");
 		} else {
-			DebugPrintf("Invalid debug level value (0 to 10 or -1 to disable)\n");
+			DebugPrintf("Invalid debug level value\n");
+			DebugPrintf("Usage: %s <n> where n is 0 to 10 or -1 to disable debugging\n", argv[0]);
 		}
 	}
 


Commit: f7b5c500649f531de66abf7a9700254fe5527511
    https://github.com/scummvm/scummvm/commit/f7b5c500649f531de66abf7a9700254fe5527511
Author: D G Turner (digitall at scummvm.org)
Date: 2014-05-15T11:34:26+01:00

Commit Message:
AGOS: Disable image_dump debug command.

Changed paths:
    engines/agos/agos.cpp



diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index dab839b..6eda2eb 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -149,8 +149,10 @@ AGOSEngine::AGOSEngine(OSystem *system, const AGOSGameDescription *gd)
 	DebugMan.addDebugChannel(kDebugVGAOpcode, "vga_opcode", "VGA Opcode debug level");
 	DebugMan.addDebugChannel(kDebugSubroutine, "subroutine", "Subroutine debug level");
 	DebugMan.addDebugChannel(kDebugVGAScript, "vga_script", "VGA Script debug level");
+	//Image dumping command disabled as it doesn't work well
+#if 0
 	DebugMan.addDebugChannel(kDebugImageDump, "image_dump", "Enable dumping of images to files");
-
+#endif
 	_vcPtr = 0;
 	_vcGetOutOfCode = 0;
 	_gameOffsetsPtr = 0;


Commit: e0b82f0ced3ca965c490cea8d0bc060de7a8c4ba
    https://github.com/scummvm/scummvm/commit/e0b82f0ced3ca965c490cea8d0bc060de7a8c4ba
Author: Johannes Schickel (lordhoto at gmail.com)
Date: 2014-05-17T04:42:58+02:00

Commit Message:
Merge pull request #462 from digitall/debugConsoleChangeLevel

Add command to change debug level to the Debugger base class.

Changed paths:
    engines/agos/agos.cpp
    engines/agos/agos.h
    engines/agos/debugger.cpp
    engines/agos/debugger.h
    engines/agos/gfx.cpp
    engines/agos/script.cpp
    engines/agos/subroutine.cpp
    engines/agos/vga.cpp
    engines/parallaction/debug.h
    engines/scumm/debugger.cpp
    engines/scumm/debugger.h
    engines/scumm/scumm.cpp
    engines/scumm/scumm.h
    engines/scumm/vars.cpp
    gui/debugger.cpp
    gui/debugger.h









More information about the Scummvm-git-logs mailing list