Enable nullability in some more services and CodeDataLog

This commit is contained in:
YoshiRulz 2021-08-01 14:39:37 +10:00
parent c26b99b547
commit 9ec72fd543
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
30 changed files with 122 additions and 154 deletions

View File

@ -35,7 +35,7 @@ namespace BizHawk.Client.Common.cheats
var domain = CheatDomainName();
return CheatDomainName() == null
? _domains.SystemBus
: _domains[domain];
: _domains[domain]!;
}
private string CheatDomainName() => _systemId switch

View File

@ -20,7 +20,7 @@ namespace BizHawk.Client.Common
private string _mainMemName;
private MemoryDomain Domain => _mainMemDomain ??= ((MemoryApi) APIs.Memory).DomainList[MainMemName];
private MemoryDomain Domain => _mainMemDomain ??= ((MemoryApi) APIs.Memory).DomainList[MainMemName]!;
private string MainMemName => _mainMemName ??= APIs.Memory.MainMemoryName;

View File

@ -300,7 +300,7 @@ namespace BizHawk.Client.Common
{
if (movie.StartsFromSaveRam && emulator.HasSaveRam())
{
emulator.AsSaveRam().StoreSaveRam(movie.SaveRam);
emulator.AsSaveRam().StoreSaveRam(movie.SaveRam!);
}
}

View File

@ -53,7 +53,7 @@ namespace BizHawk.Client.Common
var ms = new MemoryStream();
if (StartsFromSaveRam && emulator.HasSaveRam())
{
emulator.AsSaveRam().StoreSaveRam(SaveRam);
emulator.AsSaveRam().StoreSaveRam(SaveRam!);
}
emulator.AsStatable().SaveStateBinary(new BinaryWriter(ms));
TasStateManager.Engage(ms.ToArray());

View File

