SCI: Clean up the op_infoToa and op_superToa SCI3 opcodes

This commit is contained in:
Filippos Karapetis 2016-02-05 23:52:18 +02:00
parent 7ffc4f9816
commit 88e2673272
2 changed files with 19 additions and 16 deletions

View File

@ -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)

View File

@ -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