aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorScott Percival2019-12-01 23:15:55 +0800
committerScott Percival2019-12-02 21:57:10 +0800
commit237a5f97a84c19d2b3aedf45bf1049413da701ba (patch)
tree67d0fa1b1cbdaedb6e9294bc33a20a9ce3c0ce8f /engines
parentf1b0c10fe4f810527e73b58642eed0e512243ae0 (diff)
downloadscummvm-rg350-237a5f97a84c19d2b3aedf45bf1049413da701ba.tar.gz
scummvm-rg350-237a5f97a84c19d2b3aedf45bf1049413da701ba.tar.bz2
scummvm-rg350-237a5f97a84c19d2b3aedf45bf1049413da701ba.zip
DIRECTOR: Comments for bytecode argument parser
Diffstat (limited to 'engines')
-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: