diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/console.cpp | 36 | ||||
-rw-r--r-- | engines/sci/console.h | 2 |
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); |