diff options
author | Travis Howell | 2004-09-12 10:23:20 +0000 |
---|---|---|
committer | Travis Howell | 2004-09-12 10:23:20 +0000 |
commit | f8c05424eaa42093befedb62a3dff2f8de1ff3ae (patch) | |
tree | f7bb3d2fd92cfe0d3710cd64bc27c2e8615c9e2e | |
parent | f8e2bcf02425d986dc76cd28e3a0e268e7b71264 (diff) | |
download | scummvm-rg350-f8c05424eaa42093befedb62a3dff2f8de1ff3ae.tar.gz scummvm-rg350-f8c05424eaa42093befedb62a3dff2f8de1ff3ae.tar.bz2 scummvm-rg350-f8c05424eaa42093befedb62a3dff2f8de1ff3ae.zip |
More HE opcodes.
Can get a bit further in pj2 now.
svn-id: r15021
-rw-r--r-- | scumm/intern.h | 4 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v90he.cpp | 75 |
3 files changed, 74 insertions, 7 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 6f1f517189..696943e82f 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -824,8 +824,10 @@ protected: void o90_unknown28(); void o90_unknown29(); void o90_unknown2F(); - void o90_unknown30(); + void o90_mod(); + void o90_unknown34(); void o90_unknown37(); + void o90_unknown9E(); }; class ScummEngine_v7 : public ScummEngine_v6 { diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 639c2ac06c..c941e7d905 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -567,7 +567,7 @@ void ScummEngine_v72he::decodeScriptString(byte *dst, bool scriptString) { if (chr == 0x64) dst += snprintf((char *)dst, 5, "%d", args[val++]); else if (chr == 0x73) - dst += addStringToStack(dst, 100, args[val++]); + dst += addStringToStack(dst, 256, args[val++]); continue; } *dst++ = chr; diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp index a6f6adfff2..0b3f07d677 100644 --- a/scumm/script_v90he.cpp +++ b/scumm/script_v90he.cpp @@ -105,12 +105,12 @@ void ScummEngine_v90he::setupOpcodes() { OPCODE(o6_invalid), OPCODE(o90_unknown2F), /* 30 */ - OPCODE(o90_unknown30), + OPCODE(o90_mod), OPCODE(o6_invalid), OPCODE(o6_invalid), OPCODE(o6_invalid), /* 34 */ - OPCODE(o72_findAllObjects), + OPCODE(o90_unknown34), OPCODE(o6_invalid), OPCODE(o6_invalid), OPCODE(o90_unknown37), @@ -242,7 +242,7 @@ void ScummEngine_v90he::setupOpcodes() { /* 9C */ OPCODE(o6_roomOps), OPCODE(o72_actorOps), - OPCODE(o72_verbOps), + OPCODE(o90_unknown9E), OPCODE(o6_getActorFromXY), /* A0 */ OPCODE(o6_findObject), @@ -804,9 +804,33 @@ void ScummEngine_v90he::o90_unknown2F() { debug(1,"o90_unknown2F stub (%d)", subOp); } -void ScummEngine_v90he::o90_unknown30() { +void ScummEngine_v90he::o90_mod() { int a = pop(); - debug(1,"o90_unknown30 stub (%d)", a); + if (a == 0) + error("modulus by zero"); + push(pop() % a); +} + +void ScummEngine_v90he::o90_unknown34() { + // Incomplete + int args[16]; + + getStackList(args, ARRAYSIZE(args)); + int room = pop(); + int i = 1; + + if (room != _currentRoom) + warning("o72_findAllObjects: current room is not %d", room); + writeVar(0, 0); + defineArray(0, kDwordArray, 0, 0, 0, _numLocalObjects + 1); + writeArray(0, 0, 0, _numLocalObjects); + + while (i < _numLocalObjects) { + writeArray(0, 0, i, _objs[i].obj_nr); + i++; + } + + push(readVar(0)); } void ScummEngine_v90he::o90_unknown37() { @@ -853,4 +877,45 @@ void ScummEngine_v90he::o90_unknown37() { debug(1,"o90_unknown37 stub"); } +void ScummEngine_v90he::o90_unknown9E() { + int subOp = fetchScriptByte(); + subOp -= 57; + + switch (subOp) { + case 0: + pop(); + break; + case 6: + pop(); + pop(); + break; + case 9: + pop(); + pop(); + pop(); + pop(); + pop(); + break; + case 13: + pop(); + pop(); + pop(); + break; + case 29: + pop(); + break; + case 118: + pop(); + pop(); + break; + case 160: + break; + case 198: + break; + default: + error("o90_unknown9E: Unknown case %d", subOp); + } + debug(1,"o90_unknown9E stub (%d)", subOp); +} + } // End of namespace Scumm |