Beispiel #1
0
 private void AddRomTable(Table table)
 {
     if (table.isBase)
     {
         if (!BaseRomTables.ContainsKey(table.name))
         {
             BaseRomTables.Add(table.name, table);
         }
         else
         {
             Trace.WriteLine("Warning, duplicate table: " + table.name + ". Please check the definition!!");
         }
     }
     else
     {
         if (!ExposedRomTables.ContainsKey(table.name))
         {
             ExposedRomTables.Add(table.name, table);
         }
         else
         {
             Trace.WriteLine("Warning, duplicate table: " + table.name + ". Please check the definition!!");
         }
     }
 }
Beispiel #2
0
 private void AddRomTable(TableMetaData table, int line)
 {
     if (table.isBase)
     {
         if (!BaseRomTables.ContainsKey(table.name))
         {
             BaseRomTables.Add(table.name, table);
         }
         else
         {
             Trace.WriteLine("Warning, duplicate table: " + table.name + ". Please check the definition: " + this.filePath + " Line number: " + line);
         }
     }
     else
     {
         if (!ExposedRomTables.ContainsKey(table.name))
         {
             ExposedRomTables.Add(table.name, table);
         }
         else
         {
             Trace.WriteLine("Warning, duplicate table: " + table.name + ". Please check the definition: " + this.filePath + " Line number: " + line);
         }
     }
 }
Beispiel #3
0
        private void AddRomTable(TableMetaData table, int line)
        {
            TableMetaData dupe;

            if (table.isBase)
            {
                if (!BaseRomTables.ContainsKey(table.name))
                {
                    BaseRomTables.Add(table.name, table);
                }
                else
                {
                    BaseRomTables.TryGetValue(table.name, out dupe);
                    Trace.WriteLine("Warning, duplicate table: " + table.name + ". Please check the definition: " + this.filePath + " Line numbers: " + line + " and " + dupe.LineNumber);
                }
            }
            else
            {
                if (!ExposedRomTables.ContainsKey(table.name))
                {
                    ExposedRomTables.Add(table.name, table);
                }
                else
                {
                    ExposedRomTables.TryGetValue(table.name, out dupe);
                    Trace.WriteLine("Warning, duplicate table: " + table.name + ". Please check the definition: " + this.filePath + " Line numbers: " + line + " and " + dupe.LineNumber);
                }
            }
        }
Beispiel #4
0
        public void ExposeTable(string name, LookupTable lut)
        {
            TableMetaData baseTable = GetBaseTable(name);

            if (baseTable != null)
            {
                TableMetaData childTable = baseTable.CreateChild(lut, this);
                //TODO: HANDLE STATIC AXES!!
                if (lut.dataAddress < 0x400000)
                {
                    //TODO: HANDLE UPDATES TO EXISTING TABLES!!??
                    if (ExposedRomTables.ContainsKey(childTable.name))
                    {
                        ExposedRomTables.Remove(childTable.name);
                    }
                    ExposedRomTables.Add(childTable.name, childTable);
                }
                else
                {
                    if (ExposedRamTables.ContainsKey(childTable.name))
                    {
                        ExposedRamTables.Remove(childTable.name);
                    }
                    ExposedRamTables.Add(childTable.name, childTable);
                }
            }

            //if (bt == null) return;
            //bt.SetAttributeValue("address", lut.dataAddress.ToString("X"));//(System.Int32.Parse(temptable.Value.Attribute("offset").Value.ToString(), System.Globalization.NumberStyles.AllowHexSpecifier) + offset).ToString("X"));
            //IEnumerable<XAttribute> tempattr = bt.Attributes();
            //List<String> remattr = new List<String>();
            //foreach (XAttribute attr in tempattr)
            //{
            //    if (attr.Name != "address" && attr.Name != "name")
            //    {
            //        remattr.Add(attr.Name.ToString());
            //    }
            //}
            //foreach (String rem in remattr)
            //{
            //    bt.Attribute(rem).Remove();
            //}

            //List<String> eleremlist = new List<String>();

            //foreach (XElement ele in bt.Elements())
            //{
            //    IEnumerable<XAttribute> childtempattr = ele.Attributes();
            //    List<String> childremattr = new List<String>();

            //    if (ele.Name.ToString() != "table")
            //    {
            //        eleremlist.Add(ele.Name.ToString());
            //        continue;
            //    }
            //    if (ele.Attribute("type").Value.ContainsCI("static"))
            //    {
            //        eleremlist.Add(ele.Name.ToString());
            //    }
            //    else if (ele.Attribute("type").Value.ContainsCI("x axis"))
            //    {
            //        ele.Attribute("name").Value = "X";
            //    }
            //    else if (ele.Attribute("type").Value.ContainsCI("y axis"))
            //    {
            //        ele.Attribute("name").Value = "Y";
            //    }
            //    foreach (XAttribute attr in childtempattr)
            //    {
            //        if (attr.Name != "address" && attr.Name != "name")
            //        {
            //            childremattr.Add(attr.Name.ToString());
            //        }
            //    }
            //    foreach (String rem in childremattr)
            //    {
            //        ele.Attribute(rem).Remove();
            //    }
            //}
            //foreach (String rem in eleremlist)
            //{
            //    bt.Element(rem).Remove();
            //}
        }