Compare commits

...

2 Commits

3 changed files with 12 additions and 5 deletions

View File

@ -42,10 +42,18 @@ namespace MAME.Core
public bool IsPaused => Mame.paused; public bool IsPaused => Mame.paused;
public void LoadState(System.IO.BinaryReader sr) public void LoadState(System.IO.BinaryReader sr)
{ {
//热机逻辑主要解决NEOGEO问题避免加入其他人房间自动联机时加载流程cpu一次都没执行部分逻辑没有初始化。
//再加载数据之前,推若干帧,确保所有组件充分初始化
for (int i = 0; i < 5; i++)
{
UpdateFrame();
}
Mame.paused = true; Mame.paused = true;
Thread.Sleep(20); Thread.Sleep(20);
State.loadstate_callback.Invoke(sr); Mame.soft_reset();//软重启一次,确保没有脏数据
State.loadstate_callback(sr);
Mame.postload(); Mame.postload();
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
mameMainMotion.ResetFreameIndex(); mameMainMotion.ResetFreameIndex();
Thread.Sleep(20); Thread.Sleep(20);
Mame.paused = false; Mame.paused = false;
@ -55,7 +63,7 @@ namespace MAME.Core
{ {
Mame.paused = true; Mame.paused = true;
Thread.Sleep(20); Thread.Sleep(20);
State.savestate_callback.Invoke(sw); State.savestate_callback(sw);
Thread.Sleep(20); Thread.Sleep(20);
Mame.paused = false; Mame.paused = false;
} }

View File

@ -119,8 +119,8 @@ namespace MAME.Core
//} //}
//这是一个Monkey Patch 这里一维数组是0~2二位数组可能不正常 //这是一个Monkey Patch 这里一维数组是0~2二位数组可能不正常
int maxcount = Math.Min(streamoutput[i].Length, max_samples_per_update); max_samples_per_update = Math.Min(max_samples_per_update, streamoutput[i].Length - samples_to_lose);
for (j = 0; j < maxcount; j++) for (j = 0; j < max_samples_per_update; j++)
{ {
streamoutput[i][j] = streamoutput[i][samples_to_lose + j]; streamoutput[i][j] = streamoutput[i][samples_to_lose + j];
} }

View File

@ -9,7 +9,6 @@ using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using static AxibugEmuOnline.Client.HttpAPI; using static AxibugEmuOnline.Client.HttpAPI;
using static AxibugEmuOnline.Client.Manager.LogManager; using static AxibugEmuOnline.Client.Manager.LogManager;
using static AxibugEmuOnline.Client.SaveFile;
namespace AxibugEmuOnline.Client.ClientCore namespace AxibugEmuOnline.Client.ClientCore
{ {