Esempio n. 1
0
        private void WorldMapPointForm_Load(object sender, EventArgs e)
        {
            MapPictureBox.HideCommandBar();
            MapPictureBox.LoadWorldMap();
            MapPictureBox.SetChipSize(1);

            for (uint i = 0; i < WorldMapPathForm.DataCount(); i++)
            {
                List <MapPictureBox.StaticItem> list = WorldMapPathForm.DrawPath(i);
                for (int n = 0; n < list.Count; n++)
                {
                    MapPictureBox.SetStaticItem("road" + i.ToString() + "_" + n.ToString(), list[n].x, list[n].y, list[n].bitmap);
                }
                MapPictureBox.Invalidate();
            }

            //拡張ボタンを表示するかどうか
            if (WorldMapPointForm.IsShowWorldmapPointExetdns(AddressList.Items.Count))
            {
                AddressListExpandsButton_255.Show();
            }
            else
            {
                this.AddressList.Height += AddressListExpandsButton_255.Height;
                AddressListExpandsButton_255.Hide();
            }
        }
Esempio n. 2
0
        void MakeWorldMap()
        {
            MapPictureBox.LoadWorldMap();
            MapPictureBox.ClearStaticItem();

            int pathid = this.AddressList.SelectedIndex;

            if (pathid >= 0)
            {
                //道の描画
                List <MapPictureBox.StaticItem> list = WorldMapPathForm.DrawPath((uint)pathid);
                for (int n = 0; n < list.Count; n++)
                {
                    MapPictureBox.SetStaticItem("road" + pathid.ToString() + "_" + n.ToString(), list[n].x, list[n].y, list[n].bitmap);
                }
            }

            //拠点を追加
            List <U.AddrResult> arlist = WorldMapPointForm.MakeWorldMapPointList();

            for (int i = 0; i < arlist.Count; i++)
            {
                MapPictureBox.StaticItem item = WorldMapPointForm.DrawBasePointAddr(arlist[i].addr);
                MapPictureBox.SetStaticItem("base" + i.ToString(), item.x, item.y, item.bitmap, item.draw_x_add, item.draw_y_add);
            }

            MapPictureBox.InvalidateMap();
        }
Esempio n. 3
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.worldmap_bgm_pointer
                             , 4
                             , (int i, uint addr) =>
     {    //終端データは存在しない
         uint song_id1 = Program.ROM.u16(addr + 0);
         uint song_id2 = Program.ROM.u16(addr + 2);
         if (song_id1 == 1 && song_id2 == 0)
         {
             return false;
         }
         if (song_id1 == 0 && song_id2 == 0)
         {
             return false;
         }
         return true;
     }
                             , (int i, uint addr) =>
     {
         string name = WorldMapPointForm.GetWorldMapPointName((uint)i);
         return U.ToHexString(i) + " " + name;
     }
                             ));
 }
        public static uint GetWorldmapNode(uint next_chaper)
        {
            Debug.Assert(Program.ROM.RomInfo.version() == 8);

            uint nodeid = WorldMapPointForm.GetNodeIDByChapter(next_chaper);

            if (nodeid != U.NOT_FOUND)
            {
                return(nodeid);
            }

            //不明な場合は、現在の拠点IDを返す.
            uint gSomeWMEventRelatedStruct;

            if (Program.ROM.RomInfo.is_multibyte())
            {//FE8J
                gSomeWMEventRelatedStruct = 0x03005270;
            }
            else
            {//FE8U
                gSomeWMEventRelatedStruct = 0x03005280;
            }
            nodeid = Program.RAM.u8(gSomeWMEventRelatedStruct + 0x11);
            return(nodeid);
        }
