Skip to content

Commit

Permalink
SCI: Clean up the op_infoToa and op_superToa SCI3 opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Feb 5, 2016
1 parent 7ffc4f9 commit 88e2673
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
31 changes: 17 additions & 14 deletions engines/sci/engine/vm.cpp
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions engines/sci/engine/vm.h
Expand Up @@ -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
Expand Down

0 comments on commit 88e2673

Please sign in to comment.