N64 - Expose the setting of core type (pure interpreter, interpreter, dynarec) through sync settings. Still todo: UI for setting this value

This commit is contained in:
adelikat 2014-05-10 16:05:56 +00:00
parent 1f4585cd17
commit 3e843b2b0f
3 changed files with 21 additions and 2 deletions

View File

@ -420,12 +420,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
StartThreadLoop();
var videosettings = this.SyncSettings.GetVPS(game);
var coreType = this.SyncSettings.CoreType;
//zero 19-apr-2014 - added this to solve problem with SDL initialization corrupting the main thread (I think) and breaking subsequent emulators (for example, NES)
//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);
api = new mupen64plusApi(this, rom, videosettings, SaveType, (int)coreType);
});
// Order is important because the register with the mupen core

View File

@ -8,6 +8,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64
{
public class N64SyncSettings
{
public CORETYPE CoreType = CORETYPE.Dynarec;
public enum CORETYPE
{
[Description("Pure Interpreter")]
Pure_Interpret = 0,
[Description("Interpreter")]
Interpret = 1,
[Description("DynaRec")]
Dynarec = 2,
}
public PLUGINTYPE VidPlugin = PLUGINTYPE.RICE;
public int VideoSizeX = 320;
public int VideoSizeY = 240;

View File

@ -337,7 +337,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
// DLL handles
public IntPtr CoreDll { get; private set; }
public mupen64plusApi(N64 bizhawkCore, byte[] rom, VideoPluginSettings video_settings, int SaveType)
public mupen64plusApi(N64 bizhawkCore, byte[] rom, VideoPluginSettings video_settings, int SaveType, int CoreType)
{
// There can only be one core (otherwise breaks mupen64plus)
if (AttachedCore != null)
@ -365,6 +365,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi
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);
// Pass the rom to the core
result = m64pCoreDoCommandByteArray(m64p_command.M64CMD_ROM_OPEN, rom.Length, rom);