Esempio n. 1
0
        //全データの取得
        public static void MakeAllDataLength(List <Address> list)
        {
            string       selfname     = "SongTable";
            InputFormRef InputFormRef = Init(null);

            FEBuilderGBA.Address.AddAddress(list, InputFormRef, selfname, new uint[] { 0 });
            uint songpointer = InputFormRef.BaseAddress;

            for (int i = 0; i < InputFormRef.DataCount; i++, songpointer += InputFormRef.BlockSize)
            {
                uint songaddr = Program.ROM.p32(songpointer);
                if (!U.isSafetyOffset(songaddr))
                {
                    continue;
                }

                {//楽譜
                    string name = "Song" + U.ToHexString(i) + " ";
                    //リサイクルで回収できるので、仮にこのデータをリサイクルするとしたら、どうなるだけ求める(実際にリサイクルはしない)
                    SongUtil.RecycleOldSong(ref list, name, songpointer);
                }

                uint instpointer = songaddr + 4;
                //uint instaddr = Program.ROM.p32(instpointer);
                {//楽器
                    string name = "SongInst" + U.ToHexString(i) + " ";
                    SongInstrumentForm.RecycleOldInstrument(ref list, name, instpointer);
                }
            }
        }
Esempio n. 2
0
            bool _prepare_WaveMemory(byte[] instrument_code, string key, bool is_deps)
            {
                Debug.Assert(SongInstrumentForm.IsWaveMemory(instrument_code[0]));
                uint sample_location = U.p32(instrument_code, 4);

                if (sample_location > this.Data.Length)
                {
                    this.ErrorMessage += "\r\n" +
                                         R.Error("DirectSoundの中に、おかしなデータがありました。無視します。 sample_location:{0} > {1} ROM Size"
                                                 , U.To0xHexString(sample_location), U.To0xHexString(this.Data.Length));

                    //ダメな楽器として認識する.
                    return(false);
                }

                List <byte> current_sample = U.subrangeToList(this.Data, sample_location, sample_location + 16);

                //4バイトアライメント
                while ((current_sample.Count % 4) != 0)
                {
                    current_sample.Add(0);
                }

                Log.Debug(U.HexDump(instrument_code));

                U.write_u32(instrument_code, 4, (uint)this.Sample_data.Count);
                this.Sample_data.AddRange(current_sample);
                Log.Debug(R._("SampleData:{0} bytes (append({1}bytes))", this.Sample_data.Count, current_sample.Count));

                return(true);
            }
Esempio n. 3
0
            bool _prepare_DirectSound(byte[] instrument_code, string key, bool is_deps)
            {
                Debug.Assert(SongInstrumentForm.IsDirectSound(instrument_code[0]));
                uint sample_location = U.p32(instrument_code, 4);

                if (sample_location > this.Data.Length)
                {
                    this.ErrorMessage += "\r\n" +
                                         R.Error("DirectSoundの中に、おかしなデータがありました。無視します。 sample_location:{0} > {1} ROM Size"
                                                 , U.To0xHexString(sample_location), U.To0xHexString(this.Data.Length));

                    //ダメな楽器として認識する.
                    return(false);
                }
                uint sample_hz1024 = U.u32(this.Data, sample_location + 4) / 1024;
                uint sample_length = SongUtil.GetDirectSoundWaveDataLength(this.Data, sample_location);

                Log.Debug(R._("DirectSound Sample:{0} bytes ({1} *1024 hz)", sample_length, sample_hz1024));

                if (is_deps)
                {
                    if (sample_length > 1024 * 1024 * 1 || //1MB
                        sample_hz1024 > 48 * 1024          //48khz Over
                        )
                    {
                        this.ErrorMessage += "\r\n" +
                                             R.Error("Multi または Drumの中に、おかしなデータがありました。無視します。 OverHZ Sample:{0} bytes ({1} *1024 hz)", sample_length, sample_hz1024);

                        //ダメな楽器として認識する.
                        return(false);
                    }
                }

                List <byte> current_sample = U.subrangeToList(this.Data, sample_location, sample_location + 16 + sample_length);

                //4バイトアライメント
                while ((current_sample.Count % 4) != 0)
                {
                    current_sample.Add(0);
                }

                Log.Debug(Instrument_mapping.Count.ToString(), sample_length.ToString("X"), this.Sample_data.Count.ToString("X"));

                U.write_u32(instrument_code, 4, (uint)this.Sample_data.Count);
                this.Sample_data.AddRange(current_sample);
                Log.Debug(R._("SampleData:{0} bytes (append({1}bytes))", this.Sample_data.Count, current_sample.Count));

                return(true);
            }
