From fa349542ef7ebe073a77b3605744fffa7b2c74d6 Mon Sep 17 00:00:00 2001 From: pjgat09 Date: Thu, 2 May 2013 22:17:36 +0000 Subject: [PATCH] N64: Added exceptions in the event of a problem loaded one of the dlls --- BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs index 5d68b35909..8fdf14099d 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/N64/N64.cs @@ -380,10 +380,20 @@ namespace BizHawk.Emulation.Consoles.Nintendo.N64 // Load the core DLL and retrieve some function pointers CoreDll = LoadLibrary("mupen64plus.dll"); + if (CoreDll == IntPtr.Zero) + throw new InvalidOperationException(string.Format("Failed to load mupen64plus.dll")); GfxDll = LoadLibrary("mupen64plus-video-rice.dll"); + if (GfxDll == IntPtr.Zero) + throw new InvalidOperationException(string.Format("Failed to load mupen64plus-video-rice.dll")); RspDll = LoadLibrary("mupen64plus-rsp-hle.dll"); + if (RspDll == IntPtr.Zero) + throw new InvalidOperationException(string.Format("Failed to load mupen64plus-rsp-hle.dll")); AudDll = LoadLibrary("mupen64plus-audio-bkm.dll"); + if (AudDll == IntPtr.Zero) + throw new InvalidOperationException(string.Format("Failed to load mupen64plus-audio-bkm.dll")); InpDll = LoadLibrary("mupen64plus-input-bkm.dll"); + if (InpDll == IntPtr.Zero) + throw new InvalidOperationException(string.Format("Failed to load mupen64plus-input-bkm.dll")); m64pCoreStartup = (CoreStartup)Marshal.GetDelegateForFunctionPointer(GetProcAddress(CoreDll, "CoreStartup"), typeof(CoreStartup)); m64pCoreShutdown = (CoreShutdown)Marshal.GetDelegateForFunctionPointer(GetProcAddress(CoreDll, "CoreShutdown"), typeof(CoreShutdown));