aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-27 20:38:41 +0000
committerMartin Kiewitz2010-06-27 20:38:41 +0000
commit0436f2823d7c83fa76d68fba3c18a7fcc4a29173 (patch)
tree50824ab572af59e559fbbe00879d9cc25dd8f8ea /engines/sci
parent7078655de0511522dd6baaa7c91977376638f3c5 (diff)
downloadscummvm-rg350-0436f2823d7c83fa76d68fba3c18a7fcc4a29173.tar.gz
scummvm-rg350-0436f2823d7c83fa76d68fba3c18a7fcc4a29173.tar.bz2
scummvm-rg350-0436f2823d7c83fa76d68fba3c18a7fcc4a29173.zip
SCI: added additional output to vmvars command
svn-id: r50395
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp36
-rw-r--r--engines/sci/console.h2
2 files changed, 36 insertions, 2 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index 958f43ee6c..37d859cc7c 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -2054,9 +2054,11 @@ bool Console::cmdVMVars(int argc, const char **argv) {
if (!setValue) {
if (varType == 4)
- DebugPrintf("%s == %04x:%04x\n", varNames[varType], PRINT_REG(*curValue));
+ DebugPrintf("%s == %04x:%04x", varNames[varType], PRINT_REG(*curValue));
else
- DebugPrintf("%s var %d == %04x:%04x\n", varNames[varType], varIndex, PRINT_REG(*curValue));
+ DebugPrintf("%s var %d == %04x:%04x", varNames[varType], varIndex, PRINT_REG(*curValue));
+ printBasicVarInfo(*curValue);
+ DebugPrintf("\n");
} else {
if (parse_reg_t(s, setValue, curValue, true)) {
DebugPrintf("Invalid value/address passed.\n");
@@ -3207,6 +3209,36 @@ static int parse_reg_t(EngineState *s, const char *str, reg_t *dest, bool mayBeV
return 0;
}
+void Console::printBasicVarInfo(reg_t variable) {
+ int segType = g_sci->getKernel()->findRegType(variable);
+ SegManager *segMan = g_sci->getEngineState()->_segMan;
+
+ segType &= KSIG_ARITHMETIC | KSIG_OBJECT | KSIG_REF | KSIG_NODE | KSIG_LIST;
+
+ switch (segType) {
+ case KSIG_ARITHMETIC: {
+ uint16 content = variable.toUint16();
+ if (content >= 10)
+ DebugPrintf(" (%dd)", content);
+ break;
+ }
+ case KSIG_OBJECT:
+ DebugPrintf(" (object '%s')", segMan->getObjectName(variable));
+ break;
+ case KSIG_REF:
+ DebugPrintf(" (reference)");
+ break;
+ case KSIG_NODE:
+ DebugPrintf(" (node)");
+ break;
+ case KSIG_LIST:
+ DebugPrintf(" (list)");
+ break;
+ default:
+ DebugPrintf(" (???)");
+ }
+}
+
void Console::printList(List *list) {
reg_t pos = list->first;
reg_t my_prev = NULL_REG;
diff --git a/engines/sci/console.h b/engines/sci/console.h
index c180875364..2948e348d8 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -146,6 +146,8 @@ private:
bool cmdViewActiveObject(int argc, const char **argv);
bool cmdViewAccumulatorObject(int argc, const char **argv);
+ void printBasicVarInfo(reg_t variable);
+
bool segmentInfo(int nr);
void printList(List *list);
int printNode(reg_t addr);