예제 #1
0
        public void StoreSaveRam(byte[] data)
        {
            if (data.Take(8).SequenceEqual(Encoding.ASCII.GetBytes("GBABATT\0")))
            {
                data = LegacyFix(data);
            }

            int len = LibmGBA.BizGetSaveRamSize(core);

            if (len > data.Length)
            {
                byte[] _tmp = new byte[len];
                Array.Copy(data, _tmp, data.Length);
                for (int i = data.Length; i < len; i++)
                {
                    _tmp[i] = 0xff;
                }
                data = _tmp;
            }
            else if (len < data.Length)
            {
                // we could continue from this, but we don't expect it
                throw new InvalidOperationException("Saveram will be truncated!");
            }
            LibmGBA.BizPutSaveRam(core, data);
        }
예제 #2
0
 public void StoreSaveRam(byte[] data)
 {
     if (data.Take(8).SequenceEqual(Encoding.ASCII.GetBytes("GBABATT\0")))
     {
         data = LegacyFix(data);
     }
     LibmGBA.BizPutSaveRam(_core, data, data.Length);
 }
예제 #3
0
 public void StoreSaveRam(byte[] data)
 {
     if (data.Take(8).SequenceEqual(Encoding.ASCII.GetBytes("GBABATT\0")))
     {
         data = LegacyFix(data);
     }
     if (!LibmGBA.BizPutSaveRam(_core, data, data.Length))
     {
         throw new InvalidOperationException("BizPutSaveRam returned NULL!");
     }
 }