aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2016-02-05 23:52:18 +0200
committerFilippos Karapetis2016-02-05 23:52:18 +0200
commit88e2673272b26c3026ad7ffc3f1977c5eb3ed546 (patch)
treedad982f019e4c6f178947170286a05e68dc159fe /engines/sci/engine
parent7ffc4f9816af09346c60363af249df7a769e1ac7 (diff)
downloadscummvm-rg350-88e2673272b26c3026ad7ffc3f1977c5eb3ed546.tar.gz
scummvm-rg350-88e2673272b26c3026ad7ffc3f1977c5eb3ed546.tar.bz2
scummvm-rg350-88e2673272b26c3026ad7ffc3f1977c5eb3ed546.zip
SCI: Clean up the op_infoToa and op_superToa SCI3 opcodes
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/vm.cpp31
-rw-r--r--engines/sci/engine/vm.h4
2 files changed, 19 insertions, 16 deletions
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 6f02c96de8..3729fc5236 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -974,21 +974,24 @@ void run_vm(EngineState *s) {
break;
- case 0x26: // (38)
- case 0x27: // (39)
- if (getSciVersion() == SCI_VERSION_3) {
- if (extOpcode == 0x4c)
- s->r_acc = obj->getInfoSelector();
- else if (extOpcode == 0x4d)
- PUSH32(obj->getInfoSelector());
- else if (extOpcode == 0x4e)
- s->r_acc = obj->getSuperClassSelector(); // TODO: is this correct?
- // TODO: There are also opcodes in
- // here to get the superclass, and possibly the species too.
- else
- error("Dummy opcode 0x%x called", opcode); // should never happen
- } else
+ case op_infoToa: // (38)
+ if (getSciVersion() < SCI_VERSION_3)
error("Dummy opcode 0x%x called", opcode); // should never happen
+
+ if (!(extOpcode & 1))
+ s->r_acc = obj->getInfoSelector();
+ else
+ PUSH32(obj->getInfoSelector());
+ break;
+
+ case op_superToa: // (39)
+ if (getSciVersion() < SCI_VERSION_3)
+ error("Dummy opcode 0x%x called", opcode); // should never happen
+
+ if (!(extOpcode & 1))
+ s->r_acc = obj->getSuperClassSelector();
+ else
+ PUSH32(obj->getSuperClassSelector());
break;
case op_class: // 0x28 (40)
diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h
index cf65803929..514bf58b64 100644
--- a/engines/sci/engine/vm.h
+++ b/engines/sci/engine/vm.h
@@ -176,8 +176,8 @@ enum SciOpcodes {
op_calle = 0x23, // 035
op_ret = 0x24, // 036
op_send = 0x25, // 037
- // dummy 0x26, // 038
- // dummy 0x27, // 039
+ op_infoToa = 0x26, // 038
+ op_superToa = 0x27, // 039
op_class = 0x28, // 040
// dummy 0x29, // 041
op_self = 0x2a, // 042