From 5886416cbff0274b2caf9722f64acaa29a5db83f Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 15 Mar 2020 09:22:58 -0500 Subject: [PATCH] refactor CoreComm usage in more cores --- .../Consoles/Coleco/ColecoVision.IEmulator.cs | 2 -- .../Consoles/Coleco/ColecoVision.cs | 11 +++++------ .../Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs | 2 -- .../Consoles/Fairchild/ChannelF/ChannelF.cs | 1 - .../Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs | 2 -- .../Consoles/GCE/Vectrex/VectrexHawk.cs | 3 --- .../Consoles/Intellivision/Intellivision.IEmulator.cs | 2 -- .../Consoles/Intellivision/Intellivision.cs | 8 ++------ .../Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs | 2 -- .../Consoles/Magnavox/Odyssey2/O2Hawk.cs | 4 +--- 10 files changed, 8 insertions(+), 29 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs index a2bcdd88bf..6664e6122c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.IEmulator.cs @@ -190,8 +190,6 @@ namespace BizHawk.Emulation.Cores.ColecoVision _isLag = false; } - public CoreComm CoreComm { get; } - public void Dispose() { } diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index adfd687de1..d90e821754 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -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(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; diff --git a/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs index be9914449e..bc16814320 100644 --- a/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.IEmulator.cs @@ -65,8 +65,6 @@ namespace BizHawk.Emulation.Cores.Consoles.ChannelF public int Frame => _frame; - public CoreComm CoreComm { get; } - public void Dispose() { } diff --git a/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs b/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs index 3710eb0ad8..6172cc5fbf 100644 --- a/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs +++ b/BizHawk.Emulation.Cores/Consoles/Fairchild/ChannelF/ChannelF.cs @@ -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; diff --git a/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs index ef2a359454..f3d38d2222 100644 --- a/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.IEmulator.cs @@ -109,8 +109,6 @@ namespace BizHawk.Emulation.Cores.Consoles.Vectrex _islag = false; } - public CoreComm CoreComm { get; } - public void Dispose() { audio.DisposeSound(); diff --git a/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs b/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs index 778496181d..2765f0bbfc 100644 --- a/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/GCE/Vectrex/VectrexHawk.cs @@ -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); diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs index c25aedc167..3b332b7ec9 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.IEmulator.cs @@ -140,8 +140,6 @@ namespace BizHawk.Emulation.Cores.Intellivision _lagCount = 0; } - public CoreComm CoreComm { get; } - public void Dispose() { } diff --git a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs index 54daa229fe..6b6a5e5944 100644 --- a/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Intellivision/Intellivision.cs @@ -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(_tracer); diff --git a/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs b/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs index 06501baae3..fcef335386 100644 --- a/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs +++ b/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.IEmulator.cs @@ -164,8 +164,6 @@ namespace BizHawk.Emulation.Cores.Consoles.O2Hawk _islag = false; } - public CoreComm CoreComm { get; } - public void Dispose() { ppu.DisposeSound(); diff --git a/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs b/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs index 411bdce87e..f205d99d42 100644 --- a/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs +++ b/BizHawk.Emulation.Cores/Consoles/Magnavox/Odyssey2/O2Hawk.cs @@ -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");