diff --git a/scumm/intern.h b/scumm/intern.h index 6710d3e08d2..43f4cbe41d6 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -665,6 +665,7 @@ protected: void o72_dimArray(); void o72_dim2dimArray(); void o72_jumpToScript(); + void o72_drawObject(); void o72_stringLen(); void o72_readINI(); void o72_unknownF4(); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index d5bf4908a83..00fc4703ac1 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -597,7 +597,7 @@ void ScummEngine_v6::o6_pushWord() { } void ScummEngine_v6::o6_pushByteVar() { - push(readVar(fetchScriptByte())); + push(readVar(fetchScriptWord())); } void ScummEngine_v6::o6_pushWordVar() { diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index bd7c582604e..a7e5118a7ea 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -559,6 +559,45 @@ void ScummEngine_v72he::o72_jumpToScript() { runScript(script, (flags == 199 || flags == 200), (flags == 195 || flags == 200), args); } +void ScummEngine_v72he::o72_drawObject() { + int subOp = fetchScriptByte(); + int state = 0, y = -1, x = -1; + + switch (subOp) { + case 62: + state = pop(); + y = pop(); + x = pop(); + break; + case 63: + state = pop(); + if (state == 0) + state = 1; + break; + case 65: + state = 1; + y = pop(); + x = pop(); + default: + warning("o72_drawObject: default case %d", subOp); + } + + int object = pop(); + int objnum = getObjectIndex(object); + if (objnum == -1) + return; + + if (y != -1 && x != -1) { + _objs[objnum].x_pos = x * 8; + _objs[objnum].y_pos = y * 8; + } + + if (state != -1) { + addObjectToDrawQue(objnum); + putState(object, state); + } +} + void ScummEngine_v72he::o72_stringLen() { int a, len; byte *addr; diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp index 94b0d051a62..07b0a922824 100644 --- a/scumm/script_v7he.cpp +++ b/scumm/script_v7he.cpp @@ -511,7 +511,7 @@ void ScummEngine_v7he::o7_startSound() { break; default: - break; + error("o7_startSound invalid case %d", op); } }