Example #1
0
        protected void ReloadBattleTeams()
        {
            var demo = this is SAV7SM && Data.IsRangeAll((byte)0, BoxLayout.Offset, 0x4C4); // up to Battle Box values

            if (demo || !Exportable)
            {
                BoxLayout.ClearBattleTeams();
            }
            else // Valid slot locking info present
            {
                BoxLayout.LoadBattleTeams();
            }
        }
Example #2
0
        private int GetActiveStorageBlock()
        {
            // Check to see if the save is initialized completely
            // if the block is not initialized, fall back to the other save.
            int start = StorageStart;

            if (Data.IsRangeAll((byte)0, start, 10) || Data.IsRangeAll((byte)0xFF, start, 10))
            {
                return(1);
            }
            start += 0x40000; // check other save
            if (Data.IsRangeAll((byte)0, start, 10) || Data.IsRangeAll((byte)0xFF, start, 10))
            {
                return(0);
            }

            int  ofs   = GetStorageBlockSaveCounterOffset();
            bool first = BitConverter.ToUInt16(Data, ofs) >= BitConverter.ToUInt16(Data, ofs + 0x40000);

            return(first ? 0 : 1);
        }