refactor CoreComm usage in more cores

This commit is contained in:
adelikat 2020-03-15 09:22:58 -05:00
parent 8833ce61c4
commit 5886416cbf
10 changed files with 8 additions and 29 deletions

View File

@ -190,8 +190,6 @@ namespace BizHawk.Emulation.Cores.ColecoVision
_isLag = false;
}
public CoreComm CoreComm { get; }
public void Dispose()
{
}

View File

@ -17,9 +17,8 @@ namespace BizHawk.Emulation.Cores.ColecoVision
{
var ser = new BasicServiceProvider(this);
ServiceProvider = ser;
CoreComm = comm;
_syncSettings = (ColecoSyncSettings)syncSettings ?? new ColecoSyncSettings();
bool skipbios = _syncSettings.SkipBiosIntro;
bool skipBios = _syncSettings.SkipBiosIntro;
_cpu = new Z80A
{
@ -42,12 +41,12 @@ namespace BizHawk.Emulation.Cores.ColecoVision
ser.Register<IStatable>(new StateSerializer(SyncState));
// TODO: hack to allow bios-less operation would be nice, no idea if its feasible
_biosRom = CoreComm.CoreFileProvider.GetFirmware("Coleco", "Bios", true, "Coleco BIOS file is required.");
_biosRom = comm.CoreFileProvider.GetFirmware("Coleco", "Bios", true, "Coleco BIOS file is required.");
// gamedb can overwrite the syncsettings; this is ok
// gamedb can overwrite the SyncSettings; this is ok
if (game["NoSkip"])
{
skipbios = false;
skipBios = false;
}
use_SGM = _syncSettings.UseSGM;
@ -57,7 +56,7 @@ namespace BizHawk.Emulation.Cores.ColecoVision
Console.WriteLine("Using the Super Game Module");
}
LoadRom(rom, skipbios);
LoadRom(rom, skipBios);
SetupMemoryDomains();
_tracer.Header = _cpu.TraceHeader;

View File

@ -65,8 +65,6 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
public int Frame => _frame;
public CoreComm CoreComm { get; }
public void Dispose()
{
}

View File

@ -15,7 +15,6 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF
{
var ser = new BasicServiceProvider(this);
ServiceProvider = ser;
CoreComm = comm;
MemoryCallbacks = new MemoryCallbackSystem(new[] { "System Bus" });
ControllerDefinition = ChannelFControllerDefinition;

View File

@ -109,8 +109,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
_islag = false;
}
public CoreComm CoreComm { get; }
public void Dispose()
{
audio.DisposeSound();

View File

@ -17,7 +17,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
{
public byte[] RAM = new byte[0x400];
public byte[] _bios, minestorm;
public readonly byte[] _rom;
@ -50,8 +49,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex
ppu = new PPU();
serialport = new SerialPort();
CoreComm = comm;
_settings = (VectrexSettings)settings ?? new VectrexSettings();
_syncSettings = (VectrexSyncSettings)syncSettings ?? new VectrexSyncSettings();
_controllerDeck = new VectrexHawkControllerDeck(_syncSettings.Port1, _syncSettings.Port2);

View File

@ -140,8 +140,6 @@ namespace BizHawk.Emulation.Cores.Intellivision
_lagCount = 0;
}
public CoreComm CoreComm { get; }
public void Dispose()
{
}

View File

@ -19,11 +19,7 @@ namespace BizHawk.Emulation.Cores.Intellivision
{
var ser = new BasicServiceProvider(this);
ServiceProvider = ser;
CoreComm = comm;
_rom = rom;
_settings = (IntvSettings)settings ?? new IntvSettings();
_syncSettings = (IntvSyncSettings)syncSettings ?? new IntvSyncSettings();
@ -63,8 +59,8 @@ namespace BizHawk.Emulation.Cores.Intellivision
Connect();
LoadExecutiveRom(CoreComm.CoreFileProvider.GetFirmware("INTV", "EROM", true, "Executive ROM is required."));
LoadGraphicsRom(CoreComm.CoreFileProvider.GetFirmware("INTV", "GROM", true, "Graphics ROM is required."));
LoadExecutiveRom(comm.CoreFileProvider.GetFirmware("INTV", "EROM", true, "Executive ROM is required."));
LoadGraphicsRom(comm.CoreFileProvider.GetFirmware("INTV", "GROM", true, "Graphics ROM is required."));
_tracer = new TraceBuffer { Header = _cpu.TraceHeader };
ser.Register<ITraceable>(_tracer);

View File

@ -164,8 +164,6 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
_islag = false;
}
public CoreComm CoreComm { get; }
public void Dispose()
{
ppu.DisposeSound();

View File

@ -23,7 +23,7 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
public ushort rom_bank;
public byte[] _bios;
public readonly byte[] _rom;
public readonly byte[] _rom;
public readonly byte[] header = new byte[0x50];
public byte[] cart_RAM;
@ -57,8 +57,6 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk
serialport = new SerialPort();
CoreComm = comm;
_settings = (O2Settings)settings ?? new O2Settings();
_syncSettings = (O2SyncSettings)syncSettings ?? new O2SyncSettings();
_controllerDeck = new O2HawkControllerDeck("O2 Controller", "O2 Controller");