Skip to content

Commit

Permalink
SCI: Fix sign in disasm of relative jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
wjp committed Jun 12, 2011
1 parent 50176e7 commit 4296ac6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions engines/sci/engine/scriptdebug.cpp
Expand Up @@ -174,13 +174,15 @@ reg_t disassemble(EngineState *s, reg_t pos, bool printBWTag, bool printBytecode
break;

case Script_SRelative:
if (opsize)
param_value = scr[retval.offset++];
if (opsize) {
int8 offset = (int8)scr[retval.offset++];
debugN(" %02x [%04x]", 0xff & offset, 0xffff & (retval.offset + offset));
}
else {
param_value = READ_SCI11ENDIAN_UINT16(&scr[retval.offset]);
int16 offset = (int16)READ_SCI11ENDIAN_UINT16(&scr[retval.offset]);
retval.offset += 2;
debugN(" %04x [%04x]", 0xffff & offset, 0xffff & (retval.offset + offset));
}
debugN(opsize ? " %02x [%04x]" : " %04x [%04x]", param_value, (0xffff) & (retval.offset + param_value));
break;

case Script_End:
Expand Down

0 comments on commit 4296ac6

Please sign in to comment.