hook up mGBA bios
This commit is contained in:
parent
6d5d720d55
commit
43c7483ef6
|
@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||||
public static extern void BizDestroy(IntPtr ctx);
|
public static extern void BizDestroy(IntPtr ctx);
|
||||||
|
|
||||||
[DllImport(dll, CallingConvention = cc)]
|
[DllImport(dll, CallingConvention = cc)]
|
||||||
public static extern IntPtr BizCreate();
|
public static extern IntPtr BizCreate(byte[] bios);
|
||||||
|
|
||||||
[DllImport(dll, CallingConvention = cc)]
|
[DllImport(dll, CallingConvention = cc)]
|
||||||
public static extern void BizReset(IntPtr ctx);
|
public static extern void BizReset(IntPtr ctx);
|
||||||
|
|
|
@ -21,14 +21,26 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
||||||
ServiceProvider = ser;
|
ServiceProvider = ser;
|
||||||
CoreComm = comm;
|
CoreComm = comm;
|
||||||
|
|
||||||
core = LibmGBA.BizCreate();
|
byte[] bios = null;
|
||||||
|
if (true) // TODO: config me
|
||||||
|
{
|
||||||
|
bios = comm.CoreFileProvider.GetFirmware("GBA", "Bios", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bios != null && bios.Length != 16384)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("BIOS must be exactly 16384 bytes!");
|
||||||
|
}
|
||||||
|
core = LibmGBA.BizCreate(bios);
|
||||||
if (core == IntPtr.Zero)
|
if (core == IntPtr.Zero)
|
||||||
throw new InvalidOperationException("BizCreate() returned NULL!");
|
{
|
||||||
|
throw new InvalidOperationException("BizCreate() returned NULL! Bad BIOS?");
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!LibmGBA.BizLoad(core, file, file.Length))
|
if (!LibmGBA.BizLoad(core, file, file.Length))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("BizLoad() returned FALSE!");
|
throw new InvalidOperationException("BizLoad() returned FALSE! Bad ROM?");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue