Esempio n. 1
0
        public void Wipe(List <Address> list)
        {
            if (Program.ROM.RomInfo.version != 8)
            {
                return;
            }

            //Chapter Name to Text パッチをインストールする
            bool r = HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ChapterNameText);

            if (!r)
            {
                return;
            }

            //最後の一つを残して全消去
            List <U.AddrResult> alist = ImageChapterTitleForm.MakeList();

            if (alist.Count <= 1)
            {
                return;
            }
            uint addr;

            addr = alist[alist.Count - 1].addr;
            if (!U.isSafetyOffset(addr))
            {
                return;
            }
            uint lastChapterNameImageAddr = Program.ROM.u32(addr + 0);

            for (int i = 0; i < alist.Count; i++)
            {
                addr = alist[i].addr;
                uint a = Program.ROM.u32(addr + 0);

                if (a != lastChapterNameImageAddr)
                {
                    FEBuilderGBA.Address.AddLZ77Pointer(list
                                                        , addr + 0
                                                        , "Chapter_Save"
                                                        , false
                                                        , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG);
                    Program.ROM.write_u32(addr + 0, lastChapterNameImageAddr, this.UndoData);
                }
                FEBuilderGBA.Address.AddLZ77Pointer(list
                                                    , addr + 4
                                                    , "Chapter_Number"
                                                    , false
                                                    , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG);
                FEBuilderGBA.Address.AddLZ77Pointer(list
                                                    , addr + 8
                                                    , "Chapter_Title"
                                                    , false
                                                    , FEBuilderGBA.Address.DataTypeEnum.LZ77IMG);

                Program.ROM.write_u32(addr + 4, 0, this.UndoData);
                Program.ROM.write_u32(addr + 8, 0, this.UndoData);
            }
        }
Esempio n. 2
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Tracks = SongUtil.ParseTrack((uint)Address.Value, (uint)B0.Value);

            for (int i = 0; i < this.TrackListBoxs.Length; i++)
            {
                if (Tracks.Count > i)
                {
                    SongUtil.TrackToListBox(this.TrackListBoxs[i], Tracks[i]);
                    InputFormRef.markupJumpLabel(this.TrackLabels[i]);
                }
                else
                {
                    this.TrackListBoxs[i].Items.Clear();
                    InputFormRef.unmarkupJumpLabel(this.TrackLabels[i]);
                }
            }

            if (this.Tracks.Count >= 12)
            {//このトラックは再生できますか?
                if (Program.ROM.RomInfo.version() >= 7 && Program.ROM.RomInfo.version() <= 8)
                {
                    HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Track12_Over_By_SongTrack);
                }
            }
        }
Esempio n. 3
0
        private void SkillAssignmentClassButton_Click(object sender, EventArgs e)
        {
            if (PatchUtil.skill_system_enum.NO == PatchUtil.SearchSkillSystem())
            {
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Anti_Huffman_By_Translate);
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Skill);
            }

            PatchUtil.skill_system_enum skill = PatchUtil.SearchSkillSystem();
            if (skill == PatchUtil.skill_system_enum.SkillSystem)
            {
                InputFormRef.JumpForm <SkillAssignmentClassSkillSystemForm>();
            }
            else if (skill == PatchUtil.skill_system_enum.FE8N_ver2)
            {
                InputFormRef.JumpForm <SkillConfigFE8NVer2SkillForm>();
            }
            else if (skill == PatchUtil.skill_system_enum.FE8N ||
                     skill == PatchUtil.skill_system_enum.yugudora)
            {
                //NOP
                R.ShowStopError(R._("この機能は、FE8NVer2からのみ利用できます。"));
            }
            else
            {
                R.ShowStopError(R._("スキル拡張がありません。\r\nスキル拡張パッチをインストールしてから利用してください。"));
            }
        }
Esempio n. 4
0
        private void SkillConfigButton_Click(object sender, EventArgs e)
        {
            if (PatchUtil.skill_system_enum.NO == PatchUtil.SearchSkillSystem())
            {
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Skill);
            }

            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>();
            }
            else if (skill == PatchUtil.skill_system_enum.FE8N_ver3)
            {
            }
            else
            {
                R.ShowStopError(R._("スキル拡張がありません。\r\nスキル拡張パッチをインストールしてから利用してください。"));
            }
        }
