Exemplo n.º 1
0
 static ScriptFunctions()
 {
     MainModule = new ScriptModule("main"); //main.scm
     MainModule.Bind <ScriptFunction>(0x0000, 0, Nope);
     MainModule.Bind <ScriptFunction>(0x0001, 1, Wait);
     MainModule.Bind <ScriptFunction>(0x0002, 1, Goto);
     MainModule.Bind <ScriptFunction>(0x0004, 2, SetVarInt);
     MainModule.Bind <ScriptFunction>(0x0005, 2, SetVarFloat);
     MainModule.Bind <ScriptFunction>(0x0006, 2, SetLVarInt);
     MainModule.Bind <ScriptFunction>(0x0007, 2, SetLVarFloat);
     MainModule.Bind <ScriptFunction>(0x0008, 2, AddValToIntVar);
     MainModule.Bind <ScriptFunction>(0x000a, 2, AddValToIntLVar);
     MainModule.Bind <ScriptFunction>(0x000b, 2, AddValToFloatLVar);
     MainModule.Bind <ScriptFunction>(0x000c, 2, SubValFromIntVar);
     MainModule.Bind <ScriptFunction>(0x000d, 2, SubValFromFloatVar);
     MainModule.Bind <ScriptFunction>(0x000e, 2, SubValFromIntLVar);
     MainModule.Bind <ScriptFunction>(0x000f, 2, SubValFromFloatLVar);
     MainModule.Bind <ScriptFunction>(0x0010, 2, MultIntVarByVal);
     MainModule.Bind <ScriptFunction>(0x0011, 2, MultFloatLVarByVal);
     MainModule.Bind <ScriptFunction>(0x0012, 2, MultIntLVarByVal);
     MainModule.Bind <ScriptFunction>(0x0013, 2, MultFloatLVarByVal);
     MainModule.Bind <ScriptFunction>(0x0014, 2, DivIntVarByVal);
     MainModule.Bind <ScriptFunction>(0x0015, 2, DivFloatVarByVal);
     MainModule.Bind <ScriptFunction>(0x0016, 2, DivIntLVarByVal);
     MainModule.Bind <ScriptFunction>(0x0017, 2, DivFloatLVarByVal);
     MainModule.Bind <ScriptFunctionBoolean>(0x0018, 2, IsIntVarGreaterThanNumber);
     MainModule.Bind <ScriptFunctionBoolean>(0x0019, 2, IsIntLVarGreaterThanNumber);
     MainModule.Bind <ScriptFunctionBoolean>(0x001a, 2, IsNumberGreaterThanIntVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x001b, 2, IsNumberGreaterThanIntLVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x001c, 2, IsIntVarGreaterThanIntVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x001d, 2, IsIntLVarGreaterThanIntLVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x001e, 2, IsIntVarGreaterThanIntLVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x001f, 2, IsIntLVarGreaterThanIntVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x0020, 2, IsFloatVarGreaterThanNumber);
     MainModule.Bind <ScriptFunctionBoolean>(0x0021, 2, IsFloatLVarGreaterThanNumber);
     MainModule.Bind <ScriptFunctionBoolean>(0x0022, 2, IsNumberGreaterThanFloatVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x0023, 2, IsNumberGreaterThanFloatLVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x0024, 2, IsFloatVarGreaterThanFloatVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x0025, 2, IsFloatLVarGreaterThanFloatLVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x0026, 2, IsFloatVarGreaterThanFloatLVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x0027, 2, IsFloatLVarGreaterThanFloatVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x0028, 2, IsIntLVarGreaterOrEqualToNumber);
     MainModule.Bind <ScriptFunctionBoolean>(0x0029, 2, IsIntVarGreaterThanIntVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x002a, 2, IsIntLVarGreaterThanIntLVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x002b, 2, IsIntLVarGreaterThanIntVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x002c, 2, IsFloatLVarGreaterThanNumber);
     MainModule.Bind <ScriptFunctionBoolean>(0x002d, 2, IsNumberGreaterOrEqualToIntVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x002e, 2, IsNumberGreaterOrEqualToIntVar);
     MainModule.Bind <ScriptFunctionBoolean>(0x002f, 2, IsIntLVarGreaterOrEqualToIntVar);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new ScriptMachine instance.
        /// TODO: Pass a GameState instance to this constructor.
        /// </summary>
        /// <param name="File">The SCMFile to interpret.</param>
        /// <param name="Module">A ScriptModule instance.</param>
        public ScriptMachine(SCMFile File, ScriptModule Module)
        {
            file      = File;
            module    = Module;
            debugFlag = false;

            uint Size = file.GlobalsSize;

            globalData = new List <char>((int)Size);
            uint Offset = file.GlobalSection;

            var GlobalDataCopy = globalData.ToArray();

            Array.Copy(file.Data.ToArray(), (int)file.GlobalSection, GlobalDataCopy, 0, (int)file.GlobalsSize);
            globalData = new List <char>(GlobalDataCopy);
        }
Exemplo n.º 3
0
 static ScriptFunctions()
 {
     MainModule = new ScriptModule("main"); //main.scm
     MainModule.Bind <ScriptFunction>(0000, 0, Nope);
     MainModule.Bind <ScriptFunction>(0001, 1, Wait);
     MainModule.Bind <ScriptFunction>(0002, 1, Goto);
     MainModule.Bind <ScriptFunction>(0004, 2, IntRightAssignment);
     MainModule.Bind <ScriptFunction>(0005, 2, FloatRightAssignment);
     MainModule.Bind <ScriptFunction>(0006, 2, IntLeftAssignment);
     MainModule.Bind <ScriptFunction>(0007, 2, FloatLeftAssignment);
     MainModule.Bind <ScriptFunction>(0008, 2, IntRightAdditionAssignment);
     MainModule.Bind <ScriptFunction>(0x000a, 2, FloatRightAdditionAssignment);
     MainModule.Bind <ScriptFunction>(0x000b, 2, IntLeftAdditionAssignment);
     MainModule.Bind <ScriptFunction>(0x000c, 2, FloatLeftAdditionAssignment);
     MainModule.Bind <ScriptFunction>(0x000d, 2, IntRightSubtractionAssignment);
     MainModule.Bind <ScriptFunction>(0x000e, 2, FloatRightSubtractionAssignment);
     MainModule.Bind <ScriptFunction>(0x000f, 2, FloatLeftSubtractionAssignment);
     MainModule.Bind <ScriptFunction>(0x0010, 2, IntRightMultiplicationAssignment);
     MainModule.Bind <ScriptFunction>(0x0011, 2, FloatRightMultiplicationAssignment);
     MainModule.Bind <ScriptFunction>(0x0012, 2, IntLeftMultiplicationAssignment);
     MainModule.Bind <ScriptFunction>(0x0013, 2, FloatLeftMultiplicationAssignment);
     MainModule.Bind <ScriptFunction>(0x0014, 2, IntRightDivisionAssignment);
     MainModule.Bind <ScriptFunction>(0x0015, 2, FloatRightDivisionAssignment);
     MainModule.Bind <ScriptFunction>(0x0016, 2, IntLeftDivisionAssignment);
     MainModule.Bind <ScriptFunction>(0x0017, 2, FloatLeftDivisionAssignment);
     MainModule.Bind <ScriptFunctionBoolean>(0x0018, 2, IntMoreThanRight);
     MainModule.Bind <ScriptFunctionBoolean>(0x0019, 2, IntMoreThanLeft);
     MainModule.Bind <ScriptFunctionBoolean>(0x001a, 2, IntMoreThanRight2);
     MainModule.Bind <ScriptFunctionBoolean>(0x001b, 2, IntMoreThanLeft2);
     MainModule.Bind <ScriptFunctionBoolean>(0x001c, 2, IntMoreThanRight3);
     MainModule.Bind <ScriptFunctionBoolean>(0x001d, 2, IntMoreThanLeft3);
     MainModule.Bind <ScriptFunctionBoolean>(0x001e, 2, IntMoreThanRight4);
     MainModule.Bind <ScriptFunctionBoolean>(0x001f, 2, IntMoreThanLeft4);
     MainModule.Bind <ScriptFunctionBoolean>(0x0020, 2, FloatMoreThanRight);
     MainModule.Bind <ScriptFunctionBoolean>(0x0021, 2, FloatMoreThanLeft);
     MainModule.Bind <ScriptFunctionBoolean>(0x0022, 2, FloatMoreThanRight2);
     MainModule.Bind <ScriptFunctionBoolean>(0x0023, 2, FloatMoreThanLeft2);
     MainModule.Bind <ScriptFunctionBoolean>(0x0024, 2, FloatMoreThanRight3);
     MainModule.Bind <ScriptFunctionBoolean>(0x0025, 2, FloatMoreThanLeft3);
     MainModule.Bind <ScriptFunctionBoolean>(0x0026, 2, FloatMoreThanRight4);
     MainModule.Bind <ScriptFunctionBoolean>(0x0027, 2, FloatMoreThanLeft4);
 }
Exemplo n.º 4
0
 public ScriptMachine(SCMFile File, ScriptModule Module)
 {
 }