From 8cb9a28620063f3b54076e2e1c0999de670662b4 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Thu, 23 Oct 2025 10:39:33 +0800 Subject: [PATCH] =?UTF-8?q?MAME:=E8=B7=B3=E8=BF=87=E6=97=A7=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E5=A4=9A=E7=BA=BF=E7=A8=8B=E5=81=9A=E6=B3=95=E6=89=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E7=9A=84Thread.Sleep()=EF=BC=8C=E5=B7=B2?= =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=EF=BC=8C=E8=8A=82=E7=9C=81=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Plugins/Mame.Core/MAMEEmu.cs | 15 +++++++++++---- .../Plugins/Mame.Core/Motion/MameMainMotion.cs | 11 +++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs index 6e252a02..9e1daef0 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/MAMEEmu.cs @@ -68,22 +68,29 @@ namespace MAME.Core while(bNeedPreheat) UpdateFrame(); Mame.paused = true; - Thread.Sleep(20); + if(mameMainMotion.bIsNewThreadMode) + Thread.Sleep(20); Mame.soft_reset();//软重启一次,确保没有脏数据 State.loadstate_callback(sr); Mame.postload(); Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; mameMainMotion.ResetFreameIndex(); - Thread.Sleep(20); + if (mameMainMotion.bIsNewThreadMode) + Thread.Sleep(20); Mame.paused = false; } public void SaveState(System.IO.BinaryWriter sw) { Mame.paused = true; - Thread.Sleep(20); + + if (mameMainMotion.bIsNewThreadMode) + Thread.Sleep(20); State.savestate_callback(sw); - Thread.Sleep(20); + + if (mameMainMotion.bIsNewThreadMode) + Thread.Sleep(20); + Mame.paused = false; } diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs index 0b02e767..6d684f4a 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/Motion/MameMainMotion.cs @@ -289,16 +289,19 @@ namespace MAME.Core if (Machine.bRom) { Mame.exit_pending = true; - Thread.Sleep(50); + if (bIsNewThreadMode) + Thread.Sleep(50); } } public void ResetFreameIndex() { Mame.paused = true; - Thread.Sleep(20); + if (bIsNewThreadMode) + Thread.Sleep(20); Video.screenstate.frame_number = 0; - Thread.Sleep(20); + if (bIsNewThreadMode) + Thread.Sleep(20); Mame.paused = false; } @@ -596,7 +599,7 @@ namespace MAME.Core int TempWidth = 0; int TempHeight = 0; - private bool bIsNewThreadMode; + public bool bIsNewThreadMode; private void ResizeMain() {