Beispiel #1
0
        public static SLOTItem GetSlot(VMStackFrame context, VMSlotScope scope, ushort data)
        {
            switch (scope)
            {
            case VMSlotScope.Global:
                var slots = context.Global.Resource.Get <SLOT>(100);
                if (slots != null && slots.Slots.ContainsKey(3) && data < slots.Slots[3].Count)
                {
                    if (data >= slots.Slots[3].Count)
                    {
                        return(null);
                    }
                    var slot = slots.Slots[3][data];
                    return(slot);
                }
                return(null);

            case VMSlotScope.Literal:
                if (data >= context.StackObject.Slots.Slots[3].Count)
                {
                    return(null);
                }
                return(context.StackObject.Slots.Slots[3][data]);

            case VMSlotScope.StackVariable:
                if (context.Args[data] >= context.StackObject.Slots.Slots[3].Count)
                {
                    return(null);
                }
                return(context.StackObject.Slots.Slots[3][context.Args[data]]);
            }
            return(null);
        }
 public void Read(byte[] bytes)
 {
     using (var io = IoBuffer.FromBytes(bytes, ByteOrder.LITTLE_ENDIAN)){
         Data = io.ReadUInt16();
         Type = (VMSlotScope)io.ReadUInt16();
         Flags = io.ReadByte();
     }
 }
Beispiel #3
0
 public void Read(byte[] bytes)
 {
     using (var io = IoBuffer.FromBytes(bytes, ByteOrder.LITTLE_ENDIAN)){
         Data  = io.ReadUInt16();
         Type  = (VMSlotScope)io.ReadUInt16();
         Flags = io.ReadByte();
     }
 }
Beispiel #4
0
 public static SLOTItem GetSlot(VMStackFrame context, VMSlotScope scope, ushort data)
 {
     switch (scope)
     {
     case VMSlotScope.Global:
         var slots = context.Global.Resource.Get <SLOT>(100);
         if (slots != null && data < slots.Slots.Length)
         {
             return(slots.Slots[data]);
         }
         return(null);
     }
     return(null);
 }
Beispiel #5
0
 public static SLOTItem GetSlot(VMStackFrame context, VMSlotScope scope, ushort data)
 {
     switch (scope){
         case VMSlotScope.Global:
             var slots = context.Global.Resource.Get<SLOT>(100);
             if (slots != null && slots.Slots.ContainsKey(3) && data < slots.Slots[3].Count){
                 return slots.Slots[3][data];
             }
             return null;
         case VMSlotScope.Literal:
             return context.StackObject.Slots.Slots[3][data];
         case VMSlotScope.StackVariable:
             return context.StackObject.Slots.Slots[3][context.Args[data]];
     }
     return null;
 }
Beispiel #6
0
 public static SLOTItem GetSlot(VMStackFrame context, VMSlotScope scope, ushort data)
 {
     switch (scope){
         case VMSlotScope.Global:
             var slots = context.Global.Get<SLOT>(100);
             if (slots != null && data < slots.Slots.Length){
                 return slots.Slots[data];
             }
             return null;
     }
     return null;
 }