change some cores to use filedata instead of romdata. NES handles headers internally, and others shouldn't ever have headers.
This commit is contained in:
parent
2c8295ba76
commit
184b4dcba9
|
@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
public IController Controller { get; set; }
|
||||
|
||||
[CoreConstructor("GBA")]
|
||||
public GBA(CoreComm comm, byte[] rom)
|
||||
public GBA(CoreComm comm, byte[] file)
|
||||
{
|
||||
CoreComm = comm;
|
||||
comm.VsyncNum = 262144;
|
||||
|
@ -58,12 +58,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
|
||||
if (bios.Length != 16384)
|
||||
throw new InvalidDataException("GBA bios must be exactly 16384 bytes!");
|
||||
if (rom.Length > 32 * 1024 * 1024)
|
||||
if (file.Length > 32 * 1024 * 1024)
|
||||
throw new InvalidDataException("Rom file is too big! No GBA game is larger than 32MB");
|
||||
Init();
|
||||
LibMeteor.libmeteor_hardreset();
|
||||
LibMeteor.libmeteor_loadbios(bios, (uint)bios.Length);
|
||||
LibMeteor.libmeteor_loadrom(rom, (uint)rom.Length);
|
||||
LibMeteor.libmeteor_loadrom(file, (uint)file.Length);
|
||||
|
||||
SetUpMemoryDomains();
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
IntPtr Core;
|
||||
|
||||
[CoreConstructor("GBA")]
|
||||
public VBANext(byte[] rom, CoreComm comm, GameInfo game, bool deterministic, object syncsettings)
|
||||
public VBANext(byte[] file, CoreComm comm, GameInfo game, bool deterministic, object syncsettings)
|
||||
{
|
||||
CoreComm = comm;
|
||||
byte[] biosfile = CoreComm.CoreFileProvider.GetFirmware("GBA", "Bios", true, "GBA bios file is mandatory.");
|
||||
|
||||
if (rom.Length > 32 * 1024 * 1024)
|
||||
if (file.Length > 32 * 1024 * 1024)
|
||||
throw new ArgumentException("ROM is too big to be a GBA ROM!");
|
||||
if (biosfile.Length != 16 * 1024)
|
||||
throw new ArgumentException("BIOS file is not exactly 16K!");
|
||||
|
@ -61,7 +61,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
throw new InvalidOperationException("Create() returned nullptr!");
|
||||
try
|
||||
{
|
||||
if (!LibVBANext.LoadRom(Core, rom, (uint)rom.Length, biosfile, (uint)biosfile.Length, FES))
|
||||
if (!LibVBANext.LoadRom(Core, file, (uint)file.Length, biosfile, (uint)biosfile.Length, FES))
|
||||
throw new InvalidOperationException("LoadRom() returned false!");
|
||||
|
||||
CoreComm.VsyncNum = 262144;
|
||||
|
@ -69,7 +69,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.GBA
|
|||
CoreComm.NominalWidth = 240;
|
||||
CoreComm.NominalHeight = 160;
|
||||
|
||||
GameCode = Encoding.ASCII.GetString(rom, 0xac, 4);
|
||||
GameCode = Encoding.ASCII.GetString(file, 0xac, 4);
|
||||
Console.WriteLine("Game code \"{0}\"", GameCode);
|
||||
|
||||
savebuff = new byte[LibVBANext.BinStateSize(Core)];
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
#endregion
|
||||
|
||||
[CoreConstructor("GB", "GBC")]
|
||||
public Gameboy(CoreComm comm, GameInfo game, byte[] rom, object Settings, object SyncSettings, bool deterministic)
|
||||
public Gameboy(CoreComm comm, GameInfo game, byte[] file, object Settings, object SyncSettings, bool deterministic)
|
||||
{
|
||||
CoreComm = comm;
|
||||
|
||||
|
@ -133,8 +133,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
comm.NominalWidth = 160;
|
||||
comm.NominalHeight = 144;
|
||||
|
||||
ThrowExceptionForBadRom(rom);
|
||||
BoardName = MapperName(rom);
|
||||
ThrowExceptionForBadRom(file);
|
||||
BoardName = MapperName(file);
|
||||
|
||||
DeterministicEmulation = deterministic;
|
||||
|
||||
|
@ -159,7 +159,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
if (this._SyncSettings.MulticartCompat)
|
||||
flags |= LibGambatte.LoadFlags.MULTICART_COMPAT;
|
||||
|
||||
if (LibGambatte.gambatte_load(GambatteState, rom, (uint)rom.Length, GetCurrentTime(), flags) != 0)
|
||||
if (LibGambatte.gambatte_load(GambatteState, file, (uint)file.Length, GetCurrentTime(), flags) != 0)
|
||||
throw new InvalidOperationException("gambatte_load() returned non-zero (is this not a gb or gbc rom?)");
|
||||
|
||||
// set real default colors (before anyone mucks with them at all)
|
||||
|
@ -179,8 +179,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy
|
|||
|
||||
CoreComm.RomStatusDetails = string.Format("{0}\r\nSHA1:{1}\r\nMD5:{2}\r\n",
|
||||
game.Name,
|
||||
rom.HashSHA1(),
|
||||
rom.HashMD5());
|
||||
file.HashSHA1(),
|
||||
file.HashMD5());
|
||||
|
||||
{
|
||||
byte[] buff = new byte[32];
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
|||
}
|
||||
|
||||
[CoreConstructor("NES")]
|
||||
public QuickNES(CoreComm comm, byte[] Rom, object Settings)
|
||||
public QuickNES(CoreComm comm, byte[] file, object Settings)
|
||||
{
|
||||
using (FP.Save())
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES
|
|||
throw new InvalidOperationException("qn_new() returned NULL");
|
||||
try
|
||||
{
|
||||
LibQuickNES.ThrowStringError(LibQuickNES.qn_loadines(Context, Rom, Rom.Length));
|
||||
LibQuickNES.ThrowStringError(LibQuickNES.qn_loadines(Context, file, file.Length));
|
||||
|
||||
InitSaveRamBuff();
|
||||
InitSaveStateBuff();
|
||||
|
|
|
@ -52,8 +52,8 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
|
|||
};
|
||||
|
||||
[CoreConstructor("GEN")]
|
||||
public GPGX(CoreComm comm, byte[] rom, object Settings, object SyncSettings)
|
||||
:this(comm, rom, null, Settings, SyncSettings)
|
||||
public GPGX(CoreComm comm, byte[] file, object Settings, object SyncSettings)
|
||||
:this(comm, file, null, Settings, SyncSettings)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
#endregion
|
||||
|
||||
[CoreConstructor("WSWAN")]
|
||||
public WonderSwan(CoreComm comm, byte[] rom, bool deterministic, object Settings, object SyncSettings)
|
||||
public WonderSwan(CoreComm comm, byte[] file, bool deterministic, object Settings, object SyncSettings)
|
||||
{
|
||||
CoreComm = comm;
|
||||
_Settings = (Settings)Settings ?? new Settings();
|
||||
|
@ -104,7 +104,7 @@ namespace BizHawk.Emulation.Cores.WonderSwan
|
|||
|
||||
bool rotate = false;
|
||||
|
||||
if (!BizSwan.bizswan_load(Core, rom, rom.Length, ref ss, ref rotate))
|
||||
if (!BizSwan.bizswan_load(Core, file, file.Length, ref ss, ref rotate))
|
||||
throw new InvalidOperationException("bizswan_load() returned FALSE!");
|
||||
|
||||
// for future uses of ClearSaveRam(), it's important that we save this
|
||||
|
|
Loading…
Reference in New Issue