Ejemplo n.º 1
0
        static InputFormRef Init(Form self)
        {
            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.item_pointer
                                    , Program.ROM.RomInfo.item_datasize
                                    , (int i, uint addr) =>
            {    //12補正 16特効 がポインタ or nullであれば
                if (i > 0xff)
                {
                    return false;
                }
                if (Program.ROM.RomInfo.version == 8 && Program.ROM.RomInfo.is_multibyte == false)
                {
                    return U.isPointerOrNULL(Program.ROM.u32(addr + 12))
//                            && U.isPointerOrNULL(Program.ROM.u32(addr + 16)) //スキルシステムでなんかするみたいなのでやめる
                    ;
                }
                else
                {
                    return U.isPointerOrNULL(Program.ROM.u32(addr + 12)) &&
                    U.isPointerOrNULL(Program.ROM.u32(addr + 16))
                    ;
                }
            }
                                    , (int i, uint addr) =>
            {
                uint id = Program.ROM.u16(addr);
                return U.ToHexString(i) + " " + TextForm.Direct(id);
            }
                                    ));
        }
Ejemplo n.º 2
0
        static InputFormRef Init(Form self)
        {
            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.item_pointer
                                    , Program.ROM.RomInfo.item_datasize
                                    , (int i, uint addr) =>
            {    //12補正 16特効 がポインタ or nullであれば
                return U.isPointerOrNULL(Program.ROM.u32(addr + 12)) &&
                U.isPointerOrNULL(Program.ROM.u32(addr + 16))
                ;
            }
                                    , (int i, uint addr) =>
            {
                uint ITEMSTATBOOSTER = Program.ROM.u32(addr + 12);
                if (!U.isPointer(ITEMSTATBOOSTER))
                {
                    return new U.AddrResult();
                }

                U.AddrResult ar = new U.AddrResult();
                ar.addr = U.toOffset(ITEMSTATBOOSTER);

                uint id = Program.ROM.u16(addr);
                ar.name = U.ToHexString(i) + " " + TextForm.Direct(id);

                return ar;
            }
                                    ));
        }
Ejemplo n.º 3
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.class_pointer()
                             , Program.ROM.RomInfo.class_datasize()
                             , (int i, uint addr) =>
     {    //読込最大値検索
         if (i == 0)
         {
             return true;
         }
         if (i > 0xff)
         {
             return false;
         }
         uint no = Program.ROM.u8(addr + 4);
         return (no != 0);
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u16(addr);
         return U.ToHexString(i) + " " + TextForm.Direct(id);
     }
                             ));
 }
Ejemplo n.º 4
0
        public static string GetNameWhereCustomBattleAnime(uint custom_battle_id)
        {
            if (custom_battle_id == 0)
            {
                return("");
            }

            InputFormRef InputFormRef = Init(null);

            uint addr = InputFormRef.BaseAddress;

            for (int i = 0; i < InputFormRef.DataCount; i++)
            {
                if (custom_battle_id == Program.ROM.u8(addr + 37))
                {//下級職
                    uint id = Program.ROM.u16(addr);
                    return(TextForm.Direct(id) + " " + R._("下級職"));
                }
                if (custom_battle_id == Program.ROM.u8(addr + 38))
                {//上級職
                    uint id = Program.ROM.u16(addr);
                    return(TextForm.Direct(id) + " " + R._("上級職"));
                }

                addr += InputFormRef.BlockSize;
            }
            return("");
        }
Ejemplo n.º 5
0
        //スキル名を検索します.
        //残念ながら、スキルIDでの実装がされていないので文字列でヒントとかから検索します.
        public static uint FindSkillIconAndText(uint[] pointers, string searchSkillName, out string outText)
        {
            if (pointers == null || pointers.Length < 4)
            {
                outText = "";
                return(U.NOT_FOUND);
            }

            InputFormRef InputFormRef = Init(null);

            List <U.AddrResult> list = InputFormRef.MakeList();

            for (int n = 0; n < list.Count; n++)
            {
                uint addr = list[n].addr;
                if (list[n].name.IndexOf(searchSkillName) >= 0)
                {
                    outText = TextForm.Direct(Program.ROM.u16(addr + 0));
                    return((uint)(n + 0x100));
                }
            }

            outText = "";
            return(U.NOT_FOUND);
        }
Ejemplo n.º 6
0
        public static string GetParamName(uint nameAddrP)
        {
            nameAddrP = U.toOffset(nameAddrP);
            if (!U.isSafetyOffset(nameAddrP))
            {
                return("");
            }
            uint id = Program.ROM.p32(nameAddrP);

            if (id <= 0x10)
            {
                return("");
            }

            string name = "";

            if (id > 0xFFFF && U.isSafetyOffset(id))
            {
                name = Program.ROM.getString(id);
            }
            if (name == "")
            {
                name = TextForm.Direct(id);
            }

            return(name);
        }
