Exemplo n.º 1
0
        protected void FStringWidth(int opcode)
        {
            SCUMMParameter var = GetVar();
            SCUMMParameter str = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_StringWidth, var, str);
        }
Exemplo n.º 2
0
        protected void OwnerOf(int opcode)
        {
            SCUMMParameter objectNo = GetVarOrWord(opcode, 0x80);
            SCUMMParameter owner    = GetVarOrByte(opcode, 0x40);

            Add(SCUMMOpcode.C_OwnerOf, objectNo, owner);
        }
Exemplo n.º 3
0
        protected void PutActorInRoom(int opcode)
        {
            SCUMMParameter actor = GetVarOrByte(opcode, 0x80);
            SCUMMParameter room  = GetVarOrByte(opcode, 0x40);

            Add(SCUMMOpcode.C_PutActorInRoom, actor, room);
        }
Exemplo n.º 4
0
        protected void FaceTowards(int opcode)
        {
            SCUMMParameter actor  = GetVarOrByte(opcode, 0x80);
            SCUMMParameter actobj = GetVarOrWord(opcode, 0x40);

            Add(SCUMMOpcode.C_FaceTowards, actor, actobj);
        }
Exemplo n.º 5
0
        protected void IfVar(int opcode)
        {
            SCUMMParameter var      = GetVar();
            SCUMMParameter jumpDest = GetNumberSigned();

            Add(SCUMMOpcode.C_IfVar, var, jumpDest);
        }
Exemplo n.º 6
0
        protected void FSoundRunning(int opcode)
        {
            SCUMMParameter var     = GetVar();
            SCUMMParameter soundNo = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_SoundRunning, var, soundNo);
        }
Exemplo n.º 7
0
        protected void ActorElevation(int opcode)
        {
            SCUMMParameter actor     = GetVarOrByte(opcode, 0x80);
            SCUMMParameter elevation = GetVarOrByte(opcode, 0x40);

            Add(SCUMMOpcode.C_ActorElevation, actor, elevation);
        }
Exemplo n.º 8
0
        protected void WaitForStuff(int opcode)
        {
            Add(SCUMMOpcode.C_WaitForStuff);

            byte subOpcode = reader.ReadU8();

            switch (subOpcode & 0x1f)
            {
            case 0x01:
                SCUMMParameter actor = GetVarOrByte(subOpcode, 0x80);
                Add(SCUMMOpcode.SC_WaitForActor, actor);
                break;

            case 0x02:
                Add(SCUMMOpcode.SC_WaitForMessage);
                break;

            case 0x03:
                Add(SCUMMOpcode.SC_WaitForCamera);
                break;

            case 0x04:
                Add(SCUMMOpcode.SC_WaitForSentence);
                break;

            default:
                throw UnknownSubOpcode("wait-for-stuff", subOpcode);
            }
        }
Exemplo n.º 9
0
        protected void StoreByteVariable(int opcode)
        {
            SCUMMParameter var   = GetVar();
            SCUMMParameter value = GetByte();

            Add(SCUMMOpcode.C_StoreByteVariable, var, value);
        }
Exemplo n.º 10
0
        protected void PickUpObjectInRoom(int opcode)
        {
            SCUMMParameter objectNo = GetVarOrWord(opcode, 0x80);
            SCUMMParameter roomNo   = GetVarOrByte(opcode, 0x40);

            Add(SCUMMOpcode.C_PickUpObjectInRoom, objectNo, roomNo);
        }
Exemplo n.º 11
0
        protected void StateOf(int opcode)
        {
            SCUMMParameter objectNo = GetVarOrWord(opcode, 0x80);
            SCUMMParameter state    = GetVarOrByte(opcode, 0x40);

            Add(SCUMMOpcode.C_StateOf, objectNo, state);
        }
Exemplo n.º 12
0
        protected void Mul(int opcode)
        {
            SCUMMParameter var    = GetVar();
            SCUMMParameter factor = GetNumber();

            Add(SCUMMOpcode.C_MulVariable, var, factor);
        }
Exemplo n.º 13
0
        protected void Div(int opcode)
        {
            SCUMMParameter var     = GetVar();
            SCUMMParameter divisor = GetNumber();

            Add(SCUMMOpcode.C_DivVariable, var, divisor);
        }
Exemplo n.º 14
0
        protected override void ChainScript(int opcode)
        {
            SCUMMParameter scriptNo = GetVarOrByte(opcode, 0x80);
            SCUMMParameter prms     = GetParams(16, "chain-script");

            Add(SCUMMOpcode.C_ChainScript, scriptNo, prms);
        }
Exemplo n.º 15
0
        protected void FRandom(int opcode)
        {
            SCUMMParameter var = GetVar();
            SCUMMParameter max = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_Random, var, max);
        }