Esempio n. 4
0
        public void Init(uint instaddr, SongUtil.Track track)
        {
            this.SongInstrumentList     = SongInstrumentForm.MakeList(instaddr);
            this.ChangeVoices           = SongUtil.GetVoices(track);
            this.VolNumericUpDown.Value = 0;
            this.PanNumericUpDown.Value = 0;

            this.VoiceListbox.BeginUpdate();
            for (int i = 0; i < this.ChangeVoices.Count; i++)
            {
                string v = GetVoiceName(this.ChangeVoices[i]);
                this.VoiceListbox.Items.Add(v);
            }
            this.VoiceListbox.EndUpdate();

            this.Address.Value = Program.ROM.p32((uint)track.basepointer);
        }
Esempio n. 5
0
        public void Init(uint instaddr, List <SongUtil.Track> tracks)
        {
            this.SongInstrumentList = SongInstrumentForm.MakeList(instaddr);

            this.ChangeVoices = new List <SongUtil.ChangeVoiceSt>();
            for (int i = 0; i < tracks.Count; i++)
            {
                SongUtil.GetVoices(tracks[i], ref this.ChangeVoices);
            }
            this.VolNumericUpDown.Value = 0;
            this.PanNumericUpDown.Value = 0;

            this.VoiceListbox.BeginUpdate();
            for (int i = 0; i < this.ChangeVoices.Count; i++)
            {
                string v = GetVoiceName(this.ChangeVoices[i]);
                this.VoiceListbox.Items.Add(v);
            }
            this.VoiceListbox.EndUpdate();
        }
Esempio n. 6
0
        static void MakeAllDataLength_Song_And_Inst(List <Address> list, int i, uint songpointer)
        {
            uint songaddr = Program.ROM.p32(songpointer);

            if (!U.isSafetyOffset(songaddr))
            {
                return;
            }

            {//楽譜
                string name = "Song" + U.ToHexString(i) + " ";
                //リサイクルで回収できるので、仮にこのデータをリサイクルするとしたら、どうなるだけ求める(実際にリサイクルはしない)
                SongUtil.RecycleOldSong(ref list, name, songpointer);
            }

            uint instpointer = songaddr + 4;
            //uint instaddr = Program.ROM.p32(instpointer);
            {//楽器
                string name = "SongInst" + U.ToHexString(i) + " ";
                SongInstrumentForm.RecycleOldInstrument(ref list, name, instpointer);
            }
        }
Esempio n. 7
0
            uint _prepare(byte[] instrument_code, string key, bool is_deps)
            {
                // Fix instrument pointer to be an offset relative to start of sample data.
                // The pointer for the first instrument - which is the percussion map - is
                // of course relative to the start of instrument data, being zero. The
                // burn procedure is aware of this.
                if (is_deps && (instrument_code[0] == 0x80 || instrument_code[0] == 0x40))
                {
                    //print "song in song error!"
                    //print hexdump(instrument_code)
                    Log.Error(U.HexDump(instrument_code));
                    this.ErrorMessage += "\r\n" +
                                         R.Error("Multi または Drumの中に、さらにMulti または Drumがありました。\r\nこういう複雑なものは対応できないので無視します。\r\n");

                    instrument_code = bad_inst();
                    Debug.Assert(false);
                }
                else if (SongInstrumentForm.IsDirectSound(instrument_code[0]))
                {
                    bool success = _prepare_DirectSound(instrument_code, key, is_deps);
                    if (success == false)
                    {
                        instrument_code = bad_inst();
                    }
                }
                else if (SongInstrumentForm.IsWaveMemory(instrument_code[0]))
                {
                    bool success = _prepare_WaveMemory(instrument_code, key, is_deps);
                    if (success == false)
                    {
                        instrument_code = bad_inst();
                    }
                }
                else if (instrument_code[0] == 0x80)
                {
                    Log.Debug("Drum");
                    Log.Debug(U.HexDump(instrument_code));

                    //drum instrument is always id:0
                    this.Instrument_mapping[key] = 0;
                    return(0);
                }
                else if (instrument_code[0] == 0x40)
                {
                    bool success = _prepare_MultiSample(instrument_code, key, is_deps);
                    if (success == false)
                    {
                        instrument_code = bad_inst();
                    }
                }
                else
                {
                    Log.Debug("???");
                    Log.Debug(U.HexDump(instrument_code));
                }
                Debug.Assert(instrument_code.Length >= 0xC);

                uint result = this.Count();

                this.Instrument_mapping[key] = result;
                this.Instrument_codes.AddRange(instrument_code);
                return(result);
            }
