Removing no-longer needed SRAM logic

This commit is contained in:
Sergio Martin 2025-03-18 21:31:41 +01:00
parent a9387eee96
commit 488ec5ddf4
3 changed files with 1 additions and 73 deletions

View File

@ -1,59 +0,0 @@
using BizHawk.Emulation.Common;
namespace BizHawk.Emulation.Cores.Computers.DOS
{
public partial class DOSBox : ISaveRam
{
public override bool SaveRamModified
{
get
{
bool sramChanged = _libDOSBox.sram_changed();
return sramChanged;
}
}
public override byte[] CloneSaveRam()
{
var sramSize = _libDOSBox.get_sram_size();
//Console.WriteLine("SRAM Size {0}", sramSize);
// Don't do anything if no writable hard disk was chosen
if (_syncSettings.WriteableHardDisk == WriteableHardDiskOptions.None) return Array.Empty<byte>();
byte[] sramArray = new byte[sramSize];
unsafe
{
fixed (byte* p = sramArray)
{
IntPtr ptr = (IntPtr) p;
_libDOSBox.get_sram(ptr);
}
}
return sramArray;
}
public override void StoreSaveRam(byte[] data)
{
if (data.Length != (int) _syncSettings.WriteableHardDisk)
{
Console.WriteLine("SRAM size {0} does not match that of the chosen writable hard disk {1}. Aborting SRAM loading.", data.Length, (int) _syncSettings.WriteableHardDisk);
return;
}
// Don't do anything if no writable hard disk was chosen
if (_syncSettings.WriteableHardDisk == WriteableHardDiskOptions.None) return;
unsafe
{
fixed (byte* p = data)
{
IntPtr ptr = (IntPtr) p;
_libDOSBox.set_sram(ptr);
}
}
}
}
}

View File

@ -63,19 +63,6 @@ namespace BizHawk.Emulation.Cores.Computers.DOS
[BizImport(CC, Compatibility = true)]
public abstract bool Init(bool joystick1Enabled, bool joystick2Enabled, bool mouseEnabled, ulong hardDiskDriveSize, ulong fpsNumerator, ulong fpsDenominator);
[BizImport(CC, Compatibility = true)]
public abstract bool sram_changed();
[BizImport(CC, Compatibility = true)]
public abstract int get_sram_size();
[BizImport(CC, Compatibility = true)]
public abstract void get_sram(IntPtr sramBuffer);
[BizImport(CC, Compatibility = true)]
public abstract void set_sram(IntPtr sramBuffer);
[BizImport(CC, Compatibility = true)]
public abstract bool getDriveActivityFlag();

@ -1 +1 @@
Subproject commit e2b4045639cd51efea595513eaae1fcb6d680855
Subproject commit 116c7bcf65fe640ac6efc9accc727553830a9f5a