//エラーチェック public static void MakeCheckError(List <FELint.ErrorSt> errors) { InputFormRef N_InputFormRef = N_Init(null); bool isFE6 = (Program.ROM.RomInfo.version == 6); if (!isFE6) {//FE6の場合、パラディンなどが手斧モーションを持っていない. //そのため、FE7,FE8だけチェックします. InputFormRef InputFormRef = Init(null); List <U.AddrResult> handAxsItems = ItemForm.MakeItemListByHandAxs(); List <U.AddrResult> classList = ClassForm.MakeClassList(); for (uint cid = 1; cid < classList.Count; cid++) { uint pointer; uint class_addr = classList[(int)cid].addr; uint addr = ClassForm.GetBattleAnimeAddrWhereAddr(class_addr, out pointer); if (addr == 0) { continue; } if (!U.isSafetyOffset(addr)) { errors.Add(new FELint.ErrorSt(FELint.Type.CLASS, class_addr , R._("クラス({0})の{1}のポインタ({2})が危険です。" , classList[(int)cid].name, R._("戦闘アニメ"), U.To0xHexString(addr)), cid)); continue; } InputFormRef.ReInit(addr); MakeCheckErrorAxs(InputFormRef, N_InputFormRef , handAxsItems, classList, cid, errors); } } { if (N_InputFormRef.DataCount < 10) { errors.Add(new FELint.ErrorSt(FELint.Type.BATTLE_ANIME, U.NOT_FOUND , R._("戦闘アニメが極端に少ないです。破損している可能性があります。"))); } List <uint> seatNumberList = new List <uint>(256); uint p = N_InputFormRef.BaseAddress; for (int i = 0; i < N_InputFormRef.DataCount; i++, p += N_InputFormRef.BlockSize) { if (isFE6 && i == 0x6c) { continue; } ImageUtilOAM.MakeCheckError(errors, p, (uint)(i), seatNumberList); } } }
//全データの取得 public static void MakeAllDataLength(List <Address> list, bool isPointerOnly) { string selfname; InputFormRef InputFormRef = Init(null); uint addr; List <U.AddrResult> classList = ClassForm.MakeClassList(); for (uint cid = 0; cid < classList.Count; cid++) { uint pointer; uint class_addr = classList[(int)cid].addr; addr = ClassForm.GetBattleAnimeAddrWhereAddr(class_addr, out pointer); if (!U.isSafetyOffset(addr)) { continue; } InputFormRef.ReInitPointer(pointer); selfname = "BattleAnimeSeting:" + U.To0xHexString(cid); FEBuilderGBA.Address.AddAddress(list, InputFormRef , selfname, new uint[] { }); } selfname = "BattleAnime"; InputFormRef N_InputFormRef = N_Init(null); FEBuilderGBA.Address.AddAddress(list, N_InputFormRef, selfname, new uint[] { 12, 16, 20, 24, 28 }); //戦闘アニメーションはlz77圧縮の中にポインタがある特殊形式です addr = N_InputFormRef.BaseAddress; List <uint> seatNumberList = new List <uint>(256); for (int i = 0; i < N_InputFormRef.DataCount; i++, addr += N_InputFormRef.BlockSize) { if (!U.isSafetyOffset(12 + addr + 4)) { break; } uint section = Program.ROM.p32(12 + addr); if (!U.isSafetyOffset(section)) { break; } selfname = "BattleAnime:" + U.To0xHexString(i + 1); ImageUtilOAM.MakeAllDataLength(list, isPointerOnly, selfname, addr, seatNumberList); } }