From 7f4cb4fe51853d355e8142f62360df0bf3432032 Mon Sep 17 00:00:00 2001 From: feos Date: Mon, 23 Dec 2019 19:11:10 +0300 Subject: [PATCH] try a string instead --- BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs b/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs index c86916b6ac..7e57405914 100644 --- a/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs +++ b/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs @@ -36,8 +36,13 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME _syncSettings.ExpandoSettings = new ExpandoObject(); var dynamicObject = (IDictionary)_syncSettings.ExpandoSettings; dynamicObject.Add("OKAY", 1); - gamename = _gameName; + + if (_loadFailure != "") + { + Dispose(); + throw new Exception(_loadFailure); + } } #region Properties @@ -73,18 +78,19 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME private IController Controller = NullController.Instance; private IMemoryDomains _memoryDomains; private int systemBusAddressShift = 0; + private bool memAccess = false; private int[] frameBuffer = new int[0]; private Queue audioSamples = new Queue(); private decimal dAudioSamples = 0; private int sampleRate = 44100; + private int numSamples = 0; private bool paused = true; private bool exiting = false; private bool frameDone = true; - private bool memAccess = false; - private int numSamples = 0; private string gameDirectory; private string gameFilename; private string _gameName = "Arcade"; + private string _loadFailure = ""; private LibMAME.PeriodicCallbackDelegate periodicCallback; private LibMAME.SoundCallbackDelegate soundCallback; private LibMAME.BootCallbackDelegate bootCallback; @@ -558,7 +564,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME if (data.Contains("NOT FOUND")) { MAMEStartupComplete.Set(); - throw new Exception(data); + _loadFailure = data; } // mame sends osd_output_channel casted to int, we implicitly cast it back