Пример #1
0
        public void LoadStateBinary(BinaryReader reader)
        {
            int length = reader.ReadInt32();

            if (length != savebuff.Length)
            {
                throw new InvalidOperationException("Save buffer size mismatch!");
            }
            reader.Read(savebuff, 0, length);
            LibmGBA.BizPutState(core, savebuff);

            // other variables
            IsLagFrame = reader.ReadBoolean();
            LagCount   = reader.ReadInt32();
            Frame      = reader.ReadInt32();
        }
Пример #2
0
        public void LoadStateBinary(BinaryReader reader)
        {
            int length = reader.ReadInt32();

            if (length > savebuff.Length)
            {
                savebuff  = new byte[length];
                savebuff2 = new byte[length + 13];
            }
            reader.Read(savebuff, 0, length);
            if (!LibmGBA.BizPutState(core, savebuff, length))
            {
                throw new InvalidOperationException("Core rejected the savestate!");
            }

            // other variables
            IsLagFrame = reader.ReadBoolean();
            LagCount   = reader.ReadInt32();
            Frame      = reader.ReadInt32();
        }