aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBenjamin Haisch2008-06-12 11:01:08 +0000
committerBenjamin Haisch2008-06-12 11:01:08 +0000
commit555ddf9f9540bd1d62e0b2affbff4b62c284d9d1 (patch)
treec3a3d590e4dc471f5647935e39ce2fbb0d1e7e0f /engines
parent33fd755a0ebab6d3ca4e877b15c4d3d7d25877f9 (diff)
downloadscummvm-rg350-555ddf9f9540bd1d62e0b2affbff4b62c284d9d1.tar.gz
scummvm-rg350-555ddf9f9540bd1d62e0b2affbff4b62c284d9d1.tar.bz2
scummvm-rg350-555ddf9f9540bd1d62e0b2affbff4b62c284d9d1.zip
Updated script dumper to show opcode offset.
svn-id: r32668
Diffstat (limited to 'engines')
-rw-r--r--engines/made/script.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/made/script.cpp b/engines/made/script.cpp
index 4bda35dcc3..6f4ff7ace3 100644
--- a/engines/made/script.cpp
+++ b/engines/made/script.cpp
@@ -363,8 +363,7 @@ void ScriptInterpreter::cmd_set() {
void ScriptInterpreter::cmd_print() {
// TODO: This opcode was used for printing debug messages
- Object *obj = _vm->_dat->getObject(_stack.top());
- const char *text = obj->getString();
+ const char *text = _vm->_dat->getObjectString(_stack.top());
debug(4, "%s", text);
_stack.setTop(0);
}
@@ -672,7 +671,7 @@ void ScriptInterpreter::dumpScript(int16 objectIndex, int *opcodeStats, int *ext
debug(1, "Dumping code for object %04X", objectIndex);
Object *obj = _vm->_dat->getObject(objectIndex);
- byte *code = obj->getData(), *codeEnd = code + obj->getSize();
+ byte *code = obj->getData(), *codeStart = code, *codeEnd = code + obj->getSize();
while (code < codeEnd) {
byte opcode = *code++;
@@ -684,6 +683,8 @@ void ScriptInterpreter::dumpScript(int16 objectIndex, int *opcodeStats, int *ext
int16 value;
char tempStr[32];
opcodeStats[opcode - 1]++;
+ snprintf(tempStr, 32, "[%04X] ", (uint16)(code - codeStart - 1));
+ codeLine += tempStr;
codeLine += desc;
for (; *sig != '\0'; sig++) {
codeLine += " ";