public void StoreSaveRam(byte[] data) { if (disposed) { throw new ObjectDisposedException(typeof(GPGX).ToString()); } else { int size = 0; IntPtr area = IntPtr.Zero; LibGPGX.gpgx_get_sram(ref area, ref size); if (size <= 0 || area == IntPtr.Zero) { return; } if (size != data.Length) { throw new Exception("Unexpected saveram size"); } Marshal.Copy(data, 0, area, size); LibGPGX.gpgx_sram_commitwrite(); } }