From aa708992e93b35d936035d8956cc679c18f32392 Mon Sep 17 00:00:00 2001 From: YoshiRulz Date: Sat, 16 Jul 2022 16:25:51 +1000 Subject: [PATCH] Use nicer error message for starting MAME in non-MAME build --- src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs index 43bf2fec2b..9f976ab32e 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs @@ -88,7 +88,14 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME { public MAME(string dir, string file, MAME.MAMESyncSettings syncSettings, out string gamename) { - OSTailoredCode.LinkedLibManager.FreeByPtr(OSTailoredCode.LinkedLibManager.LoadOrThrow(LibMAME.dll)); // don't bother if the library is missing + try + { + OSTailoredCode.LinkedLibManager.FreeByPtr(OSTailoredCode.LinkedLibManager.LoadOrThrow(LibMAME.dll)); + } + catch (Exception e) + { + throw new Exception("failed to load MAME core library (is this actually a MAME build of BizHawk?)", e); + } _gameDirectory = dir; _gameFileName = file;