diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs index 0cb6ecdb65..3417f08649 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Atari2600.cs @@ -72,6 +72,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 (addr, value) => (_mapper as mDPC).DspData[addr] = value)); } + if (_mapper.HasCartRam) + { + domains.Add(new MemoryDomain( + "Cart Ram", + _mapper.CartRam.Len, + MemoryDomain.Endian.Little, + addr => _mapper.CartRam[addr], + (addr, value) => _mapper.CartRam[addr] = value)); + } + MemoryDomains = new MemoryDomainList(domains); } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/MapperBase.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/MapperBase.cs index 1792e202d0..3a513724e0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/MapperBase.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/MapperBase.cs @@ -6,6 +6,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { public Atari2600 Core { get; set; } + public virtual bool HasCartRam + { + get { return false; } + } + + public virtual ByteBuffer CartRam + { + get { return new ByteBuffer(0); } + } + public virtual byte ReadMemory(ushort addr) { return Core.BaseReadMemory(addr); @@ -28,5 +38,6 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 public virtual void ClockCpu() { } public virtual void HardReset() { } + } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs index 73d40f540b..6b5c9897b3 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m3E.cs @@ -27,6 +27,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private bool _hasRam; private ByteBuffer _ram = new ByteBuffer(256 * 1024); // Up to 256k + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void SyncState(Serializer ser) { base.SyncState(ser); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs index 4531045267..4631ca9efe 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/m4A50.cs @@ -42,6 +42,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private int _mySliceLow; private int _mySliceMiddle; + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _myRam; } + } + public override byte ReadMemory(ushort addr) { byte val = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs index 8108cad2c3..71ed3e90e5 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mAR.cs @@ -21,6 +21,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 throw new NotImplementedException(); } + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void SyncState(Serializer ser) { base.SyncState(ser); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs index 7944eb5f1c..ee7170fefd 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mCV.cs @@ -20,6 +20,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 { private ByteBuffer _ram = new ByteBuffer(1024); + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void SyncState(Serializer ser) { base.SyncState(ser); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEFSC.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEFSC.cs index aacccce5e9..d34f0b26de 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEFSC.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mEFSC.cs @@ -12,6 +12,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private int _bank4k; private ByteBuffer _ram = new ByteBuffer(128); + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void SyncState(Serializer ser) { base.SyncState(ser); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4SC.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4SC.cs index 3c3dfa9d70..3a8f468897 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4SC.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF4SC.cs @@ -11,6 +11,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private int _bank4k; private ByteBuffer _ram = new ByteBuffer(128); + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void SyncState(Serializer ser) { base.SyncState(ser); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6SC.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6SC.cs index 72762878b9..174fe16ccf 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6SC.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF6SC.cs @@ -11,6 +11,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private int _bank4k; private ByteBuffer _ram = new ByteBuffer(128); + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void SyncState(Serializer ser) { base.SyncState(ser); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8SC.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8SC.cs index cd8a2e5576..df8dffad22 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8SC.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mF8SC.cs @@ -11,6 +11,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private int _bank_4K; private ByteBuffer _ram = new ByteBuffer(128); + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void HardReset() { _bank_4K = 0; diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs index e4a85f4a94..ec1ad63d41 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Mappers/mFA2.cs @@ -13,6 +13,16 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private int _bank4k; private ByteBuffer _ram = new ByteBuffer(256); + public override bool HasCartRam + { + get { return true; } + } + + public override ByteBuffer CartRam + { + get { return _ram; } + } + public override void SyncState(Serializer ser) { base.SyncState(ser);