public List <string> MakeNameList() { List <string> list = new List <string>(); AsmMapFile map = GetAsmMapFile(); foreach (var pair in map.GetAsmMap()) { list.Add(pair.Value.Name); } return(list); }
public static void RunAllMakeMAPFileButton(Form self) { if (InputFormRef.IsPleaseWaitDialog(self)) {//2重割り込み禁止 return; } string title = R._("保存するファイル名を選択してください"); string filter = R._("MAP|*.map|TEXT|*.txt|All files|*"); SaveFileDialog save = new SaveFileDialog(); save.Title = title; save.Filter = filter; save.ShowDialog(); if (save.FileNames.Length <= 0 || !U.CanWriteFileRetry(save.FileNames[0])) { return; } using (InputFormRef.AutoPleaseWait wait = new InputFormRef.AutoPleaseWait(self)) using (StreamWriter writer = new StreamWriter(save.FileNames[0])) { writer.WriteLine(" Start Length Name Class"); wait.DoEvents("GrepAllStructPointers"); AsmMapFile asmMapFile = new AsmMapFile(Program.ROM); DisassemblerTrumb Disassembler = new DisassemblerTrumb(asmMapFile); List <DisassemblerTrumb.LDRPointer> ldrmap = Program.AsmMapFileAsmCache.GetLDRMapCache(); List <Address> structlist = U.MakeAllStructPointersList(false); //既存の構造体 U.AppendAllASMStructPointersList(structlist , ldrmap , isPatchInstallOnly: false , isPatchPointerOnly: false , isPatchStructOnly: false , isUseOtherGraphics: true , isUseOAMSP: true ); AsmMapFile.InvalidateUNUNSED(structlist); MakeFreeData(structlist); asmMapFile.AppendMAP(structlist); //コメントデータ Program.CommentCache.MakeAddressList(structlist); asmMapFile.AppendMAP(structlist); string line; Dictionary <uint, AsmMapFile.AsmMapSt> asmmap = asmMapFile.GetAsmMap(); foreach (var pair in asmmap) { if (pair.Key == 0x0 || pair.Key == U.NOT_FOUND) { continue; } if (pair.Key >= 0x08000000 && pair.Key <= 0x08000200) { continue; } //長いと不便なので、名前以外不要. string name = pair.Value.Name; name = U.term(name, "\t"); if (pair.Value.Length > 0) { line = string.Format(" 0000:{0} 0{1}H {2} DATA", U.ToHexString(pair.Key), pair.Value.Length.ToString("X08"), name); } else { line = string.Format(" 0000:{0} {1}", U.ToHexString(pair.Key), name); } writer.WriteLine(line); } } //エクスプローラで選択しよう U.SelectFileByExplorer(save.FileNames[0]); }
public static void AllMakeNoDollSymFile(Form self, string symfilename, InputFormRef.AutoPleaseWait wait) { Encoding encoding = U.GetSystemDefault(); using (StreamWriter writer = new StreamWriter(symfilename, false, encoding)) { wait.DoEvents("GrepAllStructPointers"); AsmMapFile asmMapFile = new AsmMapFile(Program.ROM); DisassemblerTrumb Disassembler = new DisassemblerTrumb(asmMapFile); List <DisassemblerTrumb.LDRPointer> ldrmap = Program.AsmMapFileAsmCache.GetLDRMapCache(); List <Address> structlist = new List <Address>(50000); //昔のno$gbaは32546lines以上の symを読みこむと落ちるので手加減する. U.AppendAllASMStructPointersList(structlist , ldrmap , isPatchInstallOnly: true , isPatchPointerOnly: false , isPatchStructOnly: false , isUseOtherGraphics: false , isUseOAMSP: false ); AsmMapFile.InvalidateUNUNSED(structlist); asmMapFile.AppendMAP(structlist); //コメントデータ Program.CommentCache.MakeAddressList(structlist); asmMapFile.AppendMAP(structlist); Dictionary <uint, AsmMapFile.AsmMapSt> asmmap = asmMapFile.GetAsmMap(); foreach (var pair in asmmap) { if (pair.Key == 0x0 || pair.Key == U.NOT_FOUND) { continue; } if (pair.Key >= 0x08000000 && pair.Key <= 0x08000200) { continue; } if (pair.Value.IsPointer) {//ポインタデータは不要 continue; } //長いと不便なので、名前以外不要. string name = pair.Value.Name; name = ConvertNoDollGBASymName(name); if (name == "") {//名前が空 continue; } if (pair.Value.TypeName == "ARM") { string line = string.Format("{0} .arm", U.ToHexString(pair.Key), ".arm"); writer.WriteLine(line); } else if (pair.Value.TypeName == "ASM" || U.toOffset(pair.Key) < Program.ROM.RomInfo.compress_image_borderline_address) { string line = string.Format("{0} .thumb", U.ToHexString(pair.Key)); writer.WriteLine(line); } { string line = string.Format("{0} {1}", U.ToHexString(pair.Key), name); writer.WriteLine(line); } } } }
public static void AllMakeNoDollSymFile(Form self, string symfilename, InputFormRef.AutoPleaseWait wait) { Encoding encoding = U.GetSystemDefault(); using (StreamWriter writer = new StreamWriter(symfilename, false, encoding)) { wait.DoEvents("GrepAllStructPointers"); AsmMapFile asmMapFile = new AsmMapFile(); DisassemblerTrumb Disassembler = new DisassemblerTrumb(asmMapFile); List <DisassemblerTrumb.LDRPointer> ldrmap = DisassemblerTrumb.MakeLDRMap(Program.ROM.Data, 0x100); List <Address> structlist = new List <Address>(); //no$gbaは32546lines以上の symを読みこむと落ちるので手加減する. // List<Address> structlist = U.MakeAllStructPointersList(); //既存の構造体 U.AppendAllASMStructPointersList(structlist , ldrmap , isPatchInstallOnly: true , isPatchPointerOnly: false , isPatchStructOnly: false , isUseOtherGraphics: false , isUseOAMSP: false ); asmMapFile.AppendMAP(structlist); //コメントデータ Program.CommentCache.MakeAddressList(structlist); asmMapFile.AppendMAP(structlist); uint lastNumber = 0; string line; Dictionary <uint, AsmMapFile.AsmMapSt> asmmap = asmMapFile.GetAsmMap(); foreach (var pair in asmmap) { if (pair.Key == 0x0 || pair.Key == U.NOT_FOUND) { continue; } if (pair.Key >= 0x08000000 && pair.Key <= 0x08000200) { continue; } if (pair.Value.IsPointer) {//ポインタデータは不要 continue; } //長いと不便なので、名前以外不要. string name = pair.Value.Name; name = U.term(name, "\t"); name = name.Replace(" ", "_"); //スペースがあるとダメらしい. if (name.IndexOf("6CStructHeader") >= 0) {//6Cは全部表示する } else { uint arrayNumner = ParseArrayIndex(name); if (arrayNumner >= 10) {//容量削減のため2桁の配列は1つのみ if (lastNumber == arrayNumner) { continue; } lastNumber = arrayNumner; } } line = string.Format("{0} {1}", U.ToHexString(pair.Key), name); writer.WriteLine(line); } } }