Exemplo n.º 1
0
        public static uint ExpandsArea(Form form, string typename, uint newdatacount, Undo.UndoData undodata)
        {
            uint pointer;

            if (typename == "UNITMENU")
            {
                pointer = MenuDefinitionForm.GetUnitMenuPointer();
            }
            else if (typename == "GAMEMENU")
            {
                pointer = MenuDefinitionForm.GetGameMenuPointer();
            }
            else if (typename == "DEBUG1")
            {
                pointer = MenuDefinitionForm.GetDebug1MenuPointer();
            }
            else if (typename == "ITEMMENU")
            {
                pointer = MenuDefinitionForm.GetItemMenuPointer();
            }
            else
            {
                return(U.NOT_FOUND);
            }

            uint newaddr;

            {
                InputFormRef.ExpandsEventArgs eearg = new InputFormRef.ExpandsEventArgs();

                InputFormRef ifr = Init(null);
                ifr.ReInitPointer(pointer);

                eearg.OldBaseAddress = ifr.BaseAddress;
                eearg.OldDataCount   = ifr.DataCount;
                eearg.BlockSize      = ifr.BlockSize;

                newaddr = ifr.ExpandsArea(form, newdatacount, undodata, pointer);
                if (newaddr == U.NOT_FOUND)
                {
                    return(U.NOT_FOUND);
                }

                eearg.NewBaseAddress = newaddr;
                eearg.NewDataCount   = newdatacount;
                AddressListExpandsEventInner(form, eearg, undodata);
            }
            InputFormRef.ClearCacheDataCount();
            return(newaddr);
        }
Exemplo n.º 2
0
        public void Rollback(int pos)
        {
            if (pos < 0)
            {
                Debug.Assert(false);
                return;
            }
            Log.Notify("Undo.Rollback:" + pos);

            RollbackROM(pos, Program.ROM);
            //書き込んだのでデータの長さキャッシュをクリアする.
            InputFormRef.ClearCacheDataCount();
            //EVENTとASMのキャッシュをクリア
            Program.AsmMapFileAsmCache.ClearCache();
            //すべてのフォームを再描画
            InputFormRef.InvalidateALLForms();
        }
Exemplo n.º 3
0
        public void Push(UndoData ud)
        {
            DumpLog(ud);

            if (this.Postion < this.UndoBuffer.Count)
            {//常に先頭に追加したいので、リスト中に戻っている場合は、それ以降を消す.
                this.UndoBuffer.RemoveRange(this.Postion, this.UndoBuffer.Count - this.Postion);
                //状況が変わるので、ロールバックバッファを破棄
                this.RollBackCancelBackup = null;
            }
            this.UndoBuffer.Add(ud);
            this.Postion = this.UndoBuffer.Count;
            //書き込んだのでデータの長さキャッシュをクリアする.
            InputFormRef.ClearCacheDataCount();
            //EVENTとASMのキャッシュをクリア
            Program.AsmMapFileAsmCache.ClearCache();
        }
Exemplo n.º 4
0
        public static void ReLoadSetting()
        {
            if (Program.ROM == null)
            {//ROMを読込んでいない場合は、システムの初期化だけ行う
                //システム側のテキストエンコード いかにしてUnicodeにするかどうか.
                ReBuildSystemTextEncoder();

                //多言語切り替え
                ReLoadTranslateResource();

                return;
            }


            if (AsmMapFileAsmCache != null)
            {
                //探索スレッドが動いているとまずいので停止させる.
                AsmMapFileAsmCache.Join();
            }

            //件数キャッシュの再構築
            InputFormRef.ClearCacheDataCount();

            //システム側のテキストエンコード いかにしてUnicodeにするかどうか.
            ReBuildSystemTextEncoder();

            //多言語切り替え
            ReLoadTranslateResource();

            //FEテキストエンコード用のハフマンツリーマップの構成
            ReBuildFETextEncoder();

            //イベントの読込
            ReLoadEventScript();

            //MODの読込.
            ReLoadMod();

            //ASMMapの再構築
            //以前のデータが残っているとまずいので完全に捨てて再作成します.
            AsmMapFileAsmCache = new FEBuilderGBA.AsmMapFileAsmCache();
            //asm mapキャッシュの更新.
            AsmMapFileAsmCache.ClearCache();
        }
Exemplo n.º 5
0
        //ROM読みこみに伴うシステムの初期化.
        static void InitSystem(string fullfilename)
        {
            Log.Notify("InitSystem:", Path.GetFileName(ROM.Filename), "ver:", ROM.RomInfo.VersionToFilename(), "length:", ROM.Data.Length.ToString("X"), "FEBuilderGBA:", U.getVersion());

            //Undoバッファの準備
            Undo = new Undo();


            //数を求める部分はあまりにたくさん呼び出すのでキャッシュすることにしました.
            InputFormRef.ClearCacheDataCount();
            //パッチのインストールの是非の判定 FE8には策パッチがあるのでキャッシュする.
            PatchForm.ClearCheckIF();

            if (fullfilename != "")
            {
                //変更監視
                UpdateWatcher.RegistMain(fullfilename);
            }


            //tbl適応判定
            OptionForm.AutoUpdateTBLOption();

            //システム側のテキストエンコード どうやってUnicodeにするかどうか.
            ReBuildSystemTextEncoder();

            //FEテキストエンコード用のハフマンツリーマップの構成
            ReBuildFETextEncoder();

            //イベントの読込
            ReLoadEventScript();

            //イベント条件の解釈リスト
            EventCondForm.PreLoadResource(U.ConfigDataFilename("eventcond_"));

            //AI1 と 2, 3
            EventUnitForm.PreLoadResourceAI1(U.ConfigDataFilename("ai1_"));
            EventUnitForm.PreLoadResourceAI2(U.ConfigDataFilename("ai2_"));
            EventUnitForm.PreLoadResourceAI3(U.ConfigDataFilename("ai3_"));

            //SondEffectリスト
            SongTableForm.PreLoadResource(U.ConfigDataFilename("sound_"));
            //UnitActionリスト
            UnitActionPointerForm.PreLoadResource(U.ConfigDataFilename("unitaction_"));

            //ROM内アニメ
            ImageRomAnimeForm.PreLoadResource();
            ImageTSAAnimeForm.PreLoadResource();
            if (Program.ROM.RomInfo.version() == 8)
            {
                ImageTSAAnime2Form.PreLoadResource();
            }

            //MODの読込.
            ReLoadMod();

            //新規に追加ユニットリストキャッシュの削除
            EventUnitForm.ClearNewData();

            //システムアイコンキャッシュのクリア
            ImageSystemIconForm.ClearCache();

            //EVENTとASMのキャッシュをクリア
            AsmMapFileAsmCache = new FEBuilderGBA.AsmMapFileAsmCache();
            //asm mapキャッシュの更新.
            AsmMapFileAsmCache.ClearCache();

            //RAM
            ReBuildRAM();

            if (fullfilename != "" &&
                fullfilename != Program.Config.at("Last_Rom_Filename"))
            {//最後に開いたファイル名を保存する.
                Program.Config["Last_Rom_Filename"] = fullfilename;
                Program.Config.Save();
            }
            //Log.Notify("InitSystem:Complate");
        }