From 697fb8f63b80283da422bad01136682b82315c3e Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Wed, 28 Aug 2024 16:15:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E8=A3=85=E5=8D=B3=E6=97=B6=E5=AD=98?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MAME.Core/MAMEEmu.cs | 24 +++++++++++++++++++ MAME.Core/Motion/MameMainMotion.cs | 2 +- .../PublishProfiles/FolderProfile.pubxml.user | 2 +- MAME.Core/emu/Machine.cs | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/MAME.Core/MAMEEmu.cs b/MAME.Core/MAMEEmu.cs index c7139cf..57b91cd 100644 --- a/MAME.Core/MAMEEmu.cs +++ b/MAME.Core/MAMEEmu.cs @@ -1,11 +1,16 @@ using System; using System.Collections.Generic; +using System.IO; +using System.Threading; namespace MAME.Core { public class MAMEEmu : IDisposable { MameMainMotion mameMainMotion; + + //byte[] mGameTileData; + //byte[] mtileListData; public MAMEEmu() { mameMainMotion = new MameMainMotion(); @@ -28,6 +33,25 @@ namespace MAME.Core public void StartGame() => mameMainMotion.StartGame(); public void StopGame() => mameMainMotion.StopGame(); + public void LoadState(BinaryReader sr) + { + Mame.paused = true; + Thread.Sleep(20); + State.loadstate_callback.Invoke(sr); + Mame.postload(); + Thread.Sleep(20); + Mame.paused = false; + } + + public void SaveState(BinaryWriter sw) + { + Mame.paused = true; + Thread.Sleep(20); + State.savestate_callback.Invoke(sw); + Thread.Sleep(20); + Mame.paused = false; + } + public void Dispose() { mameMainMotion.StopGame(); diff --git a/MAME.Core/Motion/MameMainMotion.cs b/MAME.Core/Motion/MameMainMotion.cs index 6d180ae..499cba8 100644 --- a/MAME.Core/Motion/MameMainMotion.cs +++ b/MAME.Core/Motion/MameMainMotion.cs @@ -238,7 +238,7 @@ namespace MAME.Core if (Machine.bRom) { Mame.exit_pending = true; - Thread.Sleep(100); + Thread.Sleep(50); } } diff --git a/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user b/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user index 521b6aa..78cdec2 100644 --- a/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user +++ b/MAME.Core/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. --> - True|2024-08-28T04:54:14.9742502Z||;True|2024-08-28T12:09:37.5280942+08:00||;True|2024-08-28T12:07:03.6717540+08:00||;True|2024-08-07T18:02:59.4096796+08:00||;False|2024-08-07T18:02:44.0239078+08:00||;True|2024-07-31T17:00:23.0585720+08:00||;True|2024-07-31T17:00:19.8123170+08:00||;True|2024-07-30T20:51:40.9773933+08:00||;True|2024-07-30T17:04:12.3440051+08:00||;True|2024-07-30T17:01:28.0849009+08:00||;True|2024-07-30T10:36:57.5301145+08:00||; + True|2024-08-28T08:12:23.3416224Z||;True|2024-08-28T13:18:21.7983285+08:00||;True|2024-08-28T12:54:14.9742502+08:00||;True|2024-08-28T12:09:37.5280942+08:00||;True|2024-08-28T12:07:03.6717540+08:00||;True|2024-08-07T18:02:59.4096796+08:00||;False|2024-08-07T18:02:44.0239078+08:00||;True|2024-07-31T17:00:23.0585720+08:00||;True|2024-07-31T17:00:19.8123170+08:00||;True|2024-07-30T20:51:40.9773933+08:00||;True|2024-07-30T17:04:12.3440051+08:00||;True|2024-07-30T17:01:28.0849009+08:00||;True|2024-07-30T10:36:57.5301145+08:00||; \ No newline at end of file diff --git a/MAME.Core/emu/Machine.cs b/MAME.Core/emu/Machine.cs index bc2c1c9..e5bd94a 100644 --- a/MAME.Core/emu/Machine.cs +++ b/MAME.Core/emu/Machine.cs @@ -263,7 +263,7 @@ namespace MAME.Core public static byte[] GetNeogeoRom(string sFile) { byte[] bb1; - string path = System.IO.Path.Combine(Mame.RomRoot + "/" + "roms/neogeo/", sFile); + string path = System.IO.Path.Combine(Mame.RomRoot + "/neogeo/", sFile); if (File.Exists(path)) { EmuLogger.Log($"Had File => {path}"); @@ -287,7 +287,7 @@ namespace MAME.Core int n1; foreach (string s1 in lsParents) { - string path = System.IO.Path.Combine(Mame.RomRoot + "/" + "roms/" + s1 + "/", sFile); + string path = System.IO.Path.Combine(Mame.RomRoot + "/" + s1 + "/", sFile); if (File.Exists(path)) { EmuLogger.Log($"Had File => {path}");