Merge pull request #567 from Isotarge/patch-1

Clean up code that applies N64 core settings
This commit is contained in:
adelikat 2016-02-10 18:40:38 -05:00
commit d4f2eae8eb
1 changed files with 5 additions and 7 deletions

View File

@ -394,26 +394,24 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
m64p_error result = m64pCoreStartup(0x20001, "", "", "Core",
null, "", IntPtr.Zero);
// Open the core settings section in the config system
IntPtr core_section = IntPtr.Zero;
m64pConfigOpenSection("Core", ref core_section);
// Set the savetype if needed
if (DisableExpansionSlot)
{
IntPtr core_section = IntPtr.Zero;
int disable = 1;
m64pConfigOpenSection("Core", ref core_section);
m64pConfigSetParameter(core_section, "DisableExtraMem", m64p_type.M64TYPE_INT, ref disable);
}
// Set the savetype if needed
if (SaveType != 0)
{
IntPtr core_section = IntPtr.Zero;
m64pConfigOpenSection("Core", ref core_section);
m64pConfigSetParameter(core_section, "SaveType", m64p_type.M64TYPE_INT, ref SaveType);
}
IntPtr coreSection = IntPtr.Zero;
m64pConfigOpenSection("Core", ref coreSection);
m64pConfigSetParameter(coreSection, "R4300Emulator", m64p_type.M64TYPE_INT, ref CoreType);
m64pConfigSetParameter(core_section, "R4300Emulator", m64p_type.M64TYPE_INT, ref CoreType);
// Pass the rom to the core
result = m64pCoreDoCommandByteArray(m64p_command.M64CMD_ROM_OPEN, rom.Length, rom);