Esempio n. 5
0
        private void SongTrackImportMidiForm_Load(object sender, EventArgs e)
        {
            if (!HasNIMAP())
            {
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.NIMAP_By_SongTrack);
                PickupInstrument();
            }
            if (OptionForm.GetMidfix4agb() == "")
            {
                UseMidfix4agb_checkBox.Hide();
                WARNING_midfix4agb_label.Show();
            }
            else
            {
                WARNING_midfix4agb_label.Hide();
                UseMidfix4agb_checkBox.Show();
            }

            if (MainFormUtil.CanUseMID2AGB())
            {     //mid2agbを利用できる.
                if (OptionForm.midi_importer() == OptionForm.midi_importer_enum.MID2AGB)
                { //mid2agbがディフォルト
                    this.tabControl1.SelectedIndex = 1;
                }
            }
            else
            {//mid2agbを利用できない.
                Explain_mid2agb.Text           = R._("mid2agbが設定されていません。\r\n設定画面より、mid2agbの設定をしてください。");
                Mid2AGBOKButton.Enabled        = false;
                this.tabControl1.SelectedIndex = 0;
            }
            Mid2agbV.Value = 80;
            //Mid2agbR.SelectedIndex = 0;
        }
Esempio n. 6
0
        private void ImageMagicButton_Click(object sender, EventArgs e)
        {
            HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.MagicPatch_By_Menu);

            ImageUtilMagic.magic_system_enum magic = ImageUtilMagic.SearchMagicSystem();
            if (magic == ImageUtilMagic.magic_system_enum.FEDITOR_ADV)
            {
                InputFormRef.JumpForm <ImageMagicFEditorForm>();
            }
            else if (magic == ImageUtilMagic.magic_system_enum.CSA_CREATOR)
            {
                InputFormRef.JumpForm <ImageMagicCSACreatorForm>();
            }
        }
        public static void OnPreClassExtendsWarningHandler(object sender, EventArgs e)
        {
            InputFormRef.ExpandsEventArgs eventarg = (InputFormRef.ExpandsEventArgs)e;
            bool r = HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ExtendedMovingMapAnimationList);

            if (!r)
            {
                DialogResult dr = R.ShowNoYes("拡張した領域にある移動アニメーションを利用するには、移動アニメーション拡張のパッチが別途必要です。\r\n移動アニメーションを拡張してもよろしいですか?\r\n");
                if (dr != DialogResult.Yes)
                {//キャンセル.
                    eventarg.IsCancel = true;
                    return;
                }
            }
        }
        //リストが拡張されたとき
        void AddressListExpandsUpdateBaristaAnimationAddress(object sender, EventArgs arg)
        {
            InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg;
            uint addr  = eearg.NewBaseAddress;
            int  count = (int)eearg.NewDataCount;

            Program.ROM.write_p32(
                Program.ROM.RomInfo.unit_wait_barista_anime_address
                , addr
                + 0x2 + (0x8 * Program.ROM.RomInfo.unit_wait_barista_id)
                );
            if (count > 128)
            {
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ExtendedMovingMapAnimationList);
            }
        }
Esempio n. 9
0
        public void MeleeAndMagicFix()
        {
            if (this.InputFormRef != null && this.InputFormRef.IsUpdateLock)
            {
                return;
            }
            if (PatchUtil.SearchMeleeAndMagicFixPatch())
            {
                return;
            }
            bool useMelee = (B20.Value > 0 || B21.Value > 0 || B22.Value > 0 || B23.Value > 0);
            bool useMagic = (B24.Value > 0 || B25.Value > 0 || B26.Value > 0 || B27.Value > 0);

            if (useMelee && useMagic)
            {
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.MeleeAndMagicFix_By_Unit);
            }
        }
Esempio n. 10
0
        private void ItemIconListExpandsButton_Click(object sender, EventArgs e)
        {
            DialogResult dr = R.ShowNoYes("拡張した領域にあるアイテムアイコンを利用するには、アイテムアイコン拡張のパッチが別途必要です。\r\nアイテムアイコンを拡張してもよろしいですか?\r\n");

            if (dr != System.Windows.Forms.DialogResult.Yes)
            {
                return;
            }
            HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.ItemIconExpands);

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "expands");
            uint          newaddr  = ExpandsArea(this, 0xFF, undodata);

            if (newaddr == U.NOT_FOUND)
            {
                Program.Undo.Rollback(undodata);
                R.ShowStopError("アイテムアイコンテーブルの拡張に失敗しました。");
                return;
            }
            Program.Undo.Push(undodata);

            InputFormRef.ReOpenForm <ImageItemIconForm>();
        }
