From e5e4983464ee6a9bd20c020d4b3401a7329c7ce0 Mon Sep 17 00:00:00 2001 From: nattthebear Date: Sun, 14 Jun 2020 20:29:22 -0400 Subject: [PATCH] waterbox - remove some unused saverammerer junkus ngp doesn't use this, so... --- .../Waterbox/CustomSaverammer.cs | 34 ------------------- .../Waterbox/LibWaterboxCore.cs | 10 ------ .../Waterbox/WaterboxCore.cs | 4 --- 3 files changed, 48 deletions(-) delete mode 100644 src/BizHawk.Emulation.Cores/Waterbox/CustomSaverammer.cs diff --git a/src/BizHawk.Emulation.Cores/Waterbox/CustomSaverammer.cs b/src/BizHawk.Emulation.Cores/Waterbox/CustomSaverammer.cs deleted file mode 100644 index f0f0fbd4fd..0000000000 --- a/src/BizHawk.Emulation.Cores/Waterbox/CustomSaverammer.cs +++ /dev/null @@ -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); - } - } -} diff --git a/src/BizHawk.Emulation.Cores/Waterbox/LibWaterboxCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/LibWaterboxCore.cs index d799be00a9..49c3a3c15c 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/LibWaterboxCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/LibWaterboxCore.cs @@ -129,14 +129,4 @@ namespace BizHawk.Emulation.Cores.Waterbox [BizImport(CC)] public abstract void SetInputCallback(EmptyCallback callback); } - - /// - /// if a core implements this, it will be used for saveramming instead of memory domains - /// - interface ICustomSaveram - { - int GetSaveramSize(); - void PutSaveram(byte[] data, int size); - void GetSaveram(byte[] data, int size); - } } diff --git a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs index 781e9312d5..a2da266c96 100644 --- a/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs +++ b/src/BizHawk.Emulation.Cores/Waterbox/WaterboxCore.cs @@ -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(new CustomSaverammer(sr)); // override the default implementation - _exe.Seal(); } }