From 5c2e6d35c3477860a52d23477747c1a95f1c8c1e Mon Sep 17 00:00:00 2001 From: feos Date: Mon, 4 May 2020 10:53:29 +0300 Subject: [PATCH] mame: finally make mem reading work with frame advance proof that it's a good idea to go to bed with a problem, because your brain keeps solving it while you're sleeping. so when you wake up, it presents you the solution that actually works. --- src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs index 37de8241b0..6696a19709 100644 --- a/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs +++ b/src/BizHawk.Emulation.Cores/Arcades/MAME/MAME.cs @@ -155,6 +155,11 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME _paused = false; _frameDone = false; + if (_memAccess) + { + _mamePeriodicComplete.WaitOne(); + } + for (; _frameDone == false;) { _mameFrameComplete.WaitOne(); @@ -638,7 +643,7 @@ namespace BizHawk.Emulation.Cores.Arcades.MAME if (!_frameDone && !_paused) { _memAccess = false; - break; + return; } }