Fix bug with core inventory launching n64 core with data that romgame had mangled in cases. todo: delete romgame.

This commit is contained in:
zeromus 2014-09-12 01:02:09 +00:00
parent c36667ddb5
commit 2c8295ba76
3 changed files with 6 additions and 4 deletions

View File

@ -409,7 +409,7 @@ namespace BizHawk.Client.Common
if (core != null)
{
// use coreinventory
nextEmulator = core.Create(nextComm, game, rom.RomData, Deterministic, GetCoreSettings(core.Type), GetCoreSyncSettings(core.Type));
nextEmulator = core.Create(nextComm, game, rom.RomData, rom.FileData, Deterministic, GetCoreSettings(core.Type), GetCoreSyncSettings(core.Type));
}
}

View File

@ -45,7 +45,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
/// <param name="rom">Rom that should be loaded</param>
/// <param name="syncSettings">N64SyncSettings object</param>
[CoreConstructor("N64")]
public N64(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings)
public N64(CoreComm comm, GameInfo game, byte[] file, object settings, object syncSettings)
{
int SaveType = 0;
if (game.OptionValue("SaveType") == "EEPROM_16K")
@ -64,7 +64,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
_syncSettings.DisableExpansionSlot = false;
}
byte country_code = rom[0x3E];
byte country_code = file[0x3E];
switch (country_code)
{
// PAL codes
@ -109,7 +109,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
//not sure why this works... if we put the plugin initializations in here, we get deadlocks in some SDL initialization. doesnt make sense to me...
RunThreadAction(() =>
{
api = new mupen64plusApi(this, rom, videosettings, SaveType, (int)coreType, _syncSettings.DisableExpansionSlot);
api = new mupen64plusApi(this, file, videosettings, SaveType, (int)coreType, _syncSettings.DisableExpansionSlot);
});
// Order is important because the register with the mupen core

View File

@ -73,6 +73,7 @@ namespace BizHawk.Emulation.Cores
CoreComm comm,
GameInfo game,
byte[] rom,
byte[] file,
bool deterministic,
object settings,
object syncsettings
@ -82,6 +83,7 @@ namespace BizHawk.Emulation.Cores
bp(o, "comm", comm);
bp(o, "game", game);
bp(o, "rom", rom);
bp(o, "file", file);
bp(o, "deterministic", deterministic);
bp(o, "settings", settings);
bp(o, "syncsettings", syncsettings);