aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-10-21 18:55:40 +0200
committerWillem Jan Palenstijn2017-10-21 18:55:40 +0200
commitfab43f0f714a3bcfc314d7da66430e75c07b2a50 (patch)
tree54a6beef42018bb6aff949972492bdcd26625a57 /engines/sci/engine
parent2fea095fc7202a6707c6f5499565f125927ae544 (diff)
downloadscummvm-rg350-fab43f0f714a3bcfc314d7da66430e75c07b2a50.tar.gz
scummvm-rg350-fab43f0f714a3bcfc314d7da66430e75c07b2a50.tar.bz2
scummvm-rg350-fab43f0f714a3bcfc314d7da66430e75c07b2a50.zip
SCI: Fix offsets in disasm for multi-param opcodes
This code was assuming that retval points to the start of the next instruction, which is only true if the current parameter is the last one. This fixes op_call printing.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/scriptdebug.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index bae1fb4757..93902965d7 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -260,7 +260,7 @@ reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTa
retval.incOffset(2);
}
- const uint32 offset = findOffset(param_value, script_entity, retval.getOffset());
+ const uint32 offset = findOffset(param_value, script_entity, pos.getOffset() + bytecount);
reg_t addr;
addr.setSegment(retval.getSegment());
addr.setOffset(offset);
@@ -277,11 +277,11 @@ reg_t disassemble(EngineState *s, reg32_t pos, const Object *obj, bool printBWTa
if (opsize) {
int8 offset = (int8)scr[retval.getOffset()];
retval.incOffset(1);
- debugN("\t%02x [%04x]", 0xff & offset, kOffsetMask & (retval.getOffset() + offset));
+ debugN("\t%02x [%04x]", 0xff & offset, kOffsetMask & (pos.getOffset() + bytecount + offset));
} else {
int16 offset = (int16)READ_SCI11ENDIAN_UINT16(&scr[retval.getOffset()]);
retval.incOffset(2);
- debugN("\t%04x [%04x]", 0xffff & offset, kOffsetMask & (retval.getOffset() + offset));
+ debugN("\t%04x [%04x]", 0xffff & offset, kOffsetMask & (pos.getOffset() + bytecount + offset));
}
break;