Example #1
0
        public static List <string> GetPSSParse(SAV6 SAV)
        {
            var result = new List <string> {
                Header
            };
            int offset = SAV.PSS;
            var data   = SAV.Data;

            for (int g = 0; g < 3; g++)
            {
                result.Add("----");
                result.Add(headers[g]);
                result.Add("----");
                // uint count = ReadUInt32LittleEndian(data.AsSpan(offset + 0x4E20));
                ReadTrainers(result, data, offset, 100);
                offset += 0x5000; // Advance to next block
            }

            return(result);
        }
Example #2
0
        public static List <string> GetPSSParse(SAV6 SAV)
        {
            var result = new List <string> {
                Header
            };
            int offset = SAV.PSS;
            var data   = SAV.Data;

            for (int g = 0; g < 3; g++)
            {
                result.Add("----");
                result.Add(headers[g]);
                result.Add("----");
                // uint count = BitConverter.ToUInt32(savefile, offset + 0x4E20);
                ReadTrainers(result, data, offset, 100);
                offset += 0x5000; // Advance to next block
            }

            return(result);
        }
Example #3
0
        /// <summary>Creates an instance of a SaveFile using the given save data.</summary>
        /// <param name="data">Save data from which to create a SaveFile.</param>
        /// <returns>An appropriate type of save file for the given data, or null if the save data is invalid.</returns>
        public static SaveFile getVariantSAV(byte[] data)
        {
            // Pre-check for header/footer signatures
            SaveFile sav;

            byte[] header = new byte[0], footer = new byte[0];
            CheckHeaderFooter(ref data, ref header, ref footer);

            switch (getSAVGeneration(data))
            {
            // Main Games
            case GameVersion.Gen1:      sav = new SAV1(data); break;

            case GameVersion.Gen2:      sav = new SAV2(data); break;

            case GameVersion.Gen3:      sav = new SAV3(data); break;

            case GameVersion.Gen4:      sav = new SAV4(data); break;

            case GameVersion.Gen5:      sav = new SAV5(data); break;

            case GameVersion.Gen6:      sav = new SAV6(data); break;

            case GameVersion.Gen7:      sav = new SAV7(data); break;

            // Side Games
            case GameVersion.COLO:      sav = new SAV3Colosseum(data); break;

            case GameVersion.XD:        sav = new SAV3XD(data); break;

            case GameVersion.RSBOX:     sav = new SAV3RSBox(data); break;

            case GameVersion.BATREV:    sav = new SAV4BR(data); break;

            // No pattern matched
            default: return(null);
            }
            sav.Header = header;
            sav.Footer = footer;
            return(sav);
        }
Example #4
0
        private static List <StorageSlotOffset> GetExtraSlots6(SAV6 sav)
        {
            if (sav.ORASDEMO)
            {
                return(None);
            }
            var list = new List <StorageSlotOffset>
            {
                new StorageSlotOffset {
                    Type = StorageSlotType.GTS, Offset = sav.GTS
                },
                new StorageSlotOffset {
                    Type = StorageSlotType.Fused, Offset = sav.Fused
                }
            };

            if (sav.XY)
            {
                list.Add(new StorageSlotOffset {
                    Type = StorageSlotType.Misc, Offset = sav.SUBE
                });
            }
            return(list);
        }
Example #5
0
 protected SubEventLog6(SAV6 sav, int offset) : base(sav) => Offset = offset;
Example #6
0
 public Record6(SAV6 sav, int offset, IReadOnlyList <byte> maxes) : base(sav)
 {
     Offset    = offset;
     RecordMax = maxes;
 }
Example #7
0
 public MysteryBlock6(SAV6 sav, int offset) : base(sav) => Offset = offset;
Example #8
0
 public PlayTime6(SAV6 sav, int offset) : base(sav) => Offset = offset;
Example #9
0
        /// <summary>Creates an instance of a SaveFile using the given save data.</summary>
        /// <param name="data">Save data from which to create a SaveFile.</param>
        /// <returns>An appropriate type of save file for the given data, or null if the save data is invalid.</returns>
        public static SaveFile getVariantSAV(byte[] data)
        {
            // Pre-check for header/footer signatures
            SaveFile sav;
            byte[] header = new byte[0], footer = new byte[0];
            CheckHeaderFooter(ref data, ref header, ref footer);

            switch (getSAVGeneration(data))
            {
                // Main Games
                case GameVersion.Gen1:      sav = new SAV1(data); break;
                case GameVersion.Gen2:      sav = new SAV2(data); break;
                case GameVersion.Gen3:      sav = new SAV3(data); break;
                case GameVersion.Gen4:      sav = new SAV4(data); break;
                case GameVersion.Gen5:      sav = new SAV5(data); break;
                case GameVersion.Gen6:      sav = new SAV6(data); break;
                case GameVersion.Gen7:      sav = new SAV7(data); break;

                // Side Games
                case GameVersion.COLO:      sav = new SAV3Colosseum(data); break;
                case GameVersion.XD:        sav = new SAV3XD(data); break;
                case GameVersion.RSBOX:     sav = new SAV3RSBox(data); break;
                case GameVersion.BATREV:    sav = new SAV4BR(data); break;
                
                // No pattern matched
                default: return null;
            }
            sav.Header = header;
            sav.Footer = footer;
            return sav;
        }