//全データの取得
        public static void MakeAllDataLength(List <Address> list)
        {
            int          datcount     = (int)ClassForm.DataCount();
            InputFormRef InputFormRef = N_Init(null, datcount);

            FEBuilderGBA.Address.AddAddress(list, InputFormRef, "CCClassAlphaName", new uint[] { });
        }
        static InputFormRef Init(Form self, uint assignClass)
        {
            uint classDataCount = ClassForm.DataCount();

            InputFormRef ifr = new InputFormRef(self
                                                , ""
                                                , assignClass
                                                , 1
                                                , (int i, uint addr) =>
            {     //読込最大値検索
                if (i >= classDataCount)
                { //既存のクラスの最大値を超えたらダメ
                    return(false);
                }
                if (i >= 0xFE)
                {
                    if (Program.ROM.u8(addr) == 0xFF)
                    {    //終端コードが出てきたらそこで強制終了
                        return(false);
                    }
                }

                return(true);
            }
                                                , (int i, uint addr) =>
            {
                return(U.ToHexString(i) + " " + ClassForm.GetClassName((uint)i));
            }
                                                );

            return(ifr);
        }
Beispiel #3
0
        private void SwitchListExpandsButton_Click(object sender, EventArgs e)
        {
            if (this.L_0_COMBO.Items.Count <= 0)
            {
                return;
            }
            uint defAddr = U.atoh(this.L_0_COMBO.Items[0].ToString());

            uint newCount = ClassForm.DataCount();

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "SoundFootStep SwitchExpands");

            PatchUtil.Switch2Expands(Program.ROM.RomInfo.sound_foot_steps_pointer
                                     , Program.ROM.RomInfo.sound_foot_steps_switch2_address
                                     , newCount
                                     , defAddr
                                     , undodata);

            if (Program.ROM.RomInfo.version == 8)
            {
                if (Program.ROM.RomInfo.is_multibyte)
                {//Fix PlaySoundStepByClass(足音) HardCode
                    Program.ROM.write_range(0x7B198, new byte[] { 0x1c, 0xe0 }, undodata);
                }
                else
                {//Fix PlaySoundStepByClass(足音) HardCode
                    Program.ROM.write_range(0x78d84, new byte[] { 0x1c, 0xe0 }, undodata);
                }
            }

            Program.Undo.Push(undodata);

            ReInit(this.InputFormRef);
        }
        public OPClassAlphaNameForm()
        {
            InitializeComponent();
            this.N_AddressList.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed);
            int class_data_count = (int)ClassForm.DataCount();

            this.N_InputFormRef = N_Init(this, class_data_count);
            this.N_InputFormRef.MakeGeneralAddressListContextMenu(true);
        }
Beispiel #5
0
        public static int GetCCCount(uint shien_classs_id)
        {
            if (Program.ROM.RomInfo.version <= 7)
            {     //FE7までは分岐がないので、CCクラスを参照する.
                if (ClassForm.isHighClass(shien_classs_id))
                { //上位クラスなので、もう CCではない
                    return(0);
                }
                //下位クラスなのでCCできる.
                return(1);
            }


            int ccount1 = 0;
            int ccount2 = 0;

            int                 datcount     = (int)ClassForm.DataCount();
            InputFormRef        InputFormRef = Init(null, datcount);
            List <U.AddrResult> list         = InputFormRef.MakeList();

            if (shien_classs_id > 0 && shien_classs_id < list.Count)
            {
                uint up_cc_class1 = Program.ROM.u8(list[(int)shien_classs_id].addr + 0);
                uint up_cc_class2 = Program.ROM.u8(list[(int)shien_classs_id].addr + 1);
                if (up_cc_class1 > 0 && up_cc_class1 < list.Count)
                {
                    ccount1++;
                    uint up2_cc_class1 = Program.ROM.u8(list[(int)up_cc_class1].addr + 0);
                    uint up2_cc_class2 = Program.ROM.u8(list[(int)up_cc_class1].addr + 1);
                    if (
                        (up2_cc_class1 > 0 && up2_cc_class1 < list.Count) ||
                        (up2_cc_class1 > 0 && up2_cc_class1 < list.Count)
                        )
                    {
                        ccount1++;
                    }
                }
                if (up_cc_class2 > 0 && up_cc_class2 < list.Count)
                {
                    ccount2++;
                    uint up2_cc_class1 = Program.ROM.u8(list[(int)up_cc_class2].addr + 0);
                    uint up2_cc_class2 = Program.ROM.u8(list[(int)up_cc_class2].addr + 1);
                    if (
                        (up2_cc_class1 > 0 && up2_cc_class1 < list.Count) ||
                        (up2_cc_class1 > 0 && up2_cc_class1 < list.Count)
                        )
                    {
                        ccount2++;
                    }
                }
            }
            return(Math.Max(ccount1, ccount2));
        }
Beispiel #6
0
        public CCBranchForm()
        {
            InitializeComponent();
            this.AddressList.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed);
            this.CLASS_LISTBOX.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed);
            this.CLASS_LISTBOX.ItemListToJumpForm("CLASS");

            int datcount = (int)ClassForm.DataCount();

            this.InputFormRef = Init(this, datcount);

            this.InputFormRef.MakeGeneralAddressListContextMenu(true);
        }
Beispiel #7
0
        static InputFormRef Init(Form self)
        {
            uint classCount = ClassForm.DataCount();

            if (classCount <= 0)
            {
                classCount = 0x7f;
            }
            else if (classCount > 0xFF)
            {
                classCount = 0xFF;
            }
            classCount--;

            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.unit_move_icon_pointer()
                                    , 8
                                    , (int i, uint addr) =>
            {    //読込最大値検索
                if (i >= classCount)
                {
                    return false;
                }
                if (i == 0)
                {    //先頭データは確認しないことにする.
                    return true;
                }
                //0 と 4 がポインタであればデータがあると考える.
                return U.isPointerOrNULL(Program.ROM.u32(addr + 0));
            }
                                    , (int i, uint addr) =>
            {
                uint icon_id = (uint)(i);
                String name = ClassForm.GetClassNameWhereNo(icon_id);

                return U.ToHexString(icon_id + 1) + U.SA(name) + InputFormRef.GetCommentSA(addr);
            }
                                    ));
        }