N64: Implement the video plugin (rice or glide64) option

This commit is contained in:
pjgat09 2013-05-07 01:38:12 +00:00
parent 8c16b78849
commit 08f6fdaf8d
3 changed files with 20 additions and 6 deletions

View File

@ -190,13 +190,13 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64
mupen64plusApi api; mupen64plusApi api;
public N64(CoreComm comm, GameInfo game, byte[] rom, int vidX, int vidY) public N64(CoreComm comm, GameInfo game, byte[] rom, int vidX, int vidY, string PluginName)
{ {
CoreComm = comm; CoreComm = comm;
this.rom = rom; this.rom = rom;
this.game = game; this.game = game;
api = new mupen64plusApi(this, rom, vidX, vidY); api = new mupen64plusApi(this, rom, vidX, vidY, PluginName);
MemoryDomains = new List<MemoryDomain>(); MemoryDomains = new List<MemoryDomain>();
MemoryDomains.Add(new MemoryDomain("RDRAM", 0x400000, Endian.Little, api.getRDRAMByte, api.setRDRAMByte)); MemoryDomains.Add(new MemoryDomain("RDRAM", 0x400000, Endian.Little, api.getRDRAMByte, api.setRDRAMByte));

View File

@ -371,7 +371,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64
IntPtr AudDll; IntPtr AudDll;
IntPtr InpDll; IntPtr InpDll;
public mupen64plusApi(N64 bizhawkCore, byte[] rom, int vidX, int vidY) public mupen64plusApi(N64 bizhawkCore, byte[] rom, int vidX, int vidY, string PluginName)
{ {
if (AttachedCore != null) if (AttachedCore != null)
{ {
@ -381,13 +381,27 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64
this.bizhawkCore = bizhawkCore; this.bizhawkCore = bizhawkCore;
string VidDllName;
if (PluginName == "Rice")
{
VidDllName = "mupen64plus-video-rice.dll";
}
else if (PluginName == "Glide64")
{
VidDllName = "mupen64plus-video-glide64.dll";
}
else
{
throw new InvalidOperationException(string.Format("Unknown plugin \"" + PluginName));
}
// Load each of the DLLs // Load each of the DLLs
CoreDll = LoadLibrary("mupen64plus.dll"); CoreDll = LoadLibrary("mupen64plus.dll");
if (CoreDll == IntPtr.Zero) if (CoreDll == IntPtr.Zero)
throw new InvalidOperationException(string.Format("Failed to load mupen64plus.dll")); throw new InvalidOperationException(string.Format("Failed to load mupen64plus.dll"));
GfxDll = LoadLibrary("mupen64plus-video-glide64.dll"); GfxDll = LoadLibrary(VidDllName);
if (GfxDll == IntPtr.Zero) if (GfxDll == IntPtr.Zero)
throw new InvalidOperationException(string.Format("Failed to load mupen64plus-video-glide64.dll")); throw new InvalidOperationException(string.Format("Failed to load " + VidDllName));
RspDll = LoadLibrary("mupen64plus-rsp-hle.dll"); RspDll = LoadLibrary("mupen64plus-rsp-hle.dll");
if (RspDll == IntPtr.Zero) if (RspDll == IntPtr.Zero)
throw new InvalidOperationException(string.Format("Failed to load mupen64plus-rsp-hle.dll")); throw new InvalidOperationException(string.Format("Failed to load mupen64plus-rsp-hle.dll"));

View File

@ -2455,7 +2455,7 @@ namespace BizHawk.MultiClient
case "N64": case "N64":
if (INTERIM) if (INTERIM)
{ {
nextEmulator = new N64(nextComm, game, rom.RomData, Global.Config.N64VideoSizeX, Global.Config.N64VideoSizeY); nextEmulator = new N64(nextComm, game, rom.RomData, Global.Config.N64VideoSizeX, Global.Config.N64VideoSizeY, Global.Config.N64VidPlugin);
} }
break; break;
} }