Esempio n. 8
0
        void Burn(SongSt song, InstrumentMap instrument_map, List <List <byte> > trackdata)
        {
            //必要なサイズを計算する.
            uint use_size = 8 + (4 * (uint)trackdata.Count); //ヘッダー

            for (int track = 0; track < trackdata.Count; track++)
            {
                use_size += (uint)trackdata[track].Count;                     //楽譜
            }
            use_size  = U.Padding4(use_size);                                 //楽譜と楽器の間は 4バイトアライメントが必要.
            use_size += (uint)(instrument_map.Instrument_mapping.Count * 12); //楽器
            use_size += (uint)instrument_map.Sample_data.Count;               //楽器データ

            uint write_pointer = InputFormRef.AllocBinaryData(use_size);

            if (write_pointer == U.NOT_FOUND)
            {
                R.ShowStopError("データサイズを({0})確保できません。\r\nROM容量がもうないか、音楽のパースに失敗しています。", use_size);
                return;
            }
            U.toPointer(write_pointer);

            byte[] data = new byte[use_size];
            U.write_u8(data, 0, (uint)trackdata.Count); //トラック数
            U.write_u8(data, 1, 0x0);                   //常にゼロ.
            U.write_u8(data, 2, 0x0A);                  //Do these values matter?
            U.write_u8(data, 3, 0x80);                  //This is just copying what the stock ROM does...
            uint offset = 8 + (4 * (uint)trackdata.Count);

            //データ構造
            //ヘッダー
            //[track数] [0] [0x0A] [0x80] [楽器ポンタ] [楽譜1ポインタ] [楽譜2ポインタ].... [楽譜Nポインタ]
            //
            //実データ
            //[楽譜1データ].......
            //[楽譜2データ].......
            //
            //[楽器データ]
            //[楽器サンプルデータ]

            //楽譜
            for (int track = 0; track < trackdata.Count; track++)
            {
                //楽譜ポインタの書き込み
                U.write_u32(data, 8 + (4 * (uint)track), U.toPointer(write_pointer + offset));

                //楽譜データを書き込む.
                burn_track(data, offset, write_pointer, trackdata[track].ToArray());
                offset += (uint)trackdata[track].Count;
            }
            offset = U.Padding4(offset); //楽譜と楽器の間は 4バイトアライメントが必要.

            //楽器ポインタ
            U.write_u32(data, 4, U.toPointer(write_pointer + offset));

            uint instrument_start     = offset;                                                                  //楽器開始
            uint instrumentdata_start = instrument_start + (12 * (uint)instrument_map.Instrument_mapping.Count); //楽器データ開始

            Log.Debug("instrumentdata_start(", instrumentdata_start.ToString(), ") = instrument_start(", instrument_start.ToString(), ") + 12 * instrument_count(", instrument_map.Instrument_mapping.Count.ToString(), ")");



            U.write_range(data, instrument_start, instrument_map.Instrument_codes.ToArray());
            U.write_range(data, instrumentdata_start, instrument_map.Sample_data.ToArray());

            //楽器
            uint resyclesize = 0;

            for (int i = 0; i < instrument_map.Instrument_mapping.Count; i++)
            {
                uint this_instrument = instrument_start + (12 * (uint)i);

                Log.Debug("track:", i.ToString(), " ", data[this_instrument + 0].ToString());
                uint instrumentCode = U.u8(data, this_instrument + 0);
                if (SongInstrumentForm.IsDirectSound(instrumentCode) ||
                    SongInstrumentForm.IsWaveMemory(instrumentCode))
                {
                    uint sample_data_start = U.u32(data, this_instrument + 4);
                    sample_data_start += instrumentdata_start;
                    if (sample_data_start < resyclesize)
                    {
                        Log.Error("BAD INSTRUMENT:", i.ToString(), (sample_data_start - instrumentdata_start).ToString(), sample_data_start.ToString(), resyclesize.ToString());
                        continue;
                    }
                    sample_data_start -= resyclesize;
                    uint sample_data_len;
                    if (SongInstrumentForm.IsWaveMemory(instrumentCode))
                    {
                        sample_data_len = 16;
                    }
                    else
                    {
                        sample_data_len = U.u32(data, sample_data_start + 12);
                        sample_data_len = U.Padding4(sample_data_len);
                    }
                    Log.Debug("d ", sample_data_start.ToString("X"), " ", sample_data_len.ToString());

                    uint found_address = U.Grep(Program.ROM.Data, U.subrange(data, sample_data_start, sample_data_start + sample_data_len), 100, 0, 4);
                    if (found_address != U.NOT_FOUND)
                    {
                        Log.Debug("recycle ", sample_data_start.ToString("X"), " len ", sample_data_len.ToString(), " -> ", found_address.ToString("X"));
                        //existing address in ROM.
                        //recycle
                        data = U.del(data, sample_data_start, sample_data_start + sample_data_len);
                        U.write_u32(data, this_instrument + 4, U.toPointer(found_address));

                        resyclesize += sample_data_len;
                    }
                    else
                    {
                        //nothing to recycle, write the data.
                        uint baseoffset = U.u32(data, this_instrument + 4); //相対アドレスが書いてあるので、それを求めに絶対値に変換する
                        U.write_u32(data, this_instrument + 4
                                    , U.toPointer((instrumentdata_start + write_pointer + baseoffset) - resyclesize));
                    }
                }
                else if (instrumentCode == 0x80)
                {                                                       //ドラム
                    uint baseoffset = U.u32(data, this_instrument + 4); //相対アドレスが書いてあるので、それを求めに絶対値に変換する
                    U.write_u32(data, this_instrument + 4
                                , U.toPointer(instrument_start + write_pointer + baseoffset));
                }
                else if (instrumentCode == 0x40)
                {
                    Log.Debug("MULTI TRACK!");
                    uint baseoffset = U.u32(data, this_instrument + 4); //相対アドレスが書いてあるので、それを求めに絶対値に変換する
                    U.write_u32(data, this_instrument + 4
                                , U.toPointer(instrument_start + write_pointer + baseoffset));


                    baseoffset = U.u32(data, this_instrument + 8); //相対アドレスが書いてあるので、それを求めに絶対値に変換する
                    U.write_u32(data, this_instrument + 8
                                , U.toPointer((instrumentdata_start + write_pointer + baseoffset) - resyclesize));
                }
            }
            Log.Notify("resyclesize:", resyclesize.ToString(), U.To0xHexString(resyclesize));

            string undo_name = "";

            Undo.UndoData undodata = Program.Undo.NewUndoData(undo_name);
            undodata.list.Add(new Undo.UndoPostion(song.table, 8));

            Program.ROM.write_u32(song.table, U.toPointer(write_pointer));
            InputFormRef.WriteBinaryDataDirect(write_pointer, data, undodata);

            uint priority = GetSongPriority(trackdata.Count);

            Program.ROM.write_u32(song.table + 4, priority, undodata);

            Program.Undo.Push(undodata);
        }
        static InputFormRef Init(Form self)
        {
            if (self != null || InstrumentHint == null)
            {
                PreLoadResourceInstrumentHint(U.ConfigDataFilename("song_instrument_"));
            }

            return(new InputFormRef(self
                                    , ""
                                    , new List <String> {
                "N00_", "N01_", "N02_", "N03_", "N04_", "N08_", "N09_", "N0A_", "N0B_", "N0C_", "N10_", "N40_", "N80_"
            }
                                    , 0
                                    , 12
                                    , (int i, uint addr) =>
            {     //読込最大値検索
                if (i >= 128)
                { //最大数over!
                    return false;
                }

                uint type = Program.ROM.u8(addr + 0);
                if (type == 0x00 ||     //directosound
                    type == 0x08 ||     //directosound
                    type == 0x10 ||     //directosound
                    type == 0x18 ||     //directosound
                    type == 0x03 ||     //wave
                    type == 0x0B ||     //wave
                    type == 0x80        //drum
                    )
                {
                    uint p = Program.ROM.u32(addr + 4);
                    if (!U.isSafetyPointer(p))
                    {    //不正なアドレス
                        return false;
                    }
                    return true;
                }
                if (type == 0x40)     //multisamples
                {
                    uint p = Program.ROM.u32(addr + 4);
                    if (!U.isSafetyPointer(p))
                    {    //不正なアドレス
                        return false;
                    }
                    p = Program.ROM.u32(addr + 8);
                    if (!U.isSafetyPointer(p))
                    {    //不正なアドレス
                        return false;
                    }
                    return true;
                }

                if (type == 0x01 ||  //Square Wave(Without Data)
                    type == 0x02 ||     //Square Wave(Without Data)
                    type == 0x03 ||     //Square Wave(Without Data)
                    type == 0x04 ||     //Noise(Without Data)
                    type == 0x09 ||     //Square Wave(Without Data)
                    type == 0x0A ||     //Square Wave(Without Data)
                    type == 0x0C        //Square Wave(Without Data)
                    )
                {
                    return true;
                }

                return false;
            }
                                    , (int i, uint addr) =>
            {
                string fingerprint = SongInstrumentForm.FingerPrint(addr);
                if (fingerprint != "")
                {
                    InstrumentHintSt hint;
                    if (InstrumentHint.TryGetValue(fingerprint, out hint))
                    {
                        return U.ToHexString(i) + " " + hint.name;
                    }
                }
                uint type = Program.ROM.u8(addr);
                return U.ToHexString(i) + " " + GetInstrumentTypeName(type);
            }
                                    ));
        }