Exemplo n.º 16
0
        protected void StoreVariableIndirect(int opcode)
        {
            SCUMMParameter var   = GetVar();
            SCUMMParameter value = GetVarOrWord(opcode, 0x80);

            Add(SCUMMOpcode.C_StoreVariableIndirect, var, value);
        }
Exemplo n.º 17
0
        protected void FScriptRunning(int opcode)
        {
            SCUMMParameter var      = GetVar();
            SCUMMParameter scriptNo = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_ScriptRunning, var, scriptNo);
        }
Exemplo n.º 18
0
        protected void Sub(int opcode)
        {
            SCUMMParameter var  = GetVar();
            SCUMMParameter term = GetNumber();

            Add(SCUMMOpcode.C_SubVariable, var, term);
        }
Exemplo n.º 19
0
        protected void FVerbOf(int opcode)
        {
            SCUMMParameter var      = GetVar();
            SCUMMParameter objectNo = GetVarOrWord(opcode, 0x80);

            Add(SCUMMOpcode.F_OwnerOf, var, objectNo);
        }
Exemplo n.º 20
0
        protected void VerbOf(int opcode)
        {
            SCUMMParameter obj   = GetVarOrWord(opcode, 0x80);
            SCUMMParameter value = GetByte();

            Add(SCUMMOpcode.C_VerbOf, obj, value);
        }
Exemplo n.º 21
0
        protected void AddIndirect(int opcode)
        {
            SCUMMParameter var  = GetVar();
            SCUMMParameter term = GetNumber();

            Add(SCUMMOpcode.C_AddVariableIndirect, var, term);
        }
Exemplo n.º 22
0
        protected void FActorElevation(int opcode)
        {
            SCUMMParameter var   = GetVar();
            SCUMMParameter actor = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_ActorElevation, var, actor);
        }
Exemplo n.º 23
0
        protected void IfStateOf8(int opcode)
        {
            SCUMMParameter obj      = GetVarOrWord(opcode, 0x80);
            SCUMMParameter jumpDest = GetNumberSigned();

            Add(SCUMMOpcode.C_IfStateOf8, obj, jumpDest);
        }
Exemplo n.º 24
0
        protected void FActorMoving(int opcode)
        {
            SCUMMParameter var     = GetVar();
            SCUMMParameter actorNo = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_ActorMoving, var, actorNo);
        }
Exemplo n.º 25
0
        protected void NewNameOf(int opcode)
        {
            SCUMMParameter obj = GetVarOrWord(opcode, 0x80);
            SCUMMParameter str = GetString();

            Add(SCUMMOpcode.C_NewNameOf, obj, str);
        }
Exemplo n.º 26
0
        protected virtual void FActorY(int opcode)
        {
            SCUMMParameter var   = GetVar();
            SCUMMParameter actor = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_ActorY, var, actor);
        }
Exemplo n.º 27
0
        protected void PutActorAtObject(int opcode)
        {
            SCUMMParameter actorNo  = GetVarOrByte(opcode, 0x80);
            SCUMMParameter objectNo = GetVarOrWord(opcode, 0x40);

            Add(SCUMMOpcode.C_PutActorAtObject, actorNo, objectNo);
        }
Exemplo n.º 28
0
        protected void FClosestActor(int opcode)
        {
            SCUMMParameter var      = GetVar();
            SCUMMParameter objectNo = GetVarOrWord(opcode, 0x80);

            Add(SCUMMOpcode.F_ClosestActor, var, objectNo);
        }
Exemplo n.º 29
0
        protected virtual void SayLine(int opcode)
        {
            SCUMMParameter actorNo = GetVarOrByte(opcode, 0x80);
            SCUMMParameter line    = GetString();

            if (actorNo.Type == SCUMMParameterType.Number && Convert.ToInt32(actorNo.Value) >= 252)
            {
                int actorNoValue = Convert.ToInt32(actorNo.Value);
                switch (actorNoValue)
                {
                // TODO: These should have "Simple" opcode variations
                case 252: Add(SCUMMOpcode.C_PrintSystem, line); break;

                case 253: Add(SCUMMOpcode.C_PrintDebug, line); break;

                case 254: Add(SCUMMOpcode.C_PrintText, line); break;

                case 255: Add(SCUMMOpcode.C_PrintLine, line); break;
                }
            }
            else
            {
                Add(SCUMMOpcode.C_SayLineSimple, actorNo, line);
            }
        }
Exemplo n.º 30
0
        protected void FStateOf(int opcode)
        {
            SCUMMParameter var      = GetVar();
            SCUMMParameter objectNo = GetVarOrByte(opcode, 0x80);

            Add(SCUMMOpcode.F_StateOf, var, objectNo);
        }