diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs index c3bc246d8f..ce298a3a2b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/N64/NativeAPI/mupen64plusVideoApi.cs @@ -61,10 +61,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi break; case PluginType.Jabo: videoplugin = "mupen64plus-video-jabo.dll"; - - if (File.Exists("dll\\Jabo_Direct3D8_patched.dll")) + + //THIS IS HORRIBLE! PATH MUST BE PASSED IN SOME OTHER WAY + string dllDir = Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "dll"); + string rawPath = Path.Combine(dllDir, "Jabo_Direct3D8.dll"); + string patchedPath = Path.Combine(dllDir, "Jabo_Direct3D8_patched.dll"); + + if (File.Exists(patchedPath)) { - byte[] hash = MD5.Create().ComputeHash(File.ReadAllBytes("dll\\Jabo_Direct3D8_patched.dll")); + byte[] hash = MD5.Create().ComputeHash(File.ReadAllBytes(patchedPath)); string hash_string = BitConverter.ToString(hash).Replace("-", ""); if (hash_string == "F4D6E624489CD88C68A5850426D4D70E") { @@ -72,13 +77,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi } } - if (!jaboReady && File.Exists("dll\\Jabo_Direct3D8.dll")) + if (!jaboReady && File.Exists(rawPath)) { - byte[] hash = MD5.Create().ComputeHash(File.ReadAllBytes("dll\\Jabo_Direct3D8.dll")); + byte[] hash = MD5.Create().ComputeHash(File.ReadAllBytes(rawPath)); string hash_string = BitConverter.ToString(hash).Replace("-", ""); if (hash_string == "4F353AA71E7455B81205D8EC0AA339E1") { - byte[] jaboDLL = File.ReadAllBytes("dll\\Jabo_Direct3D8.dll"); + byte[] jaboDLL = File.ReadAllBytes(rawPath); jaboDLL[583] = 0xA0; jaboDLL[623] = 0xA0; jaboDLL[663] = 0xA0; @@ -87,7 +92,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.N64.NativeApi jaboDLL[783] = 0xA0; jaboDLL[823] = 0xA0; jaboDLL[863] = 0xA0; - File.WriteAllBytes("dll\\Jabo_Direct3D8_patched.dll", jaboDLL); + File.WriteAllBytes(patchedPath, jaboDLL); jaboReady = true; } }