Esempio n. 5
0
        static List <U.AddrResult> MakeShopListLow()
        {
            List <U.AddrResult> ret = new List <U.AddrResult>();
            uint p;

            //編成準備店.
            p = Program.ROM.RomInfo.item_shop_hensei_pointer;
            if (p != 0)
            {
                ret.Add(new U.AddrResult(
                            Program.ROM.p32(p)
                            , R._("編成準備店")
                            , p));
            }
            if (Program.ROM.RomInfo.version >= 8)
            {
                //まずワールドマップイベントをスキャン.
                List <U.AddrResult> worldmaplist = WorldMapPointForm.MakeWorldMapPointList();
                for (uint i = 0; i < worldmaplist.Count; i++)
                {
                    List <U.AddrResult> shops =
                        WorldMapPointForm.GetShopAddr(U.toOffset(worldmaplist[(int)i].addr));
                    foreach (U.AddrResult shop in shops)
                    {
                        if (Program.ROM.u8(shop.addr) == 0)
                        {//店に品物がない.
                            continue;
                        }

                        ret.Add(shop);
                    }
                }
            }
            List <U.AddrResult> maplist = MapSettingForm.MakeMapIDList();

            for (int n = 0; n < maplist.Count; n++)
            {
                uint addr = MapSettingForm.GetEventAddrWhereMapID((uint)n);
                if (!U.isSafetyOffset(addr))
                {
                    continue;
                }
                string mapname = MapSettingForm.GetMapName((uint)n);

                List <U.AddrResult> shops = EventCondForm.MakeShopPointerListBox(addr);
                foreach (U.AddrResult shop in shops)
                {
                    if (Program.ROM.u8(shop.addr) == 0)
                    {//店に品物がない.
                        continue;
                    }
                    shop.name = mapname + " " + shop.name;
                    ret.Add(shop);
                }
            }

            return(ret);
        }
        void MakeWorldMap()
        {
            ImageUtil.BitBlt(this.MapCache
                             , 0, 0
                             , this.MapCache.Width, this.MapCache.Height
                             , this.WorldmapBGCache
                             , 0, 0);

            //道のパレット追加.
            int pathPaletteMapping = ImageUtil.AppendPalette(MapCache, PathCacheImage);

            int index = this.PathType.SelectedIndex;

            if (index <= -1)
            {
                this.WorldMap.Image = MapCache;
                return;
            }
            for (int i = 0; i < PathList.Count; i++)
            {
                int    flip = PathList[i].path_x / 8;
                Bitmap pathOne;
                if (flip == 0)
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, false, false);
                }
                else if (flip == 1)
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, true, false);
                }
                else if (flip == 2)
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, false, true);
                }
                else
                {
                    pathOne = ImageUtil.Copy(PathCacheImage, 0, PathList[i].path_y, 8, 8, true, true);
                }

                ImageUtil.BitBlt(MapCache
                                 , PathList[i].worldmap_x
                                 , PathList[i].worldmap_y
                                 , 8
                                 , 8
                                 , pathOne, 0, 0
                                 , pathPaletteMapping);
            }

            //拠点を追加.
            List <U.AddrResult> arlist = WorldMapPointForm.MakeWorldMapPointList();

            for (int i = 0; i < arlist.Count; i++)
            {
                WorldMapPointForm.DrawBasePointAddr(MapCache, arlist[i].addr);
            }

            this.WorldMap.Image = MapCache;
        }
        public static uint GetWorldmapNode(uint next_chaper)
        {
            Debug.Assert(Program.ROM.RomInfo.version() == 8);

            uint nodeid = WorldMapPointForm.GetNodeIDByChapter(next_chaper);

            if (nodeid != U.NOT_FOUND)
            {
                return(nodeid);
            }

            //不明な場合は、現在の拠点IDを返す.
            return(GetCurrentWorldmapNode());
        }
        public static string ConvertWorldmapNodeToString(uint v)
        {
            if (v == U.NOT_FOUND)
            {
                return("");
            }
            string ret     = U.ToHexString(v);
            string edition = WorldMapPointForm.GetWorldMapPointName(v);

            if (edition == "")
            {
                edition = "???";
            }
            return(R._("拠点") + ": " + ret + "=" + edition);
        }
Esempio n. 9
0
        public static string GetPathName(uint id)
        {
            InputFormRef InputFormRef = Init(null);
            //現在のIDに対応するデータ
            uint addr = InputFormRef.IDToAddr(id);

            if (!U.isSafetyOffset(addr))
            {
                return("");
            }
            uint   basepoint1       = Program.ROM.u8(addr + 4);
            uint   basepoint2       = Program.ROM.u8(addr + 4 + 1);
            string basepointstring1 = WorldMapPointForm.GetWorldMapPointName(basepoint1);
            string basepointstring2 = WorldMapPointForm.GetWorldMapPointName(basepoint2);

            return(basepointstring1 + " -> " + basepointstring2);
        }
 static InputFormRef Init(Form self)
 {//魔物が発生する拠点
     return new InputFormRef(self
         , ""
         , Program.ROM.RomInfo.monster_wmap_base_point_pointer()
         , 1
         , (int i, uint addr) =>
         {//読込最大値検索
             return i < 0x9;
         }
         , (int i, uint addr) =>
         {
             uint baseID = Program.ROM.u8(addr);
             return U.ToHexString(i) + " " + WorldMapPointForm.GetWorldMapPointName(baseID);
         }
         );
 }
Esempio n. 11
0
        private void WorldMapEventPointerForm_Load(object sender, EventArgs e)
        {
            //拡張ボタンを表示するかどうか
            uint node_count = WorldMapPointForm.GetDataCount();

            if (WorldMapPointForm.IsShowWorldmapPointExetdns((int)node_count))
            {
                AddressListExpandsButton_255.Show();
                N_AddressListExpandsButton_255.Show();
            }
            else
            {
                this.AddressList.Height += AddressListExpandsButton_255.Height;
                AddressListExpandsButton_255.Hide();

                this.N_AddressList.Height += N_AddressListExpandsButton_255.Height;
                N_AddressListExpandsButton_255.Hide();
            }
        }
Esempio n. 12
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.worldmap_road_pointer()
                             , 12
                             , (int i, uint addr) =>
     {
         return U.isPointer(Program.ROM.u32(addr))
         ;
     }
                             , (int i, uint addr) =>
     {
         uint basepoint1 = Program.ROM.u8(addr + 4);
         uint basepoint2 = Program.ROM.u8(addr + 4 + 1);
         string basepointstring1 = WorldMapPointForm.GetWorldMapPointName(basepoint1);
         string basepointstring2 = WorldMapPointForm.GetWorldMapPointName(basepoint2);
         return U.ToHexString(i) + " " + basepointstring1 + " -> " + basepointstring2;
     }
                             ));
 }
Esempio n. 13
0
        public static void MakeLZ77DataList(List <Address> list)
        {
            //誤爆すると面倒なことになるフレームとOAMのデータ群
            Dictionary <uint, bool> ignoreDic = new Dictionary <uint, bool>();

            ImageBattleAnimeForm.MakeBattleFrameAndOAMDictionary(ignoreDic);
            SoundFootStepsForm.MakeIgnoreDictionary(ignoreDic);
            WorldMapPointForm.MakeIgnoreDictionary(ignoreDic);
            MakeIgnoreDictionnaryFromList(ignoreDic, list);

            string name   = R._("圧縮データ");
            uint   length = (uint)Program.ROM.Data.Length - 4;

            for (uint addr = 0x100; addr < length; addr += 4)
            {
                uint a = (uint)Program.ROM.Data[addr + 3];
                if (a != 0x08 && a != 0x09)
                {//ポインタ以外無視する.
                    continue;
                }
                a = Program.ROM.p32(addr);
                if (!U.isSafetyOffset(a))
                {//危険なポインタは無視
                    continue;
                }
                if (a < Program.ROM.RomInfo.compress_image_borderline_address)
                {
                    continue;
                }
                if (!U.isPadding4(a))
                {//4バイトパディングされていないlz77データはありえないとする.
                    continue;
                }

                if (ignoreDic.ContainsKey(a))
                {//戦闘アニメのフレーム,OAM等のlz77で圧縮されているデータ
                    continue;
                }

                //ポインタ先は圧縮されているか?
                uint imageDataSize = LZ77.getUncompressSize(Program.ROM.Data, a);
                if (IsBadImageSize(imageDataSize))
                {
                    continue;
                }

                //ポインタは連続してあらわれるのでそのチェックをする.
                if (!IsContinuousPointer(addr, length))
                {
                    continue;
                }

                uint getcompsize = LZ77.getCompressedSize(Program.ROM.Data, a);
                if (getcompsize == 0)
                {
                    continue;
                }

                //たぶん画像だと判断する.
                FEBuilderGBA.Address.AddAddress(list, a, getcompsize, addr, name + U.To0xHexString(a), Address.DataTypeEnum.LZ77IMG);
                if (InputFormRef.DoEvents(null, "MakeLZ77DataList " + U.ToHexString(addr)))
                {
                    return;
                }
            }
        }