SCI: Fix sign in disasm of relative jumps

This commit is contained in:
Willem Jan Palenstijn 2011-06-12 01:11:42 +02:00
parent 50176e7c5f
commit 4296ac6d15

View file

@ -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++];
else {
param_value = READ_SCI11ENDIAN_UINT16(&scr[retval.offset]);
retval.offset += 2;
if (opsize) {
int8 offset = (int8)scr[retval.offset++];
debugN(" %02x [%04x]", 0xff & offset, 0xffff & (retval.offset + offset));
}
else {
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: