Exemplo n.º 1
0
        public SAV6(byte[] data = null)
        {
            Data       = data ?? new byte[SaveUtil.SIZE_G6ORAS];
            BAK        = (byte[])Data.Clone();
            Exportable = !IsRangeEmpty(0, Data.Length);

            // Load Info
            Blocks = BlockInfo3DS.GetBlockInfoData(Data, out BlockInfoOffset, SaveUtil.CRC16_CCITT);
            GetSAVOffsets();

            HeldItems = ORAS ? Legal.HeldItem_AO : Legal.HeldItem_XY;
            Personal  = ORAS ? PersonalTable.AO : PersonalTable.XY;
            if (!Exportable)
            {
                ClearBoxes();
            }
        }
Exemplo n.º 2
0
        public SAV7b(byte[] data)
        {
            Data       = data;
            BAK        = (byte[])Data.Clone();
            Exportable = !IsRangeEmpty(0, Data.Length);

            // Load Info
            const int len = 0xB8800; // 1mb always allocated

            BlockInfoOffset = len - 0x1F0;
            Blocks          = !Exportable ? BlockInfoGG : BlockInfo3DS.GetBlockInfoData(Data, ref BlockInfoOffset, SaveUtil.CRC16NoInvert, len);
            Personal        = PersonalTable.GG;

            Box         = GetBlockOffset(BelugaBlockIndex.PokeListPokemon);
            Party       = GetBlockOffset(BelugaBlockIndex.PokeListPokemon);
            EventFlag   = GetBlockOffset(BelugaBlockIndex.EventWork);
            PokeDex     = GetBlockOffset(BelugaBlockIndex.Zukan);
            Zukan       = new Zukan7b(this, PokeDex, 0x550);
            Config      = new ConfigSave7b(this);
            Items       = new MyItem7b(this);
            Storage     = new PokeListHeader(this);
            Status      = new MyStatus7b(this);
            Played      = new PlayTime7b(this);
            Misc        = new Misc7b(this);
            EventWork   = new EventWork7b(this);
            GiftRecords = new WB7Records(this);

            WondercardData = GiftRecords.Offset;

            HeldItems = Legal.HeldItems_GG;

            if (Exportable)
            {
                CanReadChecksums();
            }
            else
            {
                ClearBoxes();
            }
        }