aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/lingo/lingo-bytecode.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo-bytecode.cpp b/engines/director/lingo/lingo-bytecode.cpp
index f606d729a1..131dbb7c66 100644
--- a/engines/director/lingo/lingo-bytecode.cpp
+++ b/engines/director/lingo/lingo-bytecode.cpp
@@ -495,26 +495,31 @@ void Lingo::addCodeV4(Common::SeekableSubReadStreamEndian &stream, ScriptType ty
for (uint c = 0; c < argc; c++) {
switch (_lingoV4[opcode]->proto[c]) {
case 'b':
+ // read one uint8 as an argument
offsetList.push_back(_currentScript->size());
- arg = (int8)codeStore[pointer];
+ arg = (uint8)codeStore[pointer];
pointer += 1;
break;
case 'w':
+ // read one uint16 as an argument
offsetList.push_back(_currentScript->size());
offsetList.push_back(_currentScript->size());
- arg = (int16)READ_BE_UINT16(&codeStore[pointer]);
+ arg = (uint16)READ_BE_UINT16(&codeStore[pointer]);
pointer += 2;
break;
case 'v':
+ // argument refers to a variable; remove struct size alignment
if (arg % 6) {
warning("Opcode 0x%02x arg %d not a multiple of 6!", opcode, arg);
}
arg /= 6;
break;
case 'n':
+ // argument is negative
arg *= -1;
break;
case 'j':
+ // argument refers to a code offset; fix alignment in post
jumpList.push_back(offsetList.size());
break;
default: