waterbox - remove some unused saverammerer junkus

ngp doesn't use this, so...
This commit is contained in:
nattthebear 2020-06-14 20:29:22 -04:00
parent abc1f502b9
commit e5e4983464
3 changed files with 0 additions and 48 deletions

View File

@ -1,34 +0,0 @@
using BizHawk.Emulation.Common;
using System;
namespace BizHawk.Emulation.Cores.Waterbox
{
internal class CustomSaverammer : ISaveRam
{
private readonly ICustomSaveram _s;
private readonly int _size;
public CustomSaverammer(ICustomSaveram s)
{
_s = s;
_size = s.GetSaveramSize();
}
public bool SaveRamModified => _size > 0;
public byte[] CloneSaveRam()
{
var ret = new byte[_size];
_s.GetSaveram(ret, ret.Length);
return ret;
}
public void StoreSaveRam(byte[] data)
{
if (data.Length != _size)
throw new InvalidOperationException("Wrong size saveram");
_s.PutSaveram(data, data.Length);
}
}
}

View File

@ -129,14 +129,4 @@ namespace BizHawk.Emulation.Cores.Waterbox
[BizImport(CC)]
public abstract void SetInputCallback(EmptyCallback callback);
}
/// <summary>
/// if a core implements this, it will be used for saveramming instead of memory domains
/// </summary>
interface ICustomSaveram
{
int GetSaveramSize();
void PutSaveram(byte[] data, int size);
void GetSaveram(byte[] data, int size);
}
}

View File

@ -79,10 +79,6 @@ namespace BizHawk.Emulation.Cores.Waterbox
.ToArray();
_saveramSize = (int)_saveramAreas.Sum(a => a.Size);
var sr = _core as ICustomSaveram;
if (sr != null)
_serviceProvider.Register<ISaveRam>(new CustomSaverammer(sr)); // override the default implementation
_exe.Seal();
}
}