diff options
author | Filippos Karapetis | 2007-09-13 15:49:40 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-09-13 15:49:40 +0000 |
commit | afb3c693bef2b4146c906362fdc49f0da85a96cb (patch) | |
tree | 21c98c3c1ab744b653fd591b1ecbcad8ff47b1e2 /engines | |
parent | 84393ab95e7d72484f5c612cee298f91e90221bd (diff) | |
download | scummvm-rg350-afb3c693bef2b4146c906362fdc49f0da85a96cb.tar.gz scummvm-rg350-afb3c693bef2b4146c906362fdc49f0da85a96cb.tar.bz2 scummvm-rg350-afb3c693bef2b4146c906362fdc49f0da85a96cb.zip |
Added debug commands for the global flags in IHNM
svn-id: r28898
Diffstat (limited to 'engines')
-rw-r--r-- | engines/saga/console.cpp | 83 | ||||
-rw-r--r-- | engines/saga/console.h | 4 |
2 files changed, 87 insertions, 0 deletions
diff --git a/engines/saga/console.cpp b/engines/saga/console.cpp index 421245ab30..ee5635d1ef 100644 --- a/engines/saga/console.cpp +++ b/engines/saga/console.cpp @@ -75,6 +75,11 @@ Console::Console(SagaEngine *vm) : GUI::Debugger() { // Panel commands DCmd_Register("current_panel_mode", WRAP_METHOD(Console, cmdCurrentPanelMode)); DCmd_Register("set_panel_mode", WRAP_METHOD(Console, cmdSetPanelMode)); + + // Global flags commands + DCmd_Register("global_flags_info", WRAP_METHOD(Console, cmdGlobalFlagsInfo)); + DCmd_Register("set_global_flag", WRAP_METHOD(Console, cmdSetGlobalFlag)); + DCmd_Register("clear_global_flag", WRAP_METHOD(Console, cmdClearGlobalFlag)); } Console::~Console() { @@ -158,4 +163,82 @@ bool Console::cmdSetPanelMode(int argc, const char **argv) { return true; } +bool Console::cmdGlobalFlagsInfo(int argc, const char **argv) { + DebugPrintf("Global flags status for IHNM:\n"); + + // Global flags in IHNM: + // 00: Unknown + // 01: Unknown + // 02: Unknown + // 03: Unknown + // 04: Unknown + // 05: Unknown + // 06: Unknown + // 07: Unknown + // 08: Unknown + // 09: Unknown + // 10: Unknown + // 11: Unknown + // 12: Unknown + // 13: Unknown + // 14: Unknown + // 15: Unknown + // 16: Used in the final chapter. If it's 0 when a character dies, the "bad" ending for that character is shown + // 17: Unknown + // 18: Unknown + // 19: Unknown, used in the final chapter + // 20: Unknown + // 21: Unknown + // 22: Unknown + // 23: Unknown + // 24: Unknown + // 25: Unknown + // 26: Unknown + // 27: Unknown + // 28: Unknown + // 29: Unknown + // 30: Unknown + // 31: Unknown + + int i = 0, k = 0, flagStatus = 0; + + for (i = 0; i < 32; i += 8) { + for (k = i; k < i + 8; k ++) { + flagStatus = _vm->_globalFlags & (1 << k) ? 1 : 0; + _vm->_console->DebugPrintf("%02d: %u |", k, flagStatus); + } + _vm->_console->DebugPrintf("\n"); + } + + return true; +} + +bool Console::cmdSetGlobalFlag(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Usage: %s <Global flag number>\nValid flag numbers are 0 - 31\n", argv[0]); + } else { + int flagNumber = atoi(argv[1]); + if (flagNumber >= 0 && flagNumber <= 31) { + _vm->_globalFlags |= (1 << flagNumber); + } else { + DebugPrintf("Valid flag numbers are 0 - 31\n"); + } + } + return true; +} + +bool Console::cmdClearGlobalFlag(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Usage: %s <Global flag number>\nValid flag numbers are 0 - 31\n", argv[0]); + } else { + int flagNumber = atoi(argv[1]); + if (flagNumber >= 0 && flagNumber <= 31) { + _vm->_globalFlags &= ~(1 << flagNumber); + } else { + DebugPrintf("Valid flag numbers are 0 - 31\n"); + } + } + return true; +} + } // End of namespace Saga diff --git a/engines/saga/console.h b/engines/saga/console.h index 3db9833f22..f2f883a63c 100644 --- a/engines/saga/console.h +++ b/engines/saga/console.h @@ -55,6 +55,10 @@ private: bool cmdCurrentPanelMode(int argc, const char **argv); bool cmdSetPanelMode(int argc, const char **argv); + bool cmdGlobalFlagsInfo(int argc, const char **argv); + bool cmdSetGlobalFlag(int argc, const char **argv); + bool cmdClearGlobalFlag(int argc, const char **argv); + private: SagaEngine *_vm; }; |