From c325d815d295e4b51f9c53cdf646210f37508fc2 Mon Sep 17 00:00:00 2001 From: Lars Skovlund Date: Thu, 18 Nov 2010 21:41:13 +0000 Subject: SCI: Fix debugger disassembly of property accesses in SCI3 svn-id: r54348 --- engines/sci/engine/scriptdebug.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 4f89f1dd43..5ad6fbf561 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -124,11 +124,13 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode case Script_SByte: case Script_Byte: + param_value = scr[retval.offset++]; debugN(" %02x", scr[retval.offset++]); break; case Script_Word: case Script_SWord: + param_value = READ_SCI11ENDIAN_UINT16(&scr[retval.offset]); debugN(" %04x", READ_SCI11ENDIAN_UINT16(&scr[retval.offset])); retval.offset += 2; break; @@ -193,7 +195,12 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode if (!obj) warning("Attempted to reference on non-object at %04x:%04x", PRINT_REG(s->xs->objp)); else - debugN(" (%s)", g_sci->getKernel()->getSelectorName(obj->propertyOffsetToId(s->_segMan, scr[pos.offset + 1])).c_str()); + { + if (getSciVersion() == SCI_VERSION_3) + debugN(" (%s)", g_sci->getKernel()->getSelectorName(param_value).c_str()); + else + debugN(" (%s)", g_sci->getKernel()->getSelectorName(obj->propertyOffsetToId(s->_segMan, param_value)).c_str()); + } } } -- cgit v1.2.3