Ejemplo n.º 7
0
        public static string GetMenuName(uint addr)
        {
            if (!U.isSafetyOffset(addr))
            {
                return("");
            }

            String name = "";

            if (Program.ROM.RomInfo.is_multibyte())
            {
                uint nameAddr = Program.ROM.p32(addr);
                if (nameAddr > 0xFFFF && U.isSafetyOffset(nameAddr))
                {
                    name = Program.ROM.getString(nameAddr);
                }
                if (name == "")
                {//日本語ポインタがない場合、文字列IDを参照する.
                    name = TextForm.Direct(Program.ROM.u16(addr + 4));
                }
            }
            else
            {
                name = TextForm.Direct(Program.ROM.u16(addr + 4));
            }
            return(name);
        }
Ejemplo n.º 8
0
        public static List <U.AddrResult> GetShopAddr(uint addr)
        {
            List <U.AddrResult> ret = new List <U.AddrResult>();
            uint textid             = Program.ROM.u16(addr + 28);

            uint shopaddr;

            shopaddr = Program.ROM.p32(addr + 12);
            if (U.isSafetyOffset(shopaddr))
            {
                string name = TextForm.Direct(textid) + " " + R._("武器屋");
                ret.Add(new U.AddrResult(shopaddr, name, addr + 12));
            }

            shopaddr = Program.ROM.p32(addr + 16);
            if (U.isSafetyOffset(shopaddr))
            {
                string name = TextForm.Direct(textid) + " " + R._("道具屋");
                ret.Add(new U.AddrResult(shopaddr, name, addr + 16));
            }

            shopaddr = Program.ROM.p32(addr + 20);
            if (U.isSafetyOffset(shopaddr))
            {
                string name = TextForm.Direct(textid) + " " + R._("秘密の店");
                ret.Add(new U.AddrResult(shopaddr, name, addr + 20));
            }

            return(ret);
        }
Ejemplo n.º 9
0
        public static string GetSkillText(uint index, uint textBaseAddress)
        {
            uint size       = 2;
            uint textOffset = textBaseAddress + (size * index);
            uint id         = Program.ROM.u16(textOffset);

            return(TextForm.Direct(id));
        }
Ejemplo n.º 10
0
        public static int MakeClassSkillButtons(uint cid, Button[] buttons, ToolTipEx tooltip)
        {
            uint[] pointer = FindSkillFE8NVer2IconPointers();
            if (pointer == null)
            {
                return(0);
            }
            if (pointer.Length < 5)
            {
                return(0);
            }

            InputFormRef InputFormRef    = Init(null);
            InputFormRef N2_InputFormRef = N2_Init(null);

            int skillCount           = 0;
            List <U.AddrResult> list = InputFormRef.MakeList();

            for (int i = 1; i < list.Count; i++)
            {
                uint classAddr = Program.ROM.p32(list[i].addr + 8);
                if (!U.isSafetyOffset(classAddr))
                {
                    continue;
                }

                bool found = false;
                N2_InputFormRef.ReInit(classAddr);
                List <U.AddrResult> classList = N2_InputFormRef.MakeList();
                for (int n = 0; n < classList.Count; n++)
                {
                    uint classID = Program.ROM.u8(classList[n].addr);
                    if (cid == classID)
                    {
                        found = true;
                        break;
                    }
                }

                if (!found)
                {
                    continue;
                }

                uint textid = Program.ROM.u16(list[i].addr + 0);

                buttons[skillCount].BackgroundImage = DrawSkillIconLow((uint)i);
                buttons[skillCount].Tag             = (uint)i;
                tooltip.SetToolTip(buttons[skillCount], TextForm.Direct(textid));
                skillCount++;
                if (skillCount >= buttons.Length)
                {
                    break;
                }
            }

            return(skillCount);
        }
Ejemplo n.º 11
0
        public static String GetClassNameLow(uint addr)
        {
            if (!U.isSafetyOffset(addr))
            {
                return("");
            }
            uint id = Program.ROM.u16(addr);

            return(TextForm.Direct(id).Trim());
        }
Ejemplo n.º 12
0
        public static String GetItemNameAddr(uint addr)
        {
            if (!U.isSafetyOffset(addr))
            {
                return("");
            }
            uint textid = Program.ROM.u16(addr);

            return(TextForm.Direct(textid));
        }
Ejemplo n.º 13
0
        public static string GetTIDName(uint tid)
        {
            if (tid <= 0x10)
            {
                return("");
            }
            string name = TextForm.Direct(tid);

            return(name);
        }