Esempio n. 11
0
        private void ImportButton_Click(object sender, EventArgs e)
        {
            if (InputFormRef.IsPleaseWaitDialog(this))
            {//2重割り込み禁止
                return;
            }
            if (!this.InputFormRef.CheckWriteProtectionID00())
            {
                return;
            }
            if (AddressList.SelectedIndex < 0)
            {
                return;
            }

            string filename;

            if (ImageFormRef.GetDragFilePath(out filename))
            {
            }
            else
            {
                string title  = R._("インポートする音楽ファイルを選択してください");
                string filter = R._("sound|*.s;*.wav;*.mid;*.midi;*.instrument|s|*.s|midi|*.mid;*.midi|wav|*.wav|MusicalInstrument|*.instrument|All files|*");

                OpenFileDialog open = new OpenFileDialog();
                open.Title  = title;
                open.Filter = filter;
                Program.LastSelectedFilename.Load(this, "", open);
                DialogResult dr = open.ShowDialog();
                if (dr != DialogResult.OK)
                {
                    return;
                }
                if (!U.CanReadFileRetry(open))
                {
                    return;
                }
                Program.LastSelectedFilename.Save(this, "", open);
                filename = open.FileNames[0];
            }

            uint song_id           = (uint)AddressList.SelectedIndex;
            uint songtable_address = InputFormRef.BaseAddress + (InputFormRef.BlockSize * song_id);

            string error = "";

            string ext = U.GetFilenameExt(filename);

            if (ext == ".WAV" || ext == ".WAVE")
            {
                SongTrackImportWaveForm f = (SongTrackImportWaveForm)InputFormRef.JumpFormLow <SongTrackImportWaveForm>();
                f.Init(filename);
                DialogResult dr = f.ShowDialog();
                if (dr != System.Windows.Forms.DialogResult.OK)
                {
                    f.Dettach();
                    return;
                }
                error = SongUtil.ImportWave(f.GetFilename(), songtable_address, f.UseLoop(), f.GetFromFilename());
                f.Dettach();
            }
            else if (ext == ".MID" || ext == ".MIDI")
            {
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.NIMAP_By_SongTrack);
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.DrumFix_By_SongTrack);

                //楽器セットとオプションを選択してもらう.
                SongTrackImportMidiForm f = (SongTrackImportMidiForm)InputFormRef.JumpFormLow <SongTrackImportMidiForm>();
                f.Init((uint)P4.Value);
                DialogResult dr = f.ShowDialog();
                if (dr != System.Windows.Forms.DialogResult.OK)
                {
                    return;
                }

                //少し時間がかかるので、しばらくお待ちください表示.
                using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this))
                {
                    if (f.UseMidfix4agb())
                    {
                        filename = SongUtil.ConvertMidfix4agb(filename);
                        if (filename == "")
                        {
                            return;
                        }
                    }

                    if (f.GetUseMID2AGB() == SongTrackImportMidiForm.ImportMethod.FEBuilderGBA)
                    {//FEBuilderGBAでimport
                        error = SongUtil.ImportMidiFile(filename, songtable_address
                                                        , f.GetInstrumentAddr()
                                                        , f.GetIgnoreMOD()
                                                        , f.GetIgnoreBEND()
                                                        , f.GetIgnoreLFOS()
                                                        , f.GetIgnoreHEAD()
                                                        , f.GetIgnoreBACK()
                                                        );
                    }
                    else
                    {//mid2agbでimport
                        error = SongUtil.ImportMidiFileMID2AGB(filename, songtable_address
                                                               , f.GetInstrumentAddr()
                                                               , f.GetMID2AGB_V()
                                                               , f.GetMIDI2AGB_MODSC()
                                                               , f.GetIgnoreMOD()
                                                               , f.GetIgnoreBEND()
                                                               , f.GetIgnoreLFOS()
                                                               );
                    }
                }
            }
            else if (ext == ".INSTRUMENT")
            {
                //少し時間がかかるので、しばらくお待ちください表示.
                using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this))
                {
                    error = SongUtil.ImportInstrument(filename, songtable_address);
                }
            }
            else
            {
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.NIMAP_By_SongTrack);
                HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.DrumFix_By_SongTrack);

                //楽器セットを選択してもらう.
                SongTrackImportSelectInstrumentForm f = (SongTrackImportSelectInstrumentForm)InputFormRef.JumpFormLow <SongTrackImportSelectInstrumentForm>();
                f.Init((uint)P4.Value);
                DialogResult dr = f.ShowDialog();
                if (dr != System.Windows.Forms.DialogResult.OK)
                {
                    return;
                }

                //少し時間がかかるので、しばらくお待ちください表示.
                using (InputFormRef.AutoPleaseWait pleaseWait = new InputFormRef.AutoPleaseWait(this))
                {
                    error = SongUtil.ImportS(filename, songtable_address, f.GetInstrumentAddr());
                }
            }


            if (error != "")
            {
                R.ShowStopError(error);
                return;
            }
            R.Notify("{0}, SongID: {1} ,Ext: {2} ,Filename: {3}", this.Text, song_id, ext, filename);

            int selectedIndex = AddressList.SelectedIndex;

            ReloadListButton.PerformClick();
            AddressList.SelectedIndex = selectedIndex;

            SongTableForm.ReloadList();
            InputFormRef.ShowWriteNotifyAnimation(this, 0);
        }
Esempio n. 12
0
 void ApplyStatusToLocalizationPatch()
 {
     HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.StatusToLocalization);
 }
Esempio n. 13
0
 void ApplyAntiHuffmanPatch()
 {
     HowDoYouLikePatchForm.CheckAndShowPopupDialog(HowDoYouLikePatchForm.TYPE.Anti_Huffman_By_Translate);
 }