@ -800,7 +800,7 @@ namespace BizHawk.Client.EmuHawk
private void SetMemoryDomain(string name)
{
_currentDomain = MemoryDomains[name];
_bigEndian = MemoryDomains[name].EndianType == MemoryDomain.Endian.Big;
_bigEndian = _currentDomain!.EndianType == MemoryDomain.Endian.Big;
MaximizeAddressBox.SetHexProperties(_currentDomain.Size);
TieBreaker1Box.SetHexProperties(_currentDomain.Size);

View File

@ -233,7 +233,7 @@ namespace BizHawk.Client.EmuHawk
{
if (!_loading)
{
var domain = MemoryDomains[DomainDropDown.SelectedItem.ToString()];
var domain = MemoryDomains[DomainDropDown.SelectedItem.ToString()]!;
AddressBox.SetHexProperties(domain.Size);
}
}
@ -294,7 +294,7 @@ namespace BizHawk.Client.EmuHawk
public Cheat GetCheat()
{
var domain = MemoryDomains[DomainDropDown.SelectedItem.ToString()];
var domain = MemoryDomains[DomainDropDown.SelectedItem.ToString()]!;
var address = AddressBox.ToRawInt().Value;
if (address < domain.Size)
{

View File

@ -1,6 +1,4 @@
#nullable disable
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
@ -70,7 +68,7 @@ namespace BizHawk.Emulation.Common
/// </summary>
public bool Active { get; set; }
public string SubType { get; set; }
public string? SubType { get; set; }
public int SubVer { get; set; }
/// <summary>
@ -156,7 +154,7 @@ namespace BizHawk.Emulation.Common
var ret = new Dictionary<string, long>();
var w = new BinaryWriter(s);
w.Write("BIZHAWK-CDL-2");
w.Write(SubType.PadRight(15));
w.Write(SubType!.PadRight(15));
w.Write(Count);
w.Flush();
long addr = s.Position;

View File

@ -1,6 +1,4 @@
#nullable disable
using System;
using System;
using System.IO;
using System.Collections.Generic;
@ -15,7 +13,7 @@ namespace BizHawk.Emulation.Common
/// <summary>
/// Sets the CodeDataLog as current (and logging) on the core
/// </summary>
void SetCDL(ICodeDataLog cdl);
void SetCDL(ICodeDataLog? cdl);
/// <summary>
/// Fills a new CodeDataLog with memory domain information suitable for the core
@ -61,7 +59,7 @@ namespace BizHawk.Emulation.Common
/// </summary>
bool Active { get; set; }
string SubType { get; set; }
string? SubType { get; set; }
int SubVer { get; set; }

View File

@ -1,6 +1,4 @@
#nullable disable
using System;
using System;
using System.Collections.Generic;
namespace BizHawk.Emulation.Common

View File

@ -1,6 +1,4 @@
#nullable disable
using System.Collections.Generic;
using System.Collections.Generic;
namespace BizHawk.Emulation.Common
{
@ -17,7 +15,7 @@ namespace BizHawk.Emulation.Common
/// </summary>
public interface IMemoryDomains : IEnumerable<MemoryDomain>, IEmulatorService
{
MemoryDomain this[string name] { get; }
MemoryDomain? this[string name] { get; }
MemoryDomain MainMemory { get; }

View File

@ -1,6 +1,4 @@
#nullable disable
namespace BizHawk.Emulation.Common
namespace BizHawk.Emulation.Common
{
/// <summary>
/// This service provides the system by which a client can request SaveRAM data to be stored by the client
@ -16,7 +14,7 @@ namespace BizHawk.Emulation.Common
/// Unfortunately, the core may think differently of a nonexisting (null) saveram vs a 0 size saveram.
/// Frontend users of the ISaveRam should treat null as nonexisting (and thus not even write the file, so that the "does not exist" condition can be roundtripped and not confused with an empty file)
/// </summary>
byte[] CloneSaveRam();
byte[]? CloneSaveRam();
/// <summary>
/// store new SaveRAM to the emu core. the data should be the same size as the return from ReadSaveRam()

View File

@ -1,6 +1,4 @@
#nullable disable
using System;
using System;
namespace BizHawk.Emulation.Common
{

View File

@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Components.H6280
w.WriteLine(".\"{0}\" size=0x{1:x8}", kvp.Key, kvp.Value.Length);
byte[] cd = kvp.Value;
var md = mem[kvp.Key];
var md = mem[kvp.Key]!;
for (int i = 0; i < kvp.Value.Length; i++)
{

View File

@ -147,6 +147,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.Serial
private const byte Rts = 0x60;
private const byte JsrSize = 3;
public IMemoryCallbackSystem MemoryCallbacks { get; private set; }
public IMemoryCallbackSystem MemoryCallbacks => throw new NotImplementedException();
}
}

View File

@ -26,30 +26,36 @@ namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
public void NewCDL(ICodeDataLog cdl)
{
cdl["System Bus"] = new byte[memoryDomains["System Bus"].Size];
void AddIfExists(string name)
{
var found = memoryDomains[name];
if (found is not null) cdl[name] = new byte[found.Size];
}
if (memoryDomains.Has("ROM - 128K Editor & Menu")) { cdl["ROM - 128K Editor & Menu"] = new byte[memoryDomains["ROM - 128K Editor & Menu"].Size]; }
if (memoryDomains.Has("ROM - 128K Syntax Checker")) { cdl["ROM - 128K Syntax Checker"] = new byte[memoryDomains["ROM - 128K Syntax Checker"].Size]; }
if (memoryDomains.Has("ROM - +3DOS")) { cdl["ROM - +3DOS"] = new byte[memoryDomains["ROM - +3DOS"].Size]; }
if (memoryDomains.Has("ROM - 48K BASIC")) { cdl["ROM - 48K BASIC"] = new byte[memoryDomains["ROM - 48K BASIC"].Size]; }
cdl["System Bus"] = new byte[memoryDomains["System Bus"]!.Size];
AddIfExists("ROM - 128K Editor & Menu");
AddIfExists("ROM - 128K Syntax Checker");
AddIfExists("ROM - +3DOS");
AddIfExists("ROM - 48K BASIC");
// different RAM bank ordering for < 128k models
if (_machineType == MachineType.ZXSpectrum16 || _machineType == MachineType.ZXSpectrum48)
{
if (memoryDomains.Has("RAM - BANK 0 (Screen)")) { cdl["RAM - BANK 0 (Screen)"] = new byte[memoryDomains["RAM - BANK 0 (Screen)"].Size]; }
if (memoryDomains.Has("RAM - BANK 1")) { cdl["RAM - BANK 1"] = new byte[memoryDomains["RAM - BANK 1"].Size]; }
if (memoryDomains.Has("RAM - BANK 2")) { cdl["RAM - BANK 2"] = new byte[memoryDomains["RAM - BANK 2"].Size]; }
AddIfExists("RAM - BANK 0 (Screen)");
AddIfExists("RAM - BANK 1");
AddIfExists("RAM - BANK 2");
}
else
{
if (memoryDomains.Has("RAM - BANK 5 (Screen)")) { cdl["RAM - BANK 5 (Screen)"] = new byte[memoryDomains["RAM - BANK 5 (Screen)"].Size]; }
if (memoryDomains.Has("RAM - BANK 2")) { cdl["RAM - BANK 2"] = new byte[memoryDomains["RAM - BANK 2"].Size]; }
if (memoryDomains.Has("RAM - BANK 0")) { cdl["RAM - BANK 0"] = new byte[memoryDomains["RAM - BANK 0"].Size]; }
if (memoryDomains.Has("RAM - BANK 1")) { cdl["RAM - BANK 1"] = new byte[memoryDomains["RAM - BANK 1"].Size]; }
if (memoryDomains.Has("RAM - BANK 3")) { cdl["RAM - BANK 3"] = new byte[memoryDomains["RAM - BANK 3"].Size]; }
if (memoryDomains.Has("RAM - BANK 4")) { cdl["RAM - BANK 4"] = new byte[memoryDomains["RAM - BANK 4"].Size]; }
if (memoryDomains.Has("RAM - BANK 6")) { cdl["RAM - BANK 6"] = new byte[memoryDomains["RAM - BANK 6"].Size]; }
if (memoryDomains.Has("RAM - BANK 7 (Shadow Screen)")) { cdl["RAM - BANK 7 (Shadow Screen)"] = new byte[memoryDomains["RAM - BANK 7 (Shadow Screen)"].Size]; }
AddIfExists("RAM - BANK 5 (Screen)");
AddIfExists("RAM - BANK 2");
AddIfExists("RAM - BANK 0");
AddIfExists("RAM - BANK 1");
AddIfExists("RAM - BANK 3");
AddIfExists("RAM - BANK 4");
AddIfExists("RAM - BANK 6");
AddIfExists("RAM - BANK 7 (Shadow Screen)");
}
cdl.SubType = "ZXSpectrum";

View File

@ -236,7 +236,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
if (addr == 0x1850 && _imageOffsets[1] == 3 << 11)
{
LoadIntoRam(Core.MemoryDomains["System Bus"].PeekByte(0x80)); // Get load that's being accessed (BIOS places load number at 0x80) // TODO: a better way to do this
LoadIntoRam(Core.MemoryDomains["System Bus"]!.PeekByte(0x80)); // Get load that's being accessed (BIOS places load number at 0x80) // TODO: a better way to do this
return _superChargerImage[(addr & 0x7FF) + _imageOffsets[1]];
}

View File

@ -14,8 +14,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
public void NewCDL(ICodeDataLog cdl)
{
cdl["RAM"] = new byte[MemoryDomains["Main RAM"].Size];
cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];
cdl["RAM"] = new byte[MemoryDomains["Main RAM"]!.Size];
cdl["ROM"] = new byte[MemoryDomains["ROM"]!.Size];
cdl.SubType = "VEC";
cdl.SubVer = 0;

View File

@ -18,15 +18,13 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM"].Size];
cdl["ROM"] = new byte[MemoryDomains["ROM"]!.Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM"]!.Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM"].Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM"]!.Size];
if (MemoryDomains.Has("Cart RAM"))
{
cdl["CartRAM"] = new byte[MemoryDomains["Cart RAM"].Size];
}
var found = MemoryDomains["Cart RAM"];
if (found is not null) cdl["CartRAM"] = new byte[found.Size];
cdl.SubType = "O2";
cdl.SubVer = 0;

View File

@ -18,15 +18,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawk
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];
cdl["HRAM"] = new byte[MemoryDomains["HRAM"].Size];
cdl["ROM"] = new byte[MemoryDomains["ROM"]!.Size];
cdl["HRAM"] = new byte[MemoryDomains["HRAM"]!.Size];
cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size];
cdl["WRAM"] = new byte[MemoryDomains["WRAM"]!.Size];
if (MemoryDomains.Has("Cart RAM"))
{
cdl["CartRAM"] = new byte[MemoryDomains["Cart RAM"].Size];
}
var found = MemoryDomains["Cart RAM"];
if (found is not null) cdl["CartRAM"] = new byte[found.Size];
cdl.SubType = "GB";
cdl.SubVer = 0;

View File

@ -19,15 +19,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM L"].Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM L"].Size];
cdl["ROM"] = new byte[MemoryDomains["ROM L"]!.Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM L"]!.Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM L"].Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM L"]!.Size];
if (MemoryDomains.Has("Cart RAM L"))
{
cdl["CartRAM"] = new byte[MemoryDomains["Cart RAM L"].Size];
}
var found = MemoryDomains["Cart RAM L"];
if (found is not null) cdl["CartRAM"] = new byte[found.Size];
cdl.SubType = "GB";
cdl.SubVer = 0;

View File

@ -19,15 +19,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink3x
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM L"].Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM L"].Size];
cdl["ROM"] = new byte[MemoryDomains["ROM L"]!.Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM L"]!.Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM L"].Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM L"]!.Size];
if (MemoryDomains.Has("Cart RAM L"))
{
cdl["CartRAM"] = new byte[MemoryDomains["Cart RAM L"].Size];
}
var found = MemoryDomains["Cart RAM L"];
if (found is not null) cdl["CartRAM"] = new byte[found.Size];
cdl.SubType = "GB";
cdl.SubVer = 0;

View File

@ -19,15 +19,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink4x
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM A"].Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM A"].Size];
cdl["ROM"] = new byte[MemoryDomains["ROM A"]!.Size];
cdl["HRAM"] = new byte[MemoryDomains["Zero Page RAM A"]!.Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM A"].Size];
cdl["WRAM"] = new byte[MemoryDomains["Main RAM A"]!.Size];
if (MemoryDomains.Has("Cart RAM A"))
{
cdl["CartRAM"] = new byte[MemoryDomains["Cart RAM A"].Size];
}
var found = MemoryDomains["Cart RAM A"];
if (found is not null) cdl["CartRAM"] = new byte[found.Size];
cdl.SubType = "GB";
cdl.SubVer = 0;

View File

@ -15,15 +15,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];
cdl["ROM"] = new byte[MemoryDomains["ROM"]!.Size];
// cdl["HRAM"] = new byte[_memoryDomains["HRAM"].Size]; //this is probably useless, but it's here if someone needs it
cdl["WRAM"] = new byte[MemoryDomains["WRAM"].Size];
// cdl["HRAM"] = new byte[_memoryDomains["HRAM"]!.Size]; //this is probably useless, but it's here if someone needs it
cdl["WRAM"] = new byte[MemoryDomains["WRAM"]!.Size];
if (MemoryDomains.Has("CartRAM"))
{
cdl["CartRAM"] = new byte[MemoryDomains["CartRAM"].Size];
}
var found = MemoryDomains["CartRAM"];
if (found is not null) cdl["CartRAM"] = new byte[found.Size];
cdl.SubType = "GB";
cdl.SubVer = 0;