Esempio n. 10
0
        public static void MakeCheckError(List <FELint.ErrorSt> errors, uint songid, uint songaddr, bool isMapBGM)
        {
            if (songaddr == 0)
            {
                return;
            }
            if (!U.isSafetyOffset(songaddr))
            {
                return;
            }
            uint trackCount = Program.ROM.u8(songaddr + 0);

            if (songid == 0)
            {
                if (trackCount != 0)
                {
                    errors.Add(new FELint.ErrorSt(FELint.Type.SONGTRACK, songaddr
                                                  , R._("SongID {0}のトラックは常に0である必要があります。現在値:{1}", U.To0xHexString(songid), U.To0xHexString(trackCount)), songid));
                }
                return;
            }
            if (trackCount > 16)
            {
                errors.Add(new FELint.ErrorSt(FELint.Type.SONGTRACK, songaddr
                                              , R._("SongID {0}のトラックは常に16以内である必要があります。現在値:{1}", U.To0xHexString(songid), U.To0xHexString(trackCount)), songid));
            }
            if (trackCount == 0)
            {//トラック数が0のダミートラックの場合、チェックしない
                return;
            }

            //楽器のチェック
            uint instPointer = Program.ROM.u32(songaddr + 4);

            if (!U.isSafetyPointer(instPointer))
            {//無効なポインタ
                errors.Add(new FELint.ErrorSt(FELint.Type.SONGTRACK, U.toOffset(songaddr)
                                              , R._("SongID {0}の楽器ポインタ「{1}」は無効です。", U.To0xHexString(songid), U.To0xHexString(instPointer)), songid));
                return;
            }
            //他のゲームからインポートした楽器は、複雑すぎて誤爆するのでEOTの検出するの辞めようと思いました
            bool othergame_song = SongInstrumentForm.IsOtherGameInst(instPointer);

            if (othergame_song)
            {
                isMapBGM = false;
            }

            //トラックのポインタチェック
            List <SongUtil.Track> tracks = SongUtil.ParseTrack(songaddr, trackCount);

            for (uint tracknumber = 0; tracknumber < trackCount; tracknumber++)
            {
                uint trackAddr    = songaddr + 8 + (tracknumber * 4);
                uint trackPointer = Program.ROM.u32(trackAddr);
                if (!U.isSafetyPointer(trackPointer))
                {//無効なポインタ
                    errors.Add(new FELint.ErrorSt(FELint.Type.SONGTRACK, U.toOffset(songaddr)
                                                  , R._("SongID {0}のトラック{1}のポインタ「{2}」は無効です。\r\nトラック数が間違っていませんか?", U.To0xHexString(songid), tracknumber, U.To0xHexString(trackPointer)), songid));
                    continue;
                }
                if (tracknumber >= tracks.Count)
                {
                    continue;
                }
                SongUtil.Track track = tracks[(int)tracknumber];
                SongUtil.MakeCheckError(errors, track, U.toOffset(instPointer), songaddr, songid, tracknumber, isMapBGM);
            }
        }
Esempio n. 11
0
        public static void GotoEvent(FELint.Type dataType, uint addr, uint tag, uint mapid)
        {
            if (mapid == U.NOT_FOUND)
            {
                mapid = tag;
            }

            if (dataType == FELint.Type.FELINTBUZY_MESSAGE)
            {
                return;
            }
            else if (dataType == FELint.Type.SE_SYSTEM)
            {
                return;
            }

            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.EVENTUNITS)
            {
                if (Program.ROM.RomInfo.version() == 6)
                {
                    EventUnitFE6Form f = (EventUnitFE6Form)InputFormRef.JumpForm <EventUnitFE6Form>(U.NOT_FOUND);
                    f.JumpTo(addr);
                }
                else if (Program.ROM.RomInfo.version() == 7)
                {
                    EventUnitFE7Form f = (EventUnitFE7Form)InputFormRef.JumpForm <EventUnitFE7Form>(U.NOT_FOUND);
                    f.JumpTo(addr);
                }
                else
                {
                    EventUnitForm f = (EventUnitForm)InputFormRef.JumpForm <EventUnitForm>(U.NOT_FOUND);
                    f.JumpTo(addr);
                }
                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_PLIST_EVENT ||
                     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.SONGTABLE)
            {
                InputFormRef.JumpForm <SongTableForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.SONGTRACK)
            {
                InputFormRef.JumpForm <SongTrackForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.SONGINST)
            {
                SongInstrumentForm f = (SongInstrumentForm)InputFormRef.JumpForm <SongInstrumentForm>(U.NOT_FOUND);
                f.JumpToAddr(tag);
                return;
            }
            else if (dataType == FELint.Type.BOSS_BGM)
            {
                InputFormRef.JumpForm <SoundBossBGMForm>(tag);
                return;
            }
            else if (dataType == FELint.Type.WORLDMAP_BGM)
            {
                InputFormRef.JumpForm <WorldMapBGMForm>(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>(tag);
                    }
                    else if (skill == PatchUtil.skill_system_enum.FE8N ||
                             skill == PatchUtil.skill_system_enum.yugudora ||
                             skill == PatchUtil.skill_system_enum.FE8N_ver2
                             )
                    {
                        InputFormRef.JumpForm <SkillConfigFE8NSkillForm>(tag);
                    }
                }
                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.EVENT_FINAL_SERIF)
            {
                EventFinalSerifFE7Form f = (EventFinalSerifFE7Form)InputFormRef.JumpForm <EventFinalSerifFE7Form>(tag);
                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;
            }
            else if (dataType == FELint.Type.ROM_HEADER)
            {
                InputFormRef.JumpForm <ToolAutomaticRecoveryROMHeaderForm>();
                return;
            }

            //イベント
            {
                EventCondForm f = (EventCondForm)InputFormRef.JumpForm <EventCondForm>(U.NOT_FOUND);
                f.JumpToMAPIDAndAddr(mapid, FELint.TypeToEventCond(dataType), (uint)addr);
            }
        }