Example #1
0
 public void WriteTo(STMMemoryWriter __out)
 {
     if (NameAddr != 0)
     {
         __out.Write(NameAddr, Name);
     }
 }
Example #2
0
 public void WriteHeader(STMMemoryWriter __out)
 {
     /* 0 */
     __out.Write(NameAddr);
     /* 4 */
     __out.Write(CodeAddr);
     /* 8 */
     __out.Write(isMenu ? (ushort)0 : PPMChannels);
     /* 10 */
     __out.Write(PPMMin);
     /* 12 */
     __out.Write(PPMCenter);
     /* 14 */
     __out.Write(PPMMax);
     /* 16 */
     __out.Write((ushort)Modes.Length);
     /* 18 */
     __out.Write((ushort)ModeVariable);
     /* 20 */
     __out.Write(ModesAddr);
     /* 24 */
     __out.Write(Index);
     /* 26 */
     __out.Write((ushort)0);
     /* 28 */
 }
Example #3
0
        public void WriteTo(STMMemoryWriter __out)
        {
            if (NameAddr != 0)
            {
                __out.Write(NameAddr, Name);
            }

            if (LinksAddr != 0)
            {
                __out.Position = LinksAddr;

                foreach (var link in Links)
                {
                    link.WriteHeader(__out);
                }

                foreach (var link in Links)
                {
                    link.WriteTo(__out);
                }
            }

            if (VarsAddr != 0)
            {
                __out.Position = VarsAddr;

                foreach (var variable in Variables)
                {
                    __out.Write(variable.Addr);
                }
            }
        }
Example #4
0
        public void WriteTo(STMMemoryWriter __out)
        {
            __out.Write(CommandCode);

            foreach (var argument in CommandArguments)
            {
                __out.Write(argument);
            }
        }
Example #5
0
        public void WriteHeader(STMMemoryWriter __out)
        {
            __out.Write(NameAddr);
            __out.Write(LinksAddr);
            __out.Write(VarsAddr);

            __out.Write(ModelIndex);
            __out.Write((ushort)(Links != null ? Links.Length : 0));
            __out.Write((ushort)(Variables != null ? Variables.Length : 0));
            __out.Write((ushort)0);
        }
Example #6
0
        public void WriteTo(STMMemoryWriter __out)
        {
            __out.Position = BlockStart;

            foreach (var cmd in Commands)
            {
                cmd.WriteTo(__out);
            }

            __out.Write((ushort)0);
        }
Example #7
0
        public void WriteTo(STMMemoryWriter __out)
        {
            __out.Position = ArrayAddr;

            foreach (var model in Models)
            {
                model.WriteHeader(__out);
            }

            foreach (var model in Models)
            {
                model.WriteTo(__out);
            }
        }
Example #8
0
        public void WriteTo(STMMemoryWriter __out)
        {
            __out.Position = ArrayAddr;

            foreach (var block in Blocks)
            {
                block.WriteHeader(__out);
            }

            foreach (var block in Blocks)
            {
                block.WriteTo(__out);
            }
        }
Example #9
0
        public void WriteTo(STMMemoryWriter __out)
        {
            __out.Write(CommandCode);

            foreach (var argument in CommandArguments)
            {
                if (argument is ushort)
                {
                    __out.Write((ushort)argument);
                }
                else
                {
                    __out.Write(argument.ToInt16(CultureInfo.InvariantCulture));
                }
            }
        }
Example #10
0
        public byte[] Compile()
        {
            uint pointer = MEMORYBASE;

            Map(ref pointer);
            Align32Bits(ref pointer);

            var writer = new STMMemoryWriter(MEMORYBASE, pointer - MEMORYBASE + 4);

            writer.Write(MEMORYBASE, 0xCA);
            writer.Write(MEMORYBASE + 1, JoyReportLength);
            writer.Write(MEMORYBASE + 2, PPMLength);
            writer.Write(MEMORYBASE + 3, (byte)Settins);

            writer.Write(MEMORYBASE + 4, LCD_I2C_Addr);
            writer.Write(MEMORYBASE + 5, EEPROM_I2C_ADDR);
            writer.Write(MEMORYBASE + 6, (byte)EEP_ADDR_STYLE);
//            __out.WriteByte(0); // 7

            writer.Write(MEMORYBASE + 8, DataMapLength);
            writer.Write(MEMORYBASE + 10, (ushort)StringConstants.List.Count + 1);
            writer.Write(MEMORYBASE + 12, (ushort)Models.Models.Count);
            writer.Write(MEMORYBASE + 14, (ushort)Variables.Variables.Count);
            writer.Write(MEMORYBASE + 16, (ushort)Blocks.Blocks.Count);
            writer.Write(MEMORYBASE + 18, (ushort)0);

            writer.Write(MEMORYBASE + 20, StringConstants.ArrayAddr);
            writer.Write(MEMORYBASE + 24, Models.ArrayAddr);
            writer.Write(MEMORYBASE + 28, Variables.ArrayAddr);
            writer.Write(MEMORYBASE + 32, Blocks.ArrayAddr);

            writer.Write(MEMORYBASE + 36, CommonCode.BlockStart);
            writer.Write(MEMORYBASE + 40, StartupCode.BlockStart);
            writer.Write(MEMORYBASE + 44, MenuCode.BlockStart);

            StringConstants.WriteTo(writer);
            Models.WriteTo(writer);
            Variables.WriteTo(writer);
            Blocks.WriteTo(writer);

            CommonCode.WriteTo(writer);
            StartupCode.WriteTo(writer);
            MenuCode.WriteTo(writer);

            return(writer.Buffer);
        }
Example #11
0
        public void WriteTo(STMMemoryWriter __out)
        {
            ModelCode.WriteTo(__out);

            if (NameAddr != 0)
            {
                __out.Write(NameAddr, Name);
            }

            if (ModesAddr != 0)
            {
                __out.Position = ModesAddr;

                foreach (var mode in Modes)
                {
                    mode.WriteHeader(__out);
                }

                foreach (var mode in Modes)
                {
                    mode.WriteTo(__out);
                }
            }
        }
Example #12
0
 public void WriteHeader(STMMemoryWriter __out)
 {
     __out.Write(NameAddr);
 }
Example #13
0
 public void WriteHeader(STMMemoryWriter __out)
 {
     __out.Write(NameAddr);
     __out.Write(DataIndex);
     __out.Write(Bits);
 }