View File

@ -9,8 +9,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public byte[] CloneSaveRam()
{
byte[] lb = L.CloneSaveRam();
byte[] rb = R.CloneSaveRam();
var lb = L.CloneSaveRam()!;
var rb = R.CloneSaveRam()!;
byte[] ret = new byte[lb.Length + rb.Length];
Buffer.BlockCopy(lb, 0, ret, 0, lb.Length);
Buffer.BlockCopy(rb, 0, ret, lb.Length, rb.Length);
@ -19,8 +19,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
public void StoreSaveRam(byte[] data)
{
byte[] lb = new byte[L.CloneSaveRam().Length];
byte[] rb = new byte[R.CloneSaveRam().Length];
var lb = new byte[L.CloneSaveRam()!.Length];
var rb = new byte[R.CloneSaveRam()!.Length];
Buffer.BlockCopy(data, 0, lb, 0, lb.Length);
Buffer.BlockCopy(data, lb.Length, rb, 0, rb.Length);
L.StoreSaveRam(lb);

View File

@ -13,23 +13,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public void NewCDL(ICodeDataLog cdl)
{
cdl["RAM"] = new byte[_memoryDomains["RAM"].Size];
if (_memoryDomains.Has("Save RAM"))
void AddIfExists(string name)
{
cdl["Save RAM"] = new byte[_memoryDomains["Save RAM"].Size];
var found = _memoryDomains[name];
if (found is not null) cdl[name] = new byte[found.Size];
}
if (_memoryDomains.Has("Battery RAM"))
{
cdl["Battery RAM"] = new byte[_memoryDomains["Battery RAM"].Size];
}
if (_memoryDomains.Has("Battery RAM"))
{
cdl["Battery RAM"] = new byte[_memoryDomains["Battery RAM"].Size];
}
cdl["RAM"] = new byte[_memoryDomains["RAM"]!.Size];
AddIfExists("Save RAM");
AddIfExists("Battery RAM");
AddIfExists("Battery RAM"); // ???
cdl.SubType = "NES";
cdl.SubVer = 0;
}

View File

@ -236,7 +236,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
{
// inefficient, sloppy, etc etc
var chrrom = _memoryDomains["CHR VROM"];
var prgrom = _memoryDomains["PRG ROM"];
var prgrom = _memoryDomains["PRG ROM"]!;
var ms = new MemoryStream();
for (int i = 0; i < prgrom.Size; i++)

View File

@ -17,23 +17,25 @@ namespace BizHawk.Emulation.Cores.Nintendo.SNES
public void NewCDL(ICodeDataLog cdl)
{
cdl["CARTROM"] = new byte[_memoryDomains["CARTROM"].Size];
cdl["CARTROM-DB"] = new byte[_memoryDomains["CARTROM"].Size];
cdl["CARTROM-D"] = new byte[_memoryDomains["CARTROM"].Size*2];
cdl["WRAM"] = new byte[_memoryDomains["WRAM"].Size];
cdl["APURAM"] = new byte[_memoryDomains["APURAM"].Size];
void AddIfExists(string name, string addAs = null)
{
var found = _memoryDomains[name];
if (found is not null) cdl[addAs ?? name] = new byte[found.Size];
}
if (_memoryDomains.Has("CARTRAM"))
cdl["CARTRAM"] = new byte[_memoryDomains["CARTRAM"].Size];
cdl["CARTROM"] = new byte[_memoryDomains["CARTROM"]!.Size];
cdl["CARTROM-DB"] = new byte[_memoryDomains["CARTROM"]!.Size];
cdl["CARTROM-D"] = new byte[_memoryDomains["CARTROM"]!.Size*2];
cdl["WRAM"] = new byte[_memoryDomains["WRAM"]!.Size];
cdl["APURAM"] = new byte[_memoryDomains["APURAM"]!.Size];
AddIfExists("CARTRAM");
if (IsSGB)
{
cdl["SGB_CARTROM"] = new byte[_memoryDomains["SGB CARTROM"].Size];
cdl["SGB_HRAM"] = new byte[_memoryDomains["SGB HRAM"].Size];
cdl["SGB_WRAM"] = new byte[_memoryDomains["SGB WRAM"].Size];
if (_memoryDomains.Has("SGB CARTRAM"))
cdl["SGB_CARTRAM"] = new byte[_memoryDomains["SGB CARTRAM"].Size];
cdl["SGB_CARTROM"] = new byte[_memoryDomains["SGB CARTROM"]!.Size];
cdl["SGB_HRAM"] = new byte[_memoryDomains["SGB HRAM"]!.Size];
cdl["SGB_WRAM"] = new byte[_memoryDomains["SGB WRAM"]!.Size];
AddIfExists("SGB CARTRAM", addAs: "SGB_CARTRAM");
}
cdl.SubType = "SNES";

View File

@ -27,19 +27,15 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[_memoryDomains["ROM"].Size];
cdl["Main RAM"] = new byte[_memoryDomains["Main RAM"].Size];
if (_memoryDomains.Has("Save RAM"))
void AddIfExists(string name)
{
cdl["Save RAM"] = new byte[_memoryDomains["Save RAM"].Size];
var found = _memoryDomains[name];
if (found is not null) cdl[name] = new byte[found.Size];
}
if (_memoryDomains.Has("Cart (Volatile) RAM"))
{
cdl["Cart (Volatile) RAM"] = new byte[_memoryDomains["Cart (Volatile) RAM"].Size];
}
cdl["ROM"] = new byte[_memoryDomains["ROM"]!.Size];
cdl["Main RAM"] = new byte[_memoryDomains["Main RAM"]!.Size];
AddIfExists("Save RAM");
AddIfExists("Cart (Volatile) RAM");
cdl.SubType = "SMS";
cdl.SubVer = 0;
}

View File

@ -25,19 +25,15 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
public void NewCDL(ICodeDataLog cdl)
{
cdl["ROM"] = new byte[MemoryDomains["ROM"].Size];
cdl["Main RAM"] = new byte[MemoryDomains["Main RAM"].Size];
if (MemoryDomains.Has("Save RAM"))
void AddIfExists(string name)
{
cdl["Save RAM"] = new byte[MemoryDomains["Save RAM"].Size];
var found = MemoryDomains[name];
if (found is not null) cdl[name] = new byte[found.Size];
}
if (MemoryDomains.Has("Cart (Volatile) RAM"))
{
cdl["Cart (Volatile) RAM"] = new byte[MemoryDomains["Cart (Volatile) RAM"].Size];
}
cdl["ROM"] = new byte[MemoryDomains["ROM"]!.Size];
cdl["Main RAM"] = new byte[MemoryDomains["Main RAM"]!.Size];
AddIfExists("Save RAM");
AddIfExists("Cart (Volatile) RAM");
cdl.SubType = "SMS";
cdl.SubVer = 0;
}

View File

@ -16,12 +16,12 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
public void NewCDL(ICodeDataLog cdl)
{
cdl["MD CART"] = new byte[_memoryDomains["MD CART"].Size];
cdl["68K RAM"] = new byte[_memoryDomains["68K RAM"].Size];
cdl["Z80 RAM"] = new byte[_memoryDomains["Z80 RAM"].Size];
cdl["MD CART"] = new byte[_memoryDomains["MD CART"]!.Size];
cdl["68K RAM"] = new byte[_memoryDomains["68K RAM"]!.Size];
cdl["Z80 RAM"] = new byte[_memoryDomains["Z80 RAM"]!.Size];
if (_memoryDomains.Has("SRAM"))
cdl["SRAM"] = new byte[_memoryDomains["SRAM"].Size];
var found = _memoryDomains["SRAM"];
if (found is not null) cdl["SRAM"] = new byte[found.Size];
cdl.SubType = "GEN";
cdl.SubVer = 0;