public static List <FunctionInfo> GetFunctionInfo(RomVersion version) { string game = version.GetGameAbbr(); string ver = version.GetVerAbbr(); string filepath = $"data/{game}-{ver}.json"; if (File.Exists(filepath)) { return((List <FunctionInfo>)Deserialize(typeof(List <FunctionInfo>), filepath)); } return(new List <FunctionInfo>()); }
private static void TestSymbolGeneration(RomVersion ver) { Dictionary <string, bool> __last_symbol = File .ReadAllLines($"__{ver.GetGameAbbr()}_{ver.GetVerAbbr()}_last_symbol.txt") .ToDictionary(v => v, v => true); List <string> __next_symbol = new List <string>(); using (var sw = File.CreateText("__last_symbol.txt")) { foreach (var symbol in Disassemble.Symbols.Values.OrderBy(x => x.Addr)) { string symbolInfo = $"{symbol.Kind.ToString().ToLowerInvariant(),4}_{symbol.Addr} => {symbol.Confirmed,-5} {symbol.Name}"; if (__last_symbol.ContainsKey(symbolInfo)) { __last_symbol.Remove(symbolInfo); } else { __next_symbol.Add(symbolInfo); } sw.WriteLine(symbolInfo); } } SortedList <string, string> errors = new SortedList <string, string>(); foreach (var sym in __last_symbol.Keys) { errors.Add(sym, "o"); } foreach (var sym in __next_symbol) { errors.Add(sym, "n"); } using (var sw = File.CreateText("__last_symbol_compare.txt")) { foreach (var item in errors) { sw.WriteLine($"{item.Value} {item.Key}"); } } }