public ImageRomAnimeForm() { InitializeComponent(); #if DEBUG ImageRomAnimeForm.PreLoadResource(); #endif this.AddressList.BeginUpdate(); this.AddressList.Items.Clear(); foreach (var pair in g_ROMAnime) { string name = U.ToHexString(pair.Key) + " " + U.at(pair.Value, 6); this.AddressList.Items.Add(name); } this.AddressList.EndUpdate(); U.SelectedIndexSafety(this.AddressList, 0, true); U.SetIcon(AnimeExportButton, Properties.Resources.icon_arrow); U.SetIcon(AnimeImportButton, Properties.Resources.icon_upload); U.AllowDropFilename(this, new string[] { ".TXT" }, (string filename) => { using (ImageFormRef.AutoDrag ad = new ImageFormRef.AutoDrag(filename)) { AnimeImportButton_Click(null, null); } }); }
void TypeToLengthAndName(AsmMapSt p, uint pointer, ROM rom) { string type = p.TypeName; if (type == "LZ77") { p.Length = LZ77.getCompressedSize(rom.Data, U.toOffset(pointer)); } else if (type == "OAMREGS") { p.Length = U.OAMREGSLength(U.toOffset(pointer), rom); p.Name += " Count_" + ((p.Length - 2) / (3 * 2)); } else if (type == "OAMREGS_ARRAY") { p.Length = ScanOAMREGSTable(pointer, p.Name, rom); } else if (type == "TEXTBATCH") { p.Length = U.TextBatchLength(U.toOffset(pointer), rom); p.Name += " Count_" + ((p.Length) / 8); } else if (type == "TEXTBATCHSHORT") { p.Length = U.TextBatchShortLength(U.toOffset(pointer), rom); p.Name += " Count_" + ((p.Length) / 2); } else if (type == "EVENT") { p.Length = EventScript.SearchEveneLength(rom.Data, U.toOffset(pointer)); p.Name += " Count_" + ((p.Length - 2) / (3 * 2)); } else if (type == "HEADERTSA") { p.Length = ImageUtil.CalcByteLengthForHeaderTSAData(rom.Data, (int)U.toOffset(pointer)); } else if (type == "ROMPALETTEANIMEFRAME") { p.Length = ImageRomAnimeForm.GetPaletteFrameCountLow(rom.Data, U.toOffset(pointer)) * 2; } else if (type == "PALETTE") { p.Length = 0x20; } else if (type == "PALETTE2") { p.Length = 0x20 * 2; } else if (type == "PALETTE3") { p.Length = 0x20 * 3; } else if (type == "PALETTE4") { p.Length = 0x20 * 4; } else if (type == "PALETTE8") { p.Length = 0x20 * 8; } else if (type == "PALETTE7") { p.Length = 0x20 * 7; } else if (type == "PALETTE16") { p.Length = 0x20 * 16; } else if (type == "ROMTCS") { p.Length = ImageUtilAP.CalcROMTCSLength(U.toOffset(pointer), rom); } else if (type == "NAZO60") { p.Length = 60; } else if (type == "FONTCOLOR0x200") { p.Length = 0x200; } else if (type == "NewPopupSimple") { p.Length = ImageUtilAP.CalcPopupSimpleLength(U.toOffset(pointer), rom); } else if (type == "SECONDARYOAM") { p.Length = 14; } else if (type == "SECONDARYOAM_ARRAY") { p.Length = ScanSECONDARYOAMTable(pointer, p.Name, rom); } else if (type == "CSTRING") { int length; string strname = rom.getString(U.toOffset(pointer), out length); p.Length = (uint)length; p.Name += " => " + strname; } else if (type == "SOUND_85COMMAND_POINTER_ARRAY") { p.Length = ScanSOUND85COMMANDPointerTable(pointer, p.Name, rom); } else if (type == "ASM_POINTER_ARRAY") { p.Length = ScanASMPointerTable(pointer, p.Name, rom); } else if (type == "PROC") { uint length = ProcsScriptForm.CalcLengthAndCheck(U.toOffset(pointer)); if (length != U.NOT_FOUND) { p.Length = length; } } else if (type == "NAZO8_DATA_POINTER_ARRAY") { p.Length = ScanNazo8DataPointerTable(pointer, p.Name, rom); } else if (type == "ASM") { p.Length = 0; } else if (type == "BGCONFIG") { p.Length = 10 * 2; } }
//ROM読みこみに伴うシステムの初期化. static void InitSystem(string fullfilename) { Log.Notify("InitSystem:", Path.GetFileName(ROM.Filename), "ver:", ROM.RomInfo.VersionToFilename(), "length:", ROM.Data.Length.ToString("X"), "FEBuilderGBA:", U.getVersion()); //Undoバッファの準備 Undo = new Undo(); //数を求める部分はあまりにたくさん呼び出すのでキャッシュすることにしました. InputFormRef.ClearCacheDataCount(); //パッチのインストールの是非の判定 FE8には策パッチがあるのでキャッシュする. PatchForm.ClearCheckIF(); if (fullfilename != "") { //変更監視 UpdateWatcher.RegistMain(fullfilename); } //tbl適応判定 OptionForm.AutoUpdateTBLOption(); //システム側のテキストエンコード どうやってUnicodeにするかどうか. ReBuildSystemTextEncoder(); //FEテキストエンコード用のハフマンツリーマップの構成 ReBuildFETextEncoder(); //イベントの読込 ReLoadEventScript(); //イベント条件の解釈リスト EventCondForm.PreLoadResource(U.ConfigDataFilename("eventcond_")); //AI1 と 2, 3 EventUnitForm.PreLoadResourceAI1(U.ConfigDataFilename("ai1_")); EventUnitForm.PreLoadResourceAI2(U.ConfigDataFilename("ai2_")); EventUnitForm.PreLoadResourceAI3(U.ConfigDataFilename("ai3_")); //SondEffectリスト SongTableForm.PreLoadResource(U.ConfigDataFilename("sound_")); //UnitActionリスト UnitActionPointerForm.PreLoadResource(U.ConfigDataFilename("unitaction_")); //ROM内アニメ ImageRomAnimeForm.PreLoadResource(); ImageTSAAnimeForm.PreLoadResource(); if (Program.ROM.RomInfo.version() == 8) { ImageTSAAnime2Form.PreLoadResource(); } //MODの読込. ReLoadMod(); //新規に追加ユニットリストキャッシュの削除 EventUnitForm.ClearNewData(); //システムアイコンキャッシュのクリア ImageSystemIconForm.ClearCache(); //EVENTとASMのキャッシュをクリア AsmMapFileAsmCache = new FEBuilderGBA.AsmMapFileAsmCache(); //asm mapキャッシュの更新. AsmMapFileAsmCache.ClearCache(); //RAM ReBuildRAM(); if (fullfilename != "" && fullfilename != Program.Config.at("Last_Rom_Filename")) {//最後に開いたファイル名を保存する. Program.Config["Last_Rom_Filename"] = fullfilename; Program.Config.Save(); } //Log.Notify("InitSystem:Complate"); }