public static RecycleAddress MakeRecycleSongAndInst(uint songtable_address) { //今回の楽曲リサイクル List <FEBuilderGBA.Address> recycle = new List <FEBuilderGBA.Address>(); MakeAllDataLength_Song_And_Inst(recycle, 0, songtable_address); //ポインタを共有しているといけないので調べる List <FEBuilderGBA.Address> list = new List <FEBuilderGBA.Address>(); InputFormRef InputFormRef = Init(null); uint songpointer = InputFormRef.BaseAddress; for (int i = 0; i < InputFormRef.DataCount; i++, songpointer += InputFormRef.BlockSize) { if (songtable_address == songpointer) {//自分自身 continue; } MakeAllDataLength_Song_And_Inst(list, i, songpointer); } RecycleAddress ra = new RecycleAddress(recycle); ra.SubRecycle(list); return(ra); }
//変更するアニメデータから、他のアニメーションでも使っているものを除外する public static void MakeAllDataLength(RecycleAddress ra, uint Now_baseaddress) { InputFormRef N_InputFormRef = N_Init(null); //戦闘アニメーションはlz77圧縮の中にポインタがある特殊形式です uint addr = N_InputFormRef.BaseAddress; 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; } if (addr == Now_baseaddress) { continue; } List <Address> list = new List <Address>(); ImageUtilOAM.RecycleOldAnime(ref list, addr); ra.SubRecycle(list); } }
//変更するアニメデータから、他のアニメーションでも使っているものを除外する public static void SubConfilctArea(RecycleAddress ra, uint Now_baseaddress) { InputFormRef InputFormRef; uint baseaddr, dimaddr, no_dimaddr; if (ImageUtilMagic.SearchMagicSystem(out baseaddr, out dimaddr, out no_dimaddr) != ImageUtilMagic.magic_system_enum.FEDITOR_ADV) { return; } { uint spellDataCount = ImageUtilMagicFEditor.SpellDataCount(); uint csaSpellTable = ImageUtilMagic.GetCSASpellTableAddr(); if (csaSpellTable == U.NOT_FOUND) { return; } Dictionary <uint, string> effectDic = new Dictionary <uint, string>(); InputFormRef = Init(null, dimaddr, no_dimaddr, spellDataCount, csaSpellTable, effectDic); uint addr = InputFormRef.BaseAddress; for (int i = 0; i < InputFormRef.DataCount; i++, addr += InputFormRef.BlockSize) { uint baseaddress = Program.ROM.p32(Program.ROM.RomInfo.magic_effect_pointer); uint csaaddress = (uint)(csaSpellTable + (20 * i)); uint dataaddr = Program.ROM.p32(addr); if (dataaddr == 0) { continue; } if (csaaddress == Now_baseaddress) { continue; } if ( dataaddr == dimaddr || dataaddr == no_dimaddr) { List <Address> list = new List <Address>(); ImageUtilMagicFEditor.RecycleOldAnime(ref list, "", false, csaaddress); ra.SubRecycle(list); } } } }