void DrawSample(uint battleAnimeID, int paletteIndex) { Bitmap[] animeframe = new Bitmap[12]; uint showsecstion = 0; uint showframe = 0; for (int index = 0; index < animeframe.Length; index++, showframe += 2) { animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID , ImageBattleAnimeForm.ScaleTrim.SCALE_90 , 0, showsecstion, showframe, paletteIndex); if (!ImageUtil.IsBlankBitmap(animeframe[index], 10)) { continue; } //何も描画されなければフレームをもうちょっと進めてみる. showframe += 2; animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID , ImageBattleAnimeForm.ScaleTrim.SCALE_90 , 0, showsecstion, showframe, paletteIndex); if (!ImageUtil.IsBlankBitmap(animeframe[index], 10)) { continue; } //それでもだめならセクションを切り替える. showsecstion += 1; showframe = 0; animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID , ImageBattleAnimeForm.ScaleTrim.SCALE_90 , 0, showsecstion, showframe, paletteIndex); if (!ImageUtil.IsBlankBitmap(animeframe[index], 10)) { continue; } //さらにダメならもう一つセクションを進める. それでもだめならあきらめる. showsecstion += 1; showframe = 0; animeframe[index] = ImageBattleAnimeForm.DrawBattleAnime(battleAnimeID , ImageBattleAnimeForm.ScaleTrim.SCALE_90 , 0, showsecstion, showframe, paletteIndex); } this.DrawBitmap = ImageUtil.Blank(360, 290, animeframe[0]); int x = 0; int y = 0; for (int index = 0; index < animeframe.Length; index++) { ImageUtil.BitBlt(this.DrawBitmap, x, y, animeframe[index].Width, animeframe[index].Height, animeframe[index], 0, 0); x += animeframe[index].Width; if (x >= this.DrawBitmap.Width) { x = 0; y += animeframe[index].Height; } } ReDrawBitmap(); }
private void CLASS_LIST_SelectedIndexChanged(object sender, EventArgs e) { uint class_id = InputFormRef.SelectToAddr(this.UNITCLASS_LIST); uint battleAnimeID = ImageBattleAnimeForm.GetAnimeIDByClassID(class_id); U.ForceUpdate(this.X_BATTLEANIME, battleAnimeID); }
public static string GetBattleAnimeHint(uint search_animeindex) { InputFormRef InputFormRef = Init(null); for (int id = 0; id < InputFormRef.DataCount; id++) { uint addr = InputFormRef.IDToAddr((uint)id); if (!U.isSafetyOffset(addr)) { continue; } for (int i = 0; true; i += 4) { uint item = Program.ROM.u8((uint)(addr + i + 0)); uint sp = Program.ROM.u8((uint)(addr + i + 1)); uint anime = Program.ROM.u16((uint)(addr + i + 2)); if (item == 0 && sp == 0 && anime == 0) { break; } if (anime != search_animeindex) { continue; } //発見! string name = UnitForm.GetNameWhereCustomBattleAnime((uint)id); return(name + " " + ImageBattleAnimeForm.getSPTypeName(item, sp)); } } //ない return(""); }
private void B16_ValueChanged(object sender, EventArgs e) { if (PatchUtil.OPClassReelAnimationIDOver255() == PatchUtil.OPClassReelAnimationIDOver255Patch.Over255) { //パッチで 戦闘アニメ255を越える場合 if (B13.Value == 0xFF) { //標準パレット X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)D18.Value + 1 , ImageBattleAnimeForm.ScaleTrim.SCALE_90, 0, 0, 0, (int)B15.Value); } else { X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)D18.Value + 1 , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B13.Value + 1, 0, 0, (int)B15.Value); } } else { //バニラ if (B13.Value == 0xFF) { //標準パレット X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1 , ImageBattleAnimeForm.ScaleTrim.SCALE_90, 0, 0, 0, (int)B15.Value); } else { X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1 , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B13.Value + 1, 0, 0, (int)B15.Value); } } }
private void OptimizationBattleAnimationOAMButton_Click(object sender, EventArgs e) { if (InputFormRef.IsPleaseWaitDialog(this)) { return; } ImageBattleAnimeForm.Execute_ToolAutoGenLeftToRightAllAnimation(); }
public UnitCustomBattleAnimeForm() { InitializeComponent(); ImageBattleAnimeForm.MakeComboBattleAnimeSP(L_1_BATTLEANIMESP_0); U.ConvertListBox(ClassForm.MakeClassList(), ref this.N2_AddressList); this.InputFormRef = Init(this); this.InputFormRef.PostAddressListExpandsEvent += AddressListExpandsEvent; this.N2_InputFormRef = N2_Init(this); this.N2_InputFormRef.PostAddressListExpandsEvent += N2_AddressListExpandsEvent; }
private void B16_ValueChanged(object sender, EventArgs e) { if (B13.Value == 0xFF) {//標準パレット X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1 , ImageBattleAnimeForm.ScaleTrim.SCALE_90, 0, 0, 0, (int)B15.Value); } else { X_BATTLEANIMEICON.Image = ImageBattleAnimeForm.DrawBattleAnime((uint)B16.Value + 1 , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B13.Value + 1, 0, 0, (int)B15.Value); } }
//特殊タイプ + テキストを書くルーチン public static Size DrawImageSPTypeAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw) { if (index < 0 || index >= lb.Items.Count) { return(new Size(listbounds.X, listbounds.Y)); } string text = lb.Items[index].ToString(); SolidBrush brush = new SolidBrush(lb.ForeColor); Font normalFont = lb.Font; Rectangle bounds = listbounds; int textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2; uint addr = InputFormRef.SelectToAddr(lb, index); Bitmap bitmap; if (U.isSafetyOffset(addr)) { uint b0 = Program.ROM.u8(addr + 0); uint b1 = Program.ROM.u8(addr + 1); bitmap = ImageBattleAnimeForm.getSPTypeIcon(b0, b1); } else { bitmap = ImageUtil.Blank(ListBoxEx.OWNER_DRAW_ICON_SIZE, ListBoxEx.OWNER_DRAW_ICON_SIZE); } U.MakeTransparent(bitmap); Rectangle b = bounds; b.Width = ListBoxEx.OWNER_DRAW_ICON_SIZE; b.Height = ListBoxEx.OWNER_DRAW_ICON_SIZE; bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b); bitmap.Dispose(); //テキストを描く. b = bounds; b.Y += textmargineY; bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b); bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE; brush.Dispose(); return(new Size(bounds.X, bounds.Y)); }
private void PALETTE_POINTER_ValueChanged(object sender, EventArgs e) { uint addr = (uint)PALETTE_ADDRESS.Value; if (!U.isSafetyPointer(addr)) { return; } PaletteFormRef.MakePaletteROMToUI(this, addr, true, this.PaletteIndexComboBox.SelectedIndex); InputFormRef.WriteButtonToYellow(this.PaletteWriteButton, false); uint class_id = InputFormRef.SelectToAddr(this.UNITCLASS_LIST); uint battleAnimeID = ImageBattleAnimeForm.GetAnimeIDByClassID(class_id); U.ForceUpdate(this.X_BATTLEANIME, battleAnimeID); }
static InputFormRef Init(Form self) { return(new InputFormRef(self , "" , Program.ROM.RomInfo.mant_command_pointer() , 4 , (int i, uint addr) => { uint a = Program.ROM.u32(addr); return U.isPointer(a); } , (int i, uint addr) => { uint id = (uint)i + Program.ROM.RomInfo.mant_command_startadd(); return U.ToHexString(id) + " " + ImageBattleAnimeForm.GetBattleAnimeName(id); } )); }
public static Bitmap DrawSample(uint unitid, uint type) { InputFormRef InputFormRef = Init(null); InputFormRef N_InputFormRef = N_Init(null); uint addr1 = InputFormRef.IDToAddr(unitid); uint addr2 = N_InputFormRef.IDToAddr(unitid); if (addr1 == U.NOT_FOUND || addr2 == U.NOT_FOUND) { return(ImageUtil.BlankDummy()); } uint b = Program.ROM.u8(addr1 + type); uint n_b = Program.ROM.u8(addr2 + type); return(ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID(n_b) , ImageBattleAnimeForm.ScaleTrim.SCALE_90, b)); }
static InputFormRef Init(Form self) { return(new InputFormRef(self , "" , 0 , 4 , (int i, uint addr) => { //読込最大値検索 //00まで検索 return Program.ROM.u32(addr + 0) != 0; } , (int i, uint addr) => { uint b0 = Program.ROM.u8(addr + 0); uint b1 = Program.ROM.u8(addr + 1); uint w2 = Program.ROM.u16(addr + 2); return U.ToHexString(w2) + " " + ImageBattleAnimeForm.getSPTypeName(b0, b1); } )); }
//バトルアニメ + テキストを書くルーチン public static Size DrawImageBattleAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw) { if (index < 0 || index >= lb.Items.Count) { return(new Size(listbounds.X, listbounds.Y)); } string text = lb.Items[index].ToString(); SolidBrush brush = new SolidBrush(lb.ForeColor); Font normalFont = lb.Font; Rectangle bounds = listbounds; int textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2; //テキストの先頭にアイコン番号(キャラ番号が入っている. 無駄だが汎用性を考えるとほかに方法がない) uint icon = U.atoh(text); Bitmap bitmap = ImageBattleAnimeForm.DrawBattleAnime(icon, ImageBattleAnimeForm.ScaleTrim.SCALE_48); U.MakeTransparent(bitmap); //アイコンを描く. 処理速度を稼ぐためにマップアイコンの方を描画 Rectangle b = bounds; b.Width = ListBoxEx.OWNER_DRAW_ICON_SIZE; b.Height = ListBoxEx.OWNER_DRAW_ICON_SIZE; bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b); //テキストを描く. b = bounds; b.Y += textmargineY; bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b); brush.Dispose(); bitmap.Dispose(); bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE; return(new Size(bounds.X, bounds.Y)); }
static InputFormRef N_Init(ImageBattleAnimeForm self) { //FEditor Advが文字列長を書いてくれていた場合 uint FEditorHint = InputFormRef.GetFEditorLengthHint(Program.ROM.p32(Program.ROM.RomInfo.image_battle_animelist_pointer())); if (FEditorHint >= 0xFF) {//余りにでかいヒントは信じない FEditorHint = U.NOT_FOUND; } return(new InputFormRef(self , "N_" , Program.ROM.RomInfo.image_battle_animelist_pointer() , 32 , (int i, uint addr) => { //読込最大値検索 //12 20 24 がポインタであればデータがあると考える. if (U.isPointer(Program.ROM.u32(addr + 12)) && U.isPointer(Program.ROM.u32(addr + 20)) && U.isPointer(Program.ROM.u32(addr + 24)) ) { return true; } if (FEditorHint != U.NOT_FOUND && i < FEditorHint) { //不明なデータではあるがFEditorがあるというので信用する. return true; } return false; } , (int i, uint addr) => { String animename = Program.ROM.getString(addr, 8); return U.ToHexString(i + 1) + U.SA(animename) + InputFormRef.GetCommentSA(addr); } )); }
static void ScanSystem(List <FELint.ErrorSt> errors, List <DisassemblerTrumb.LDRPointer> ldrmap) { ROMCheck(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleAnimeForm")) { return; } ImageBattleAnimeForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageBGForm")) { return; } ImageBGForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem UnitForm")) { return; } UnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ClassForm")) { return; } ClassForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ItemForm")) { return; } ItemForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem MoveCostForm")) { return; } MoveCostForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem PatchForm")) { return; } PatchForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitMoveIconFrom")) { return; } ImageUnitMoveIconFrom.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitWaitIconFrom")) { return; } ImageUnitWaitIconFrom.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ItemEffectPointerForm")) { return; } ItemEffectPointerForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageUnitPaletteForm")) { return; } ImageUnitPaletteForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageBattleScreen")) { return; } ImageBattleScreenForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImageMagic")) { return; } ImageMagicFEditorForm.MakeCheckError(errors); ImageMagicCSACreatorForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem Procs")) { return; } ProcsScriptForm.MakeCheckError(errors, ldrmap); if (InputFormRef.DoEvents(null, "ScanSystem MenuDefinition")) { return; } MenuDefinitionForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventUnit")) { return; } EventUnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem AIScript")) { return; } AIScriptForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SongTable")) { return; } SongTableForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ItemWeaponEffect")) { return; } ItemWeaponEffectForm.MakeCheckError(errors); if (Program.ROM.RomInfo.version() == 8) { if (InputFormRef.DoEvents(null, "ScanSystem SoundFootStepsForm")) { return; } SoundFootStepsForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm")) { return; } ImagePortraitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuForm")) { return; } EventHaikuForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkForm")) { return; } EventBattleTalkForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkForm")) { return; } SupportTalkForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm")) { return; } SupportUnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm")) { return; } SoundRoomForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EDForm")) { return; } EDForm.MakeCheckError(errors); } else if (Program.ROM.RomInfo.version() == 7) { if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitForm")) { return; } ImagePortraitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE7Form")) { return; } EventHaikuFE7Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE7Form")) { return; } EventBattleTalkFE7Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE7Form")) { return; } SupportTalkFE7Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportUnitForm")) { return; } SupportUnitForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SoundRoomForm")) { return; } SoundRoomForm.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EDForm")) { return; } EDFE7Form.MakeCheckError(errors); } else { if (InputFormRef.DoEvents(null, "ScanSystem ImagePortraitFE6Form")) { return; } ImagePortraitFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventHaikuFE6Form")) { return; } EventHaikuFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EventBattleTalkFE6Form")) { return; } EventBattleTalkFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem SupportTalkFE6Form")) { return; } SupportTalkFE6Form.MakeCheckError(errors); if (InputFormRef.DoEvents(null, "ScanSystem EDForm")) { return; } EDFE6Form.MakeCheckError(errors); } }
public MainSimpleMenuImageSubForm() { InitializeComponent(); ImageBGButton.BackgroundImage = MakeTransparent(Trim(ImageBGForm.DrawBG(0))); if (Program.ROM.RomInfo.version() >= 7) { BigCGButton.BackgroundImage = MakeTransparent(Trim(ImageCGForm.DrawImageByID(0))); } else { BigCGButton.Hide(); } ImagePortraitButton.BackgroundImage = MakeTransparent(ImagePortraitForm.DrawPortraitUnit(2)); ImageBattleAnimeButton.BackgroundImage = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(1, ImageBattleAnimeForm.ScaleTrim.SCALE_90))); ImageUnitWaitIconButton.BackgroundImage = MakeTransparent(ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(1, 0, false)); ImageUnitMoveIconButton.BackgroundImage = MakeTransparent(ImageUnitMoveIconFrom.DrawMoveUnitIconBitmap(3, 0, 0)); ImageIconButton.BackgroundImage = MakeTransparent(ImageItemIconForm.DrawIconWhereID(0xB)); SystemIconButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.YubiYoko()); //BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.Allows(8)); BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(0)); ImageBattleFieldButton.BackgroundImage = MakeTransparent(ImageBattleBGForm.DrawBG(2)); ImageBattleTerrainButton.BackgroundImage = MakeTransparent((ImageBattleTerrainForm.Draw(2))); if (Program.ROM.RomInfo.version() == 8) { ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(UnitPaletteForm.DrawSample(2, 3))); } else {//for FE6 , FE7 ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID(UnitForm.GetClassID(2)) , ImageBattleAnimeForm.ScaleTrim.SCALE_90, UnitForm.GetPaletteLowClass(2)))); } WorldMapImageButton.BackgroundImage = MakeTransparent(WorldMapImageForm.DrawWorldMap()); if (Program.ROM.RomInfo.version() == 7 && Program.ROM.RomInfo.is_multibyte() == false) {//英語版FE7は、章タイトルをテキストで保持していて、40260c nazo fontで、描画している. ImageChapterTitleButton.Hide(); } else { ImageChapterTitleButton.BackgroundImage = MakeTransparent(ImageChapterTitleForm.DrawSample(0)); } if (ImageUtilMagic.SearchMagicSystem() != ImageUtilMagic.magic_system_enum.NO) { ImageMagicButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(8 - 3)); } else { ImageMagicButton.Hide(); } if (Program.ROM.RomInfo.is_multibyte()) { OptionForm.textencoding_enum textencoding = OptionForm.textencoding(); if (textencoding == OptionForm.textencoding_enum.ZH_TBL) { // FontButton.BackgroundImage = MakeTransparent(FontZHForm.DrawFontString("字形", true)); } else { FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("フォント", true)); } } else { FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("Font", true)); } }
private void B5_ValueChanged(object sender, EventArgs e) { X_PIC5.Image = ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID((uint)N_B5.Value) , ImageBattleAnimeForm.ScaleTrim.SCALE_90, (uint)B5.Value); }
public static void GotoEvent(FELint.Type dataType, uint addr, uint tag, uint mapid) { if (dataType == FELint.Type.EVENTSCRIPT || dataType == FELint.Type.WORLDMAP_EVENT) {//イベント内で発生したエラー EventScriptForm f = (EventScriptForm)InputFormRef.JumpForm <EventScriptForm>(U.NOT_FOUND); f.JumpTo(addr, tag); return; } else if (dataType == FELint.Type.PROCS) { ProcsScriptForm f = (ProcsScriptForm)InputFormRef.JumpForm <ProcsScriptForm>(U.NOT_FOUND); f.JumpTo(addr, tag); return; } else if (dataType == FELint.Type.AISCRIPT) { AIScriptForm f = (AIScriptForm)InputFormRef.JumpForm <AIScriptForm>(tag); return; } else if (dataType == FELint.Type.MAPSETTING_PLIST_OBJECT || dataType == FELint.Type.MAPSETTING_PLIST_CONFIG || dataType == FELint.Type.MAPSETTING_PLIST_MAP || dataType == FELint.Type.MAPSETTING_PLIST_PALETTE || dataType == FELint.Type.MAPSETTING_PLIST_MAPCHANGE || dataType == FELint.Type.MAPSETTING_PLIST_ANIMETION1 || dataType == FELint.Type.MAPSETTING_PLIST_ANIMETION2 || dataType == FELint.Type.MAPSETTING_WORLDMAP || dataType == FELint.Type.MAPSETTING ) { if (Program.ROM.RomInfo.version() == 6) { InputFormRef.JumpForm <MapSettingFE6Form>(mapid); } else if (Program.ROM.RomInfo.version() == 7) { if (!Program.ROM.RomInfo.is_multibyte()) { InputFormRef.JumpForm <MapSettingFE7UForm>(mapid); } else { InputFormRef.JumpForm <MapSettingFE7Form>(mapid); } } else { InputFormRef.JumpForm <MapSettingForm>(mapid); } return; } else if (dataType == FELint.Type.BATTLE_ANIME) { ImageBattleAnimeForm f = (ImageBattleAnimeForm)InputFormRef.JumpForm <ImageBattleAnimeForm>(U.NOT_FOUND); f.JumpToAnimeID(tag); return; } else if (dataType == FELint.Type.BATTLE_ANIME_CLASS) { ImageBattleAnimeForm f = (ImageBattleAnimeForm)InputFormRef.JumpForm <ImageBattleAnimeForm>(U.NOT_FOUND); f.JumpToClassID(tag); return; } else if (dataType == FELint.Type.BG) { InputFormRef.JumpForm <ImageBGForm>(tag); return; } else if (dataType == FELint.Type.PORTRAIT) { if (Program.ROM.RomInfo.version() == 6) { InputFormRef.JumpForm <ImagePortraitFE6Form>(tag); } else { InputFormRef.JumpForm <ImagePortraitForm>(tag); } return; } else if (dataType == FELint.Type.HAIKU) { if (Program.ROM.RomInfo.version() == 8) { InputFormRef.JumpForm <EventHaikuForm>(tag); } else if (Program.ROM.RomInfo.version() == 7) { InputFormRef.JumpForm <EventHaikuFE7Form>(tag); } else { InputFormRef.JumpForm <EventHaikuFE6Form>(tag); } return; } else if (dataType == FELint.Type.BATTTLE_TALK) { if (Program.ROM.RomInfo.version() == 8) { InputFormRef.JumpForm <EventBattleTalkForm>(tag); } else if (Program.ROM.RomInfo.version() == 7) { InputFormRef.JumpForm <EventBattleTalkFE7Form>(tag); } else { InputFormRef.JumpForm <EventBattleTalkFE6Form>(tag); } return; } else if (dataType == FELint.Type.SUPPORT_TALK) { if (Program.ROM.RomInfo.version() == 8) { InputFormRef.JumpForm <SupportTalkForm>(tag); } else if (Program.ROM.RomInfo.version() == 7) { InputFormRef.JumpForm <SupportTalkFE7Form>(tag); } else { InputFormRef.JumpForm <SupportTalkFE6Form>(tag); } return; } else if (dataType == FELint.Type.SUPPORT_UNIT) { if (Program.ROM.RomInfo.version() == 6) { SupportUnitFE6Form f = (SupportUnitFE6Form)InputFormRef.JumpForm <SupportUnitFE6Form>(); f.JumpToAddr(addr); } else { SupportUnitForm f = (SupportUnitForm)InputFormRef.JumpForm <SupportUnitForm>(); f.JumpToAddr(addr); } return; } else if (dataType == FELint.Type.CLASS) { if (Program.ROM.RomInfo.version() == 6) { InputFormRef.JumpForm <ClassFE6Form>(tag); } else { InputFormRef.JumpForm <ClassForm>(tag); } return; } else if (dataType == FELint.Type.ITEM) { if (Program.ROM.RomInfo.version() == 6) { InputFormRef.JumpForm <ItemFE6Form>(tag); } else { InputFormRef.JumpForm <ItemForm>(tag); } return; } else if (dataType == FELint.Type.ITEM_WEAPON_EFFECT) { ItemWeaponEffectForm f = (ItemWeaponEffectForm)InputFormRef.JumpForm <ItemWeaponEffectForm>(U.NOT_FOUND); f.JumpTo(tag); return; } else if (dataType == FELint.Type.UNIT) { if (Program.ROM.RomInfo.version() == 8) { InputFormRef.JumpForm <UnitForm>(tag); } else if (Program.ROM.RomInfo.version() == 7) { InputFormRef.JumpForm <UnitFE7Form>(tag); } else { InputFormRef.JumpForm <UnitFE6Form>(tag); } return; } else if (dataType == FELint.Type.MAPCHANGE) { MapChangeForm f = (MapChangeForm)InputFormRef.JumpForm <MapChangeForm>(tag); f.JumpToMAPIDAndAddr(mapid, tag); return; } else if (dataType == FELint.Type.SOUND_FOOT_STEPS) { SoundFootStepsForm f = (SoundFootStepsForm)InputFormRef.JumpForm <SoundFootStepsForm>(tag); return; } else if (dataType == FELint.Type.MOVECOST_NORMAL) { if (Program.ROM.RomInfo.version() == 6) { MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>(); f.JumpToClassID(tag, 0 + 1); } else { MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>(); f.JumpToClassID(tag, 0 + 1); } return; } else if (dataType == FELint.Type.MOVECOST_RAIN) { if (Program.ROM.RomInfo.version() == 6) { MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>(); f.JumpToClassID(tag, 1 + 1); } else { MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>(); f.JumpToClassID(tag, 1 + 1); } return; } else if (dataType == FELint.Type.MOVECOST_SHOW) { if (Program.ROM.RomInfo.version() == 6) { MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>(); f.JumpToClassID(tag, 2 + 1); } else { MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>(); f.JumpToClassID(tag, 2 + 1); } return; } else if (dataType == FELint.Type.MOVECOST_AVOID) { if (Program.ROM.RomInfo.version() == 6) { MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>(); f.JumpToClassID(tag, 3 + 1); } else { MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>(); f.JumpToClassID(tag, 3 + 1); } return; } else if (dataType == FELint.Type.MOVECOST_DEF) { if (Program.ROM.RomInfo.version() == 6) { MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>(); f.JumpToClassID(tag, 4 + 1); } else { MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>(); f.JumpToClassID(tag, 4 + 1); } return; } else if (dataType == FELint.Type.MOVECOST_RES) { if (Program.ROM.RomInfo.version() == 6) { MoveCostFE6Form f = (MoveCostFE6Form)InputFormRef.JumpForm <MoveCostFE6Form>(); f.JumpToClassID(tag, 5 + 1); } else { MoveCostForm f = (MoveCostForm)InputFormRef.JumpForm <MoveCostForm>(); f.JumpToClassID(tag, 5 + 1); } return; } else if (dataType == FELint.Type.OP_CLASS_DEMO) { if (Program.ROM.RomInfo.version() == 7 && Program.ROM.RomInfo.is_multibyte()) { InputFormRef.JumpForm <OPClassDemoFE7Form>(tag); } else if (Program.ROM.RomInfo.version() == 7 && !Program.ROM.RomInfo.is_multibyte()) { InputFormRef.JumpForm <OPClassDemoFE7UForm>(tag); } else if (Program.ROM.RomInfo.version() == 8 && Program.ROM.RomInfo.is_multibyte()) { InputFormRef.JumpForm <OPClassDemoForm>(tag); } else if (Program.ROM.RomInfo.version() == 8 && !Program.ROM.RomInfo.is_multibyte()) { InputFormRef.JumpForm <OPClassDemoFE8UForm>(tag); } return; } else if (dataType == FELint.Type.WMAP_BASE_POINT) { if (Program.ROM.RomInfo.version() == 8) { InputFormRef.JumpForm <WorldMapPointForm>(tag); } return; } else if (dataType == FELint.Type.SOUNDROOM) { if (Program.ROM.RomInfo.version() == 6) { InputFormRef.JumpForm <SoundRoomFE6Form>(tag); } else { InputFormRef.JumpForm <SoundRoomForm>(tag); } return; } else if (dataType == FELint.Type.SENSEKI) { if (Program.ROM.RomInfo.version() == 7) { InputFormRef.JumpForm <EDSensekiCommentForm>(tag); } return; } else if (dataType == FELint.Type.DIC) { if (Program.ROM.RomInfo.version() == 8) { InputFormRef.JumpForm <TextDicForm>(U.NOT_FOUND); } return; } else if (dataType == FELint.Type.MENU) { MenuCommandForm f = (MenuCommandForm)InputFormRef.JumpForm <MenuCommandForm>(); f.JumpToAddr(addr); return; } else if (dataType == FELint.Type.STATUS) { InputFormRef.JumpForm <StatusParamForm>(); return; } else if (dataType == FELint.Type.ED) { if (Program.ROM.RomInfo.version() == 6) { InputFormRef.JumpForm <EDFE6Form>(); } else if (Program.ROM.RomInfo.version() == 7) { InputFormRef.JumpForm <EDFE7Form>(); } else { InputFormRef.JumpForm <EDForm>(); } return; } else if (dataType == FELint.Type.TERRAIN) { if (Program.ROM.RomInfo.is_multibyte()) { InputFormRef.JumpForm <MapTerrainNameForm>(); } else { InputFormRef.JumpForm <MapTerrainNameEngForm>(); } return; } else if (dataType == FELint.Type.SKILL_CONFIG) { if (Program.ROM.RomInfo.version() == 8) { PatchUtil.skill_system_enum skill = PatchUtil.SearchSkillSystem(); if (skill == PatchUtil.skill_system_enum.SkillSystem) { InputFormRef.JumpForm <SkillConfigSkillSystemForm>(); } else if (skill == PatchUtil.skill_system_enum.FE8N || skill == PatchUtil.skill_system_enum.yugudora || skill == PatchUtil.skill_system_enum.FE8N_ver2 ) { InputFormRef.JumpForm <SkillConfigFE8NSkillForm>(); } } return; } else if (dataType == FELint.Type.RMENU) { InputFormRef.JumpForm <StatusRMenuForm>(tag); return; } else if (dataType == FELint.Type.ITEM_USAGE_POINTER) { InputFormRef.JumpForm <ItemUsagePointerForm>(tag); return; } else if (dataType == FELint.Type.PATCH) { PatchForm f = (PatchForm)InputFormRef.JumpForm <PatchForm>(); f.SelectPatchByTag(tag); return; } else if (dataType == FELint.Type.MAPEXIT) { InputFormRef.JumpForm <MapExitPointForm>(tag); return; } else if (dataType == FELint.Type.IMAGE_UNIT_WAIT_ICON) { InputFormRef.JumpForm <ImageUnitWaitIconFrom>(tag); return; } else if (dataType == FELint.Type.IMAGE_UNIT_MOVE_ICON) { InputFormRef.JumpForm <ImageUnitMoveIconFrom>(tag); return; } else if (dataType == FELint.Type.ITEM_EEFECT_POINTER) { InputFormRef.JumpForm <ItemEffectPointerForm>(tag); return; } else if (dataType == FELint.Type.IMAGE_UNIT_PALETTE) { InputFormRef.JumpForm <ImageUnitPaletteForm>(tag); return; } else if (dataType == FELint.Type.IMAGE_BATTLE_SCREEN) { InputFormRef.JumpForm <ImageBattleScreenForm>(); return; } else if (dataType == FELint.Type.ASM) { DisASMForm f = (DisASMForm)InputFormRef.JumpForm <DisASMForm>(U.NOT_FOUND); f.JumpTo(DisassemblerTrumb.ProgramAddrToPlain(tag)); return; } else if (dataType == FELint.Type.ASMDATA) { HexEditorForm f = (HexEditorForm)InputFormRef.JumpForm <HexEditorForm>(); f.JumpTo(tag); return; } else if (dataType == FELint.Type.STATUS_UNITS_MENU) { InputFormRef.JumpForm <StatusUnitsMenuForm>(tag); return; } else if (dataType == FELint.Type.TEXTID_FOR_SYSTEM) { return; } else if (dataType == FELint.Type.TEXTID_FOR_USER) { return; } else if (dataType == FELint.Type.POINTER_TALKGROUP) { EventTalkGroupFE7Form f = (EventTalkGroupFE7Form)InputFormRef.JumpForm <EventTalkGroupFE7Form>(); f.JumpToAddr(addr); return; } else if (dataType == FELint.Type.POINTER_MENUEXTENDS) { MenuExtendSplitMenuForm f = (MenuExtendSplitMenuForm)InputFormRef.JumpForm <MenuExtendSplitMenuForm>(); f.JumpToAddr(addr); return; } else if (dataType == FELint.Type.POINTER_UNITSSHORTTEXT) { UnitsShortTextForm f = (UnitsShortTextForm)InputFormRef.JumpForm <UnitsShortTextForm>(); f.JumpTo(addr); return; } else if (dataType == FELint.Type.MAGIC_ANIME_EXTENDS) { if (tag >= Program.ROM.RomInfo.magic_effect_original_data_count()) { tag -= Program.ROM.RomInfo.magic_effect_original_data_count(); } ImageUtilMagic.magic_system_enum magic = ImageUtilMagic.SearchMagicSystem(); if (magic == ImageUtilMagic.magic_system_enum.FEDITOR_ADV) { InputFormRef.JumpForm <ImageMagicFEditorForm>(tag); } else if (magic == ImageUtilMagic.magic_system_enum.CSA_CREATOR) { InputFormRef.JumpForm <ImageMagicCSACreatorForm>(tag); } return; } else if (dataType == FELint.Type.FELINT_SYSTEM_ERROR) { InputFormRef.JumpForm <ToolProblemReportForm>(); return; } else if (dataType == FELint.Type.STATUS_GAME_OPTION) { InputFormRef.JumpForm <StatusOptionForm>(tag); return; } //イベント { EventCondForm f = (EventCondForm)InputFormRef.JumpForm <EventCondForm>(U.NOT_FOUND); f.JumpToMAPIDAndAddr(mapid, FELint.TypeToEventCond(dataType), (uint)addr); } }
public static void MakeLZ77DataList(List <Address> list) { //誤爆すると面倒なことになるフレームとOAMのデータ群 Dictionary <uint, bool> battleFrameDic = new Dictionary <uint, bool>(); ImageBattleAnimeForm.MakeBattleFrameAndOAMDictionary(battleFrameDic); string name = R._("圧縮データ"); uint length = (uint)Program.ROM.Data.Length - 4; for (uint addr = 0x100; addr < length; addr += 4) { uint a = (uint)Program.ROM.Data[addr + 3]; if (a != 0x08 && a != 0x09) {//ポインタ以外無視する. continue; } a = Program.ROM.p32(addr); if (!U.isSafetyOffset(a)) {//危険なポインタは無視 continue; } if (a < Program.ROM.RomInfo.compress_image_borderline_address()) { continue; } if (battleFrameDic.ContainsKey(a)) {//戦闘アニメのフレーム,OAM等のlz77で圧縮されているデータ continue; } //ポインタ先は圧縮されているか? uint imageDataSize = LZ77.getUncompressSize(Program.ROM.Data, a); if (IsBadImageSize(imageDataSize)) { continue; } //ポインタは連続してあらわれるのでそのチェックをする. if (!IsContinuousPointer(addr, length)) { continue; } //解凍して中身を見てみる. byte[] image = LZ77.decompress(Program.ROM.Data, a); if (image.Length != imageDataSize) {//解凍したらデータ容量が違う continue; } uint getcompsize = LZ77.getCompressedSize(Program.ROM.Data, a); if (getcompsize == 0) { continue; } //たぶん画像だと判断する. FEBuilderGBA.Address.AddAddress(list, a, getcompsize, addr, name + U.To0xHexString(a), Address.DataTypeEnum.LZ77IMG); if (InputFormRef.DoEvents(null, "MakeLZ77DataList " + U.ToHexString(addr))) { return; } } }
public static List <FoundImage> FindImage() { //誤爆すると面倒なことになるフレームとOAMのデータ群 Dictionary <uint, bool> battleFrameDic = new Dictionary <uint, bool>(); ImageBattleAnimeForm.MakeBattleFrameAndOAMDictionary(battleFrameDic); List <FoundImage> list = new List <FoundImage>(); uint length = (uint)Program.ROM.Data.Length - 4; for (uint addr = 0x100; addr < length; addr += 4) { uint a = (uint)Program.ROM.Data[addr + 3]; if (a != 0x08 && a != 0x09) {//ポインタ以外無視する. continue; } a = Program.ROM.p32(addr); if (!U.isSafetyOffset(a)) {//危険なポインタは無視 continue; } if (a < Program.ROM.RomInfo.compress_image_borderline_address()) { continue; } if (battleFrameDic.ContainsKey(a)) {//戦闘アニメのフレーム,OAM等のlz77で圧縮されているデータ continue; } //ポインタ先は圧縮されているか? uint imageDataSize = LZ77.getUncompressSize(Program.ROM.Data, a); if (IsBadImageSize(imageDataSize)) { continue; } //ポインタは連続してあらわれるのでそのチェックをする. if (!IsContinuousPointer(addr, length)) { continue; } //ポインタ先をすでに知っている場合は無視. if (IsAlrealyFoundImage(list, a)) { continue; } //解凍して中身を見てみる. byte[] image = LZ77.decompress(Program.ROM.Data, a); if (image.Length != imageDataSize) {//解凍したらデータ容量が違う continue; } // if (IsTSAData(image, 0, imageDataSize)) // { // continue; // } // if (IsHeaderTSAData(image, 0, imageDataSize)) // { // continue; // } //たぶん画像だと判断する. list.Add(new FoundImage(addr, a, imageDataSize)); } return(list); }