Ejemplo n.º 14
0
        public static String GetItemName(uint item_id)
        {
            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(item_id);

            if (!U.isSafetyOffset(addr))
            {
                return("");
            }
            uint textid = Program.ROM.u16(addr);

            return(TextForm.Direct(textid));
        }
Ejemplo n.º 15
0
        public static string GetSongNameLow(uint addr)
        {
            uint textid;

            if (Program.ROM.RomInfo.version() == 6)
            {
                textid = Program.ROM.u32(addr + 4);
                return(TextForm.Direct(textid));
            }

            textid = Program.ROM.u32(addr + 12);
            return(TextForm.Direct(textid));
        }
Ejemplo n.º 16
0
        public static string GetWorldMapPointName(uint baseid)
        {
            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(baseid);

            if (!U.isSafetyOffset(addr))
            {
                return("");
            }
            uint textid = Program.ROM.u16(addr + 28);

            return(TextForm.Direct(textid));
        }
Ejemplo n.º 17
0
        public void Init(NumericUpDown num)
        {
            uint pointer = (uint)num.Value;

            this.Pointer = pointer;
            if (!U.isSafetyPointer(pointer))
            {
                return;
            }
            string str = TextForm.Direct(pointer);

            this.String.Text = str;

            this.Numeric = num;
        }
Ejemplo n.º 18
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.unit_pointer()
                             , Program.ROM.RomInfo.unit_datasize()
                             , (int i, uint addr) =>
     {    //個数が固定できまっている
         return i < Program.ROM.RomInfo.unit_maxcount();
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u16(addr);
         return U.ToHexString(i + 1) + " " + TextForm.Direct(id);
     }
                             ));
 }
Ejemplo n.º 19
0
        //顔画像からのクラス名の取得
        public static String GetClassNameWhereFaceID(uint face_id)
        {
            InputFormRef InputFormRef = Init(null);

            uint addr = InputFormRef.BaseAddress;

            for (int i = 0; i < InputFormRef.DataCount; i++)
            {
                if (face_id == Program.ROM.u16(addr + 8))
                {
                    uint id = Program.ROM.u16(addr);
                    return(TextForm.Direct(id));
                }
                addr += InputFormRef.BlockSize;
            }
            return("");
        }
Ejemplo n.º 20
0
 static InputFormRef N2_Init(Form self)
 {//拠点ごとの確率
     return(new InputFormRef(self
                             , "N2_"
                             , Program.ROM.RomInfo.dic_title_pointer
                             , 2
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return i < 12;
     }
                             , (int i, uint addr) =>
     {
         uint text1 = Program.ROM.u16(addr + 0);
         return U.ToHexString(i) + " " + TextForm.Direct(text1);
     }
                             ));
 }
Ejemplo n.º 21
0
 static InputFormRef N1_Init(Form self)
 {//章タイトル
     return(new InputFormRef(self
                             , "N1_"
                             , Program.ROM.RomInfo.dic_chaptor_pointer
                             , 4
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return i < 9;
     }
                             , (int i, uint addr) =>
     {
         uint text1 = Program.ROM.u16(addr + 0);
         return U.ToHexString(i) + " " + TextForm.Direct(text1);
     }
                             ));
 }
Ejemplo n.º 22
0
 static InputFormRef N1_Init(Form self)
 {
     return(new InputFormRef(self
                             , "N1_"
                             , Program.ROM.RomInfo.ed_2_pointer()
                             , 8
                             , (int i, uint addr) =>
     {
         return Program.ROM.u8(addr) != 0x00;
     }
                             , (int i, uint addr) =>
     {
         uint uid = Program.ROM.u8(addr + 0);
         uint tourina = Program.ROM.u32(addr + 4);
         return U.ToHexString(uid) + " " + UnitForm.GetUnitName(uid) + " " + TextForm.Direct(tourina);
     }
                             ));
 }
Ejemplo n.º 23
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.map_terrain_name_pointer()
                             , 2
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return Program.ROM.u16(addr + 0) != 0x00;
     }
                             , (int i, uint addr) =>
     {    //リストボックスに乗せる項目
         uint text_id = Program.ROM.u16(addr);
         string hint = MapTerrainNameForm.MakeHint_Full((uint)i);
         return U.ToHexString(i) + " " + text_id.ToString("X04") + " " + TextForm.Direct(text_id) + hint;
     }
                             ));
 }
        public static string GetSkillText(uint id)
        {
            uint[] pointer = FindSkillFE8NVer3IconPointers();
            if (pointer == null)
            {
                return("");
            }
            InputFormRef InputFormRef = Init(null);
            uint         addr         = InputFormRef.IDToAddr(id);

            if (!U.isSafetyOffset(addr))
            {
                return("");
            }
            uint   textid = Program.ROM.u16(addr + 0);
            string text   = TextForm.Direct(textid);

            return(SkillConfigFE8NSkillForm.ParseTextToSkillName(text));
        }
