Example #1
0
        private KeyValuePair <string, TableMetaData> CreateRomRaiderRamTable(string name, int offset, string id, string type)
        {
            XElement xel = XElement.Parse(@"
                <ecu id="""">
                    <address></address>
                </ecu>
            ");

            xel.Attribute("id").Value = this.parentMod.FinalEcuId;
            string ts = offset.ToString("X6");

            ts = ts.Substring(2, ts.Length - 2);
            if (ts.Length < 6 && ts.Substring(0, 2) != "FF")
            {
                Trace.WriteLine("!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!");
                Trace.WriteLine("WARNING! bad ram table: " + name + " with offset: " + offset.ToString("X"));
            }
            xel.Element("address").Value = "0x" + ts;

            int length = Utils.ConvertStorageTypeToIntBytes(type);

            if (length > 1)
            {
                xel.Element("address").SetAttributeValue("length", length.ToString());
            }

            return(new KeyValuePair <string, TableMetaData>(name, TableFactory.CreateRamTable(xel, name, type, this.definition)));
        }
Example #2
0
        private KeyValuePair <string, TableMetaData> CreateRomRaiderRamTableBit(string name, int offset, string id, int bit)
        {
            XElement xel = XElement.Parse(@"
                <ecu id="""">
                    <address bit=""""></address>
                </ecu>
            ");

            xel.Attribute("id").Value = this.parentMod.FinalEcuId;
            string ts = offset.ToString("X6");

            ts = ts.Substring(2, ts.Length - 2);
            if (ts.Length < 6 && ts.Substring(0, 2) != "FF")
            {
                Trace.WriteLine("!!!!!!!!!!!!!!!!!!WARNING!!!!!!!!!!!!!!!!!!!!!");
                Trace.WriteLine("WARNING! bad ram table: " + name + " with offset: " + offset.ToString("X"));
            }
            xel.Element("address").Value = "0x" + ts;
            xel.Element("address").Attribute("bit").Value = bit.ToString();

            return(new KeyValuePair <string, TableMetaData>(name, TableFactory.CreateRamTable(xel, name, "uint8", this.definition, id)));
        }