diff options
author | Colin Snover | 2017-02-16 20:42:57 -0600 |
---|---|---|
committer | Colin Snover | 2017-04-23 13:07:25 -0500 |
commit | 61fba94139c25c9c91c2f07c8282fa6aaa610a71 (patch) | |
tree | 20365c1d98e32b6cbf3f45bd40bd6a2a5f21a7cd /engines | |
parent | 0676e640dbebbe2f49aab902454b99693b1bb560 (diff) | |
download | scummvm-rg350-61fba94139c25c9c91c2f07c8282fa6aaa610a71.tar.gz scummvm-rg350-61fba94139c25c9c91c2f07c8282fa6aaa610a71.tar.bz2 scummvm-rg350-61fba94139c25c9c91c2f07c8282fa6aaa610a71.zip |
SCI: Remove dead code in Script_Offset disassembler
Script_Offset is only ever used for lofsa/lofss opcodes.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index 52281e228c..6c54890810 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -215,7 +215,9 @@ reg_t disassemble(EngineState *s, reg32_t pos, reg_t objAddr, bool printBWTag, b break; - case Script_Offset: + case Script_Offset: { + assert(opcode == op_lofsa || opcode == op_lofss); + if (opsize) { param_value = scr[retval.getOffset()]; retval.incOffset(1); @@ -224,26 +226,21 @@ reg_t disassemble(EngineState *s, reg32_t pos, reg_t objAddr, bool printBWTag, b retval.incOffset(2); } - if (opcode == op_lofsa || opcode == op_lofss) { - const uint32 offset = findOffset(param_value, script_entity, retval.getOffset()); - reg_t addr; - addr.setSegment(retval.getSegment()); - addr.setOffset(offset); - debugN("\t%s", s->_segMan->getObjectName(addr)); - debugN(opsize ? "[%02x]" : "[%04x]", offset); - } else { - debugN(opsize ? "\t%02x" : "\t%04x", param_value); - } - + const uint32 offset = findOffset(param_value, script_entity, retval.getOffset()); + reg_t addr; + addr.setSegment(retval.getSegment()); + addr.setOffset(offset); + debugN("\t%s", s->_segMan->getObjectName(addr)); + debugN(opsize ? "[%02x]" : "[%04x]", offset); break; + } case Script_SRelative: if (opsize) { int8 offset = (int8)scr[retval.getOffset()]; retval.incOffset(1); debugN("\t%02x [%04x]", 0xff & offset, kOffsetMask & (retval.getOffset() + offset)); - } - else { + } else { int16 offset = (int16)READ_SCI11ENDIAN_UINT16(&scr[retval.getOffset()]); retval.incOffset(2); debugN("\t%04x [%04x]", 0xffff & offset, kOffsetMask & (retval.getOffset() + offset)); |