public void LoadStateBinary(System.IO.BinaryReader reader) { CheckDisposed(); int len = reader.ReadInt32(); if (len != SaveStateBuff.Length) { throw new InvalidOperationException("Unexpected savestate buffer length!"); } reader.Read(SaveStateBuff, 0, SaveStateBuff.Length); LibQuickNES.ThrowStringError(QN.qn_state_load(Context, SaveStateBuff, SaveStateBuff.Length)); // other variables IsLagFrame = reader.ReadBoolean(); LagCount = reader.ReadInt32(); Frame = reader.ReadInt32(); }