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