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

            if (table.isBase)
            {
                if (!BaseRamTables.ContainsKey(table.name))
                {
                    BaseRamTables.Add(table.name, table);
                }
                else
                {
                    BaseRamTables.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 (!ExposedRamTables.ContainsKey(table.name))
                {
                    ExposedRamTables.Add(table.name, table);
                }
                else
                {
                    ExposedRamTables.TryGetValue(table.name, out dupe);
                    Trace.WriteLine("Warning, duplicate table: " + table.name + ". Please check the definition: " + this.filePath + " Line numbers: " + line + " and " + dupe.LineNumber);
                }
            }
        }
예제 #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();
            //}
        }