From 88e2673272b26c3026ad7ffc3f1977c5eb3ed546 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 5 Feb 2016 23:52:18 +0200 Subject: SCI: Clean up the op_infoToa and op_superToa SCI3 opcodes --- engines/sci/engine/vm.cpp | 31 +++++++++++++++++-------------- engines/sci/engine/vm.h | 4 ++-- 2 files changed, 19 insertions(+), 16 deletions(-) (limited to 'engines') 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 -- cgit v1.2.3