refactor CoreComm usage in some Gameboy cores
This commit is contained in:
parent
5886416cbf
commit
028bc83c88
|
@ -52,7 +52,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
ser.Register<IMemoryDomains>(_memoryDomains);
|
||||
|
||||
ServiceProvider = ser;
|
||||
CoreComm = comm;
|
||||
PutSettings(_settings);
|
||||
|
||||
_tracer = new TraceBuffer
|
||||
|
@ -149,8 +148,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
IsLagFrame = false;
|
||||
}
|
||||
|
||||
public CoreComm CoreComm { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_core != IntPtr.Zero)
|
||||
|
|
|
@ -19,9 +19,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
ser.Register<IDisassemblable>(new ArmV4Disassembler());
|
||||
ServiceProvider = ser;
|
||||
|
||||
CoreComm = comm;
|
||||
|
||||
byte[] biosfile = CoreComm.CoreFileProvider.GetFirmware("GBA", "Bios", true, "GBA bios file is mandatory.");
|
||||
byte[] biosfile = comm.CoreFileProvider.GetFirmware("GBA", "Bios", true, "GBA bios file is mandatory.");
|
||||
if (file.Length > 32 * 1024 * 1024)
|
||||
throw new ArgumentException("ROM is too big to be a GBA ROM!");
|
||||
if (biosfile.Length != 16 * 1024)
|
||||
|
@ -131,8 +129,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
/// </summary>
|
||||
public string GameCode { get; }
|
||||
|
||||
public CoreComm CoreComm { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (Core != IntPtr.Zero)
|
||||
|
|
|
@ -91,8 +91,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
frameOverflow = 0;
|
||||
}
|
||||
|
||||
public CoreComm CoreComm { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (GambatteState != IntPtr.Zero)
|
||||
|
|
|
@ -34,7 +34,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
};
|
||||
ser.Register<ITraceable>(Tracer);
|
||||
InitMemoryCallbacks();
|
||||
CoreComm = comm;
|
||||
|
||||
ThrowExceptionForBadRom(file);
|
||||
BoardName = MapperName(file);
|
||||
|
@ -95,6 +94,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
Bios = comm.CoreFileProvider.GetFirmware("GBC", "World", true, "BIOS Not Found, Cannot Load");
|
||||
IsCgb = true;
|
||||
}
|
||||
|
||||
if (LibGambatte.gambatte_loadbios(GambatteState, Bios, (uint)Bios.Length) != 0)
|
||||
{
|
||||
throw new InvalidOperationException($"{nameof(LibGambatte.gambatte_loadbios)}() returned non-zero (bios error)");
|
||||
|
|
|
@ -166,8 +166,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
IsLagFrame = false;
|
||||
}
|
||||
|
||||
public CoreComm CoreComm { get; }
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (!_disposed)
|
||||
|
|
|
@ -17,7 +17,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
GambatteLinkSettings linkSettings = (GambatteLinkSettings)settings ?? new GambatteLinkSettings();
|
||||
GambatteLinkSyncSettings linkSyncSettings = (GambatteLinkSyncSettings)syncSettings ?? new GambatteLinkSyncSettings();
|
||||
|
||||
CoreComm = comm;
|
||||
L = new Gameboy(comm.Clone(), leftinfo, leftrom, linkSettings.L, linkSyncSettings.L, deterministic);
|
||||
R = new Gameboy(comm.Clone(), rightinfo, rightrom, linkSettings.R, linkSyncSettings.R, deterministic);
|
||||
|
||||
|
|
Loading…
Reference in New Issue