From 7567940ba14ef7d2277dea73161383c8d65e9ee6 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 5 Jan 2017 10:33:54 -0600 Subject: SCI32: Clean up SCI3-only opcodes SCI3 includes four new opcodes: * op_info[0x26][0] puts -info- flag in accumulator * op_infoSP[0x26][1] pushes -info- flag to stack * op_superP[0x27][0] puts -super- reference in accumulator * op_superPSP[0x27][1] pushes -super- reference to stack The implementation of these opcodes was correct already, but the opcode names given were a bit misleading (the value is not always stored to accumulator), and magic numbers were used for these opcodes in places. A review of the opcode table in Phant2 indicates that there are no other new opcodes for SCI3. --- engines/sci/engine/kernel.cpp | 6 ++---- engines/sci/engine/vm.cpp | 4 ++-- engines/sci/engine/vm.h | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 85cad99226..1845ecaac5 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -989,10 +989,8 @@ void script_adjust_opcode_formats() { } if (getSciVersion() >= SCI_VERSION_3) { - // TODO: There are also opcodes in - // here to get the superclass, and possibly the species too. - g_sci->_opcode_formats[0x4d/2][0] = Script_None; - g_sci->_opcode_formats[0x4e/2][0] = Script_None; + g_sci->_opcode_formats[op_info][0] = Script_None; + g_sci->_opcode_formats[op_superP][0] = Script_None; } #endif } diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 8e407a6ab9..74a2841521 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -1043,7 +1043,7 @@ void run_vm(EngineState *s) { break; - case op_infoToa: // (38) + case op_info: // (38) if (getSciVersion() < SCI_VERSION_3) error("Dummy opcode 0x%x called", opcode); // should never happen @@ -1053,7 +1053,7 @@ void run_vm(EngineState *s) { PUSH32(obj->getInfoSelector()); break; - case op_superToa: // (39) + case op_superP: // (39) if (getSciVersion() < SCI_VERSION_3) error("Dummy opcode 0x%x called", opcode); // should never happen diff --git a/engines/sci/engine/vm.h b/engines/sci/engine/vm.h index 13f60fd49c..18549e3a0e 100644 --- a/engines/sci/engine/vm.h +++ b/engines/sci/engine/vm.h @@ -198,8 +198,8 @@ enum SciOpcodes { op_calle = 0x23, // 035 op_ret = 0x24, // 036 op_send = 0x25, // 037 - op_infoToa = 0x26, // 038 - op_superToa = 0x27, // 039 + op_info = 0x26, // 038 + op_superP = 0x27, // 039 op_class = 0x28, // 040 // dummy 0x29, // 041 op_self = 0x2a, // 042 -- cgit v1.2.3