コード例 #1
0
        public static SystemData FromByteArray(byte[] data, int sramCount)
        {
            SystemData instance = new SystemData(sramCount);

            using (BinaryReader dataReader = new BinaryReader(new MemoryStream(data)))
            {
                instance.Base_Settings = dataReader.ReadBytes(3756);
                for (int i = 0; i < instance.SramCount; i++)
                {
                    instance.Setting_Games[i] = new SettingGame()
                    {
                        data = dataReader.ReadBytes(128)
                    };
                }
                for (int i = 0; i < 256; i++)
                {
                    instance.Work_Trial[i] = dataReader.ReadInt32();
                }
                for (int i = 0; i < instance.SramCount; i++)
                {
                    instance.Sram_Data[i] = SramData.FromByteArray(dataReader.ReadBytes(8448));
                }
            }
            return(instance);
        }
コード例 #2
0
        public static SramData FromByteArray(byte[] data)
        {
            SramData instance = new SramData();

            using (BinaryReader dataReader = new BinaryReader(new MemoryStream(data)))
            {
                for (int i = 0; i < 4; i++)
                {
                    instance.Sram_Entry[i] = SramEntry.FromByteArray(dataReader.ReadBytes(64));
                }
                instance.Sram_Image = dataReader.ReadBytes(8192);
            }
            return(instance);
        }