Ejemplo n.º 25
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.item_pointer()
                             , Program.ROM.RomInfo.item_datasize()
                             , (int i, uint addr) =>
     {    //12補正 16特効 がポインタ or nullであれば
         return U.isPointerOrNULL(Program.ROM.u32(addr + 12)) &&
         U.isPointerOrNULL(Program.ROM.u32(addr + 16))
         ;
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u16(addr);
         return U.ToHexString(i) + " " + TextForm.Direct(id);
     }
                             ));
 }
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , new List <String> {
         "N00_", "N01_", "N02_", "N03_"
     }
                             , 0
                             , 32
                             , (int i, uint addr) =>
     {    //読込最大値検索
         uint pp = Program.ROM.u16(addr);
         if (pp == 0xFFFF)
         {
             return false;
         }
         if (pp == 0x0)
         {
             return false;
         }
         return true;
     }
                             , (int i, uint addr) =>
     {
         String name = Program.ROM.getString(addr + 4, 12);
         uint c = Program.ROM.u8(addr + 4);
         if (name.Length <= 0 || c == 0xFF || c == 0x00)
         {
             String text = TextForm.Direct(Program.ROM.u16(addr + 2));
             string parse_name = ParseTextToSkillName(text);
             if (parse_name == "" && name.Length > 0)
             {
                 parse_name = name.Trim(new char[] {
                     '\x0', '\xFF', ' ', ' ', ''///No Translate
                 });
             }
             name = parse_name;
         }
         return U.ToHexString(i) + " " + name;
     }
                             ));
 }
Ejemplo n.º 27
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.worldmap_point_pointer()
                             , 32
                             , (int i, uint addr) =>
     {    //12 16 20 の店が、ポインタ or nullであれば
         return U.isPointerOrNULL(Program.ROM.u32(addr + 12)) &&
         U.isPointerOrNULL(Program.ROM.u32(addr + 16)) &&
         U.isPointerOrNULL(Program.ROM.u32(addr + 20))
         ;
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u16(addr + 28);
         return U.ToHexString(i) + " " + TextForm.Direct(id);
     }
                             ));
 }
        //スキル名を検索します.
        //残念ながら、スキルIDでの実装がされていないので文字列でヒントとかから検索します.
        public static uint FindSkillIconAndText(uint[] pointers, string searchSkillName, out string outText)
        {
            if (pointers == null)
            {
                outText = "";
                return(U.NOT_FOUND);
            }

            InputFormRef InputFormRef = Init(null);

            for (int i = 0; i < pointers.Length; i++)
            {
                InputFormRef.ReInitPointer(pointers[i]);
                List <U.AddrResult> list = InputFormRef.MakeList();
                for (int n = 0; n < list.Count; n++)
                {
                    uint   addr = list[n].addr;
                    String name = Program.ROM.getString(addr + 8, 12);
                    if (name.IndexOf(searchSkillName) >= 0)
                    {
                        outText = TextForm.Direct(Program.ROM.u16(addr + 2));
                        uint icon = Program.ROM.u16(addr + 0);
                        return(icon);
                    }
                }
                for (int n = 0; n < list.Count; n++)
                {
                    uint   addr = list[n].addr;
                    String text = TextForm.Direct(Program.ROM.u16(addr + 2));
                    if (text.IndexOf(searchSkillName) >= 0)
                    {
                        outText = text;
                        uint icon = Program.ROM.u16(addr + 0);
                        return(icon);
                    }
                }
            }

            outText = "";
            return(U.NOT_FOUND);
        }
Ejemplo n.º 29
0
        public static String GetMapNameWhereAddr(uint addr)
        {
            uint id;

            if (Program.ROM.RomInfo.version() == 6)
            {//FE6
                id = Program.ROM.u16(addr + 56);
                return(FETextDecode.Direct(id));
            }

            String map_cp   = "";
            uint   chaptere = Program.ROM.u8(addr + 128);

            if (chaptere > 0)
            {
                map_cp = ChaptereToString(chaptere);
            }

            id = Program.ROM.u16(addr + 112);
            return(map_cp + " " + TextForm.Direct(id));
        }
Ejemplo n.º 30
0
        public static string GetMenuName(uint addr)
        {
            addr = U.toOffset(addr);
            if (!U.isSafetyOffset(addr) || !U.isSafetyOffset(addr + 28))
            {
                return("");
            }

            uint tid = Program.ROM.u16(addr + 18);

            if (tid <= 0x10)
            {
                return("");
            }

            string name = TextForm.Direct(tid);

            //最初の方だけ
            name = U.cut(name, "\r\n");
            return(name);
        }