IEmuCore从接口修改为抽象类
This commit is contained in:
parent
e5f497a163
commit
902dc95d19
@ -1,4 +1,4 @@
|
|||||||
using AxibugEmuOnline.Client;
|
using AxibugEmuOnline.Client;
|
||||||
using AxibugEmuOnline.Client.ClientCore;
|
using AxibugEmuOnline.Client.ClientCore;
|
||||||
using AxibugProtobuf;
|
using AxibugProtobuf;
|
||||||
using Essgee;
|
using Essgee;
|
||||||
@ -17,19 +17,19 @@ using System.Text;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class UEssgee : MonoBehaviour, IEmuCore
|
public class UEssgee : IEmuCore
|
||||||
{
|
{
|
||||||
public static UEssgee instance;
|
public static UEssgee instance;
|
||||||
public static System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
|
public static System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
|
||||||
public static bool bInGame => instance?.emulatorHandler?.IsRunning == true ? true : false;
|
public static bool bInGame => instance?.emulatorHandler?.IsRunning == true ? true : false;
|
||||||
|
|
||||||
public RomPlatformType Platform => mPlatform;
|
public override RomPlatformType Platform => mPlatform;
|
||||||
|
|
||||||
public uint Frame => (uint)emulatorHandler.AxiEmuRunFrame;
|
public override uint Frame => (uint)emulatorHandler.AxiEmuRunFrame;
|
||||||
|
|
||||||
public Texture OutputPixel => graphicsHandler.rawBufferWarper;
|
public override Texture OutputPixel => graphicsHandler.rawBufferWarper;
|
||||||
|
|
||||||
public RawImage DrawCanvas => graphicsHandler.DrawCanvas;
|
public override RawImage DrawCanvas => graphicsHandler.DrawCanvas;
|
||||||
|
|
||||||
public static bool bLogicUpdatePause { get; private set; }
|
public static bool bLogicUpdatePause { get; private set; }
|
||||||
#region
|
#region
|
||||||
@ -71,38 +71,38 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#region EmuCore接入实现
|
#region EmuCore接入实现
|
||||||
|
|
||||||
public object GetState()
|
public override object GetState()
|
||||||
{
|
{
|
||||||
return emulatorHandler.GetStateData();
|
return emulatorHandler.GetStateData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] GetStateBytes()
|
public override byte[] GetStateBytes()
|
||||||
{
|
{
|
||||||
return emulatorHandler.GetStateData();
|
return emulatorHandler.GetStateData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(object state)
|
public override void LoadState(object state)
|
||||||
{
|
{
|
||||||
emulatorHandler.SetStateData((byte[])state);
|
emulatorHandler.SetStateData((byte[])state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadStateFromBytes(byte[] data)
|
public override void LoadStateFromBytes(byte[] data)
|
||||||
{
|
{
|
||||||
emulatorHandler.SetStateData(data);
|
emulatorHandler.SetStateData(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Pause()
|
public override void Pause()
|
||||||
{
|
{
|
||||||
bLogicUpdatePause = false;
|
bLogicUpdatePause = false;
|
||||||
}
|
}
|
||||||
public void Resume()
|
public override void Resume()
|
||||||
{
|
{
|
||||||
bLogicUpdatePause = true;
|
bLogicUpdatePause = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MsgBool StartGame(RomFile romFile)
|
public override MsgBool StartGame(RomFile romFile)
|
||||||
{
|
{
|
||||||
mPlatform = romFile.Platform;
|
mPlatform = romFile.Platform;
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
bLogicUpdatePause = true;
|
bLogicUpdatePause = true;
|
||||||
|
|
||||||
//保存当前正在进行的游戏存档
|
//保存当前正在进行的游戏存档
|
||||||
if (emulatorHandler != null && !emulatorHandler.IsRunning)
|
if (emulatorHandler != null && !emulatorHandler.IsRunning)
|
||||||
{
|
{
|
||||||
emulatorHandler.SaveCartridge();
|
emulatorHandler.SaveCartridge();
|
||||||
@ -119,10 +119,10 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
if (LoadAndRunCartridge(romFile.LocalFilePath))
|
if (LoadAndRunCartridge(romFile.LocalFilePath))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return "Rom加载失败";
|
return "Rom加载失败";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
if (!emulatorHandler.IsRunning)
|
if (!emulatorHandler.IsRunning)
|
||||||
{
|
{
|
||||||
@ -131,36 +131,36 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
ShutdownEmulation();
|
ShutdownEmulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoReset()
|
public override void DoReset()
|
||||||
{
|
{
|
||||||
emulatorHandler.SaveCartridge();
|
emulatorHandler.SaveCartridge();
|
||||||
emulatorHandler.Reset();
|
emulatorHandler.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IControllerSetuper GetControllerSetuper()
|
public override IControllerSetuper GetControllerSetuper()
|
||||||
{
|
{
|
||||||
return mUniKeyboard.ControllerMapper;
|
return mUniKeyboard.ControllerMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool PushEmulatorFrame()
|
public override bool PushEmulatorFrame()
|
||||||
{
|
{
|
||||||
if (!emulatorHandler.IsRunning) return false;
|
if (!emulatorHandler.IsRunning) return false;
|
||||||
if (!bLogicUpdatePause) return false;
|
if (!bLogicUpdatePause) return false;
|
||||||
|
|
||||||
//采集本帧Input
|
//采集本帧Input
|
||||||
bool bhadNext = mUniKeyboard.SampleInput();
|
bool bhadNext = mUniKeyboard.SampleInput();
|
||||||
//如果未收到Input数据,核心帧不推进
|
//如果未收到Input数据,核心帧不推进
|
||||||
if (!bhadNext) return false;
|
if (!bhadNext) return false;
|
||||||
|
|
||||||
emulatorHandler.Update_Frame();
|
emulatorHandler.Update_Frame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AfterPushFrame()
|
public override void AfterPushFrame()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetAudioParams(out int frequency, out int channels)
|
public override void GetAudioParams(out int frequency, out int channels)
|
||||||
{
|
{
|
||||||
frequency = soundHandler.sampleRate;
|
frequency = soundHandler.sampleRate;
|
||||||
channels = soundHandler.channle;
|
channels = soundHandler.channle;
|
||||||
@ -169,10 +169,10 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
void InitAll(IGameMetaReources metaresources, IEssgeeIOSupport uegIO, string CustonDataDir)
|
void InitAll(IGameMetaReources metaresources, IEssgeeIOSupport uegIO, string CustonDataDir)
|
||||||
{
|
{
|
||||||
//初始化配置
|
//初始化配置
|
||||||
InitAppEnvironment(CustonDataDir, uegIO);
|
InitAppEnvironment(CustonDataDir, uegIO);
|
||||||
InitEmu();
|
InitEmu();
|
||||||
//细节初始化
|
//细节初始化
|
||||||
InitializeHandlers(metaresources);
|
InitializeHandlers(metaresources);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -218,7 +218,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
if (AppEnvironment.EnableLogger)
|
if (AppEnvironment.EnableLogger)
|
||||||
{
|
{
|
||||||
//TODO 关闭Debug
|
//TODO 关闭Debug
|
||||||
//Logger.Flush();
|
//Logger.Flush();
|
||||||
//Logger.Close();
|
//Logger.Close();
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
//keysDown = new List<MotionKey>();
|
//keysDown = new List<MotionKey>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 细节初始化
|
#region 细节初始化
|
||||||
|
|
||||||
private void InitializeHandlers(IGameMetaReources metaresources)
|
private void InitializeHandlers(IGameMetaReources metaresources)
|
||||||
{
|
{
|
||||||
@ -277,7 +277,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
#endregion
|
#endregion
|
||||||
void Dispose(bool disposing)
|
void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
//TODO 释放时
|
//TODO 释放时
|
||||||
//if (disposing)
|
//if (disposing)
|
||||||
//{
|
//{
|
||||||
// if (components != null) components.Dispose();
|
// if (components != null) components.Dispose();
|
||||||
@ -289,10 +289,10 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
//base.Dispose(disposing);
|
//base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
#region 配置
|
#region 配置
|
||||||
private static void LoadConfiguration()
|
private static void LoadConfiguration()
|
||||||
{
|
{
|
||||||
//TODO 暂时跳过这里的配置加载
|
//TODO 暂时跳过这里的配置加载
|
||||||
//Directory.CreateDirectory(EmuStandInfo.programDataDirectory);
|
//Directory.CreateDirectory(EmuStandInfo.programDataDirectory);
|
||||||
//if (!File.Exists(EmuStandInfo.programConfigPath) || (EmuStandInfo.Configuration = EmuStandInfo.programConfigPath.DeserializeFromFile<Configuration>()) == null)
|
//if (!File.Exists(EmuStandInfo.programConfigPath) || (EmuStandInfo.Configuration = EmuStandInfo.programConfigPath.DeserializeFromFile<Configuration>()) == null)
|
||||||
//{
|
//{
|
||||||
@ -397,12 +397,12 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
}
|
}
|
||||||
public static void SaveConfiguration()
|
public static void SaveConfiguration()
|
||||||
{
|
{
|
||||||
//不用保存这个配置
|
//不用保存这个配置
|
||||||
//EmuStandInfo.Configuration.SerializeToFile(EmuStandInfo.programConfigPath);
|
//EmuStandInfo.Configuration.SerializeToFile(EmuStandInfo.programConfigPath);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 模拟器基本设置
|
#region 模拟器基本设置
|
||||||
|
|
||||||
public void SetEmuFpsLimit(bool bOpen)
|
public void SetEmuFpsLimit(bool bOpen)
|
||||||
{
|
{
|
||||||
@ -427,12 +427,12 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 模拟器生命周期
|
#region 模拟器生命周期
|
||||||
|
|
||||||
|
|
||||||
private void PowerOnWithoutCartridge(Type machineType)
|
private void PowerOnWithoutCartridge(Type machineType)
|
||||||
{
|
{
|
||||||
//TODO IsRecording?? 可能需要实现
|
//TODO IsRecording?? 可能需要实现
|
||||||
//if (soundHandler.IsRecording)
|
//if (soundHandler.IsRecording)
|
||||||
// soundHandler.CancelRecording();
|
// soundHandler.CancelRecording();
|
||||||
|
|
||||||
@ -456,7 +456,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
var (machineType, romData) = CartridgeLoader.Load(fileName, "ROM image");
|
var (machineType, romData) = CartridgeLoader.Load(fileName, "ROM image");
|
||||||
|
|
||||||
//TODO IsRecording?? 可能需要实现
|
//TODO IsRecording?? 可能需要实现
|
||||||
//if (soundHandler.IsRecording)
|
//if (soundHandler.IsRecording)
|
||||||
// soundHandler.CancelRecording();
|
// soundHandler.CancelRecording();
|
||||||
|
|
||||||
@ -481,13 +481,13 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
//toggleLayersToolStripMenuItem.Enabled = enableChannelsToolStripMenuItem.Enabled = true;
|
//toggleLayersToolStripMenuItem.Enabled = enableChannelsToolStripMenuItem.Enabled = true;
|
||||||
|
|
||||||
|
|
||||||
//初始化不同平台的按钮
|
//初始化不同平台的按钮
|
||||||
mUniKeyboard.Init(emulatorHandler.emulator);
|
mUniKeyboard.Init(emulatorHandler.emulator);
|
||||||
|
|
||||||
emulatorHandler.Startup();
|
emulatorHandler.Startup();
|
||||||
|
|
||||||
|
|
||||||
//初始化音频
|
//初始化音频
|
||||||
soundHandler.Initialize();
|
soundHandler.Initialize();
|
||||||
|
|
||||||
//SizeAndPositionWindow();
|
//SizeAndPositionWindow();
|
||||||
@ -549,7 +549,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
//{
|
//{
|
||||||
if (!AppEnvironment.TemporaryDisableCustomExceptionForm)
|
if (!AppEnvironment.TemporaryDisableCustomExceptionForm)
|
||||||
{
|
{
|
||||||
//TODO debug窗口?
|
//TODO debug窗口?
|
||||||
//(_, ExceptionResult result, string prefix, string postfix) = ExceptionForm.GetExceptionInfo(ex);
|
//(_, ExceptionResult result, string prefix, string postfix) = ExceptionForm.GetExceptionInfo(ex);
|
||||||
|
|
||||||
//if (result == ExceptionResult.Continue)
|
//if (result == ExceptionResult.Continue)
|
||||||
@ -661,7 +661,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 模拟器内部事件
|
#region 模拟器内部事件
|
||||||
|
|
||||||
private void EmulatorHandler_SendLogMessage(object sender, SendLogMessageEventArgs e)
|
private void EmulatorHandler_SendLogMessage(object sender, SendLogMessageEventArgs e)
|
||||||
{
|
{
|
||||||
@ -699,7 +699,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
private void EmulatorHandler_SizeScreen(object sender, SizeScreenEventArgs e)
|
private void EmulatorHandler_SizeScreen(object sender, SizeScreenEventArgs e)
|
||||||
{
|
{
|
||||||
//TODO 待实现 屏幕大小
|
//TODO 待实现 屏幕大小
|
||||||
|
|
||||||
//this.CheckInvokeMethod(delegate ()
|
//this.CheckInvokeMethod(delegate ()
|
||||||
//{
|
//{
|
||||||
@ -710,7 +710,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
private void EmulatorHandler_ChangeViewport(object sender, ChangeViewportEventArgs e)
|
private void EmulatorHandler_ChangeViewport(object sender, ChangeViewportEventArgs e)
|
||||||
{
|
{
|
||||||
//TODO 待实现
|
//TODO 待实现
|
||||||
|
|
||||||
//this.CheckInvokeMethod(delegate ()
|
//this.CheckInvokeMethod(delegate ()
|
||||||
//{
|
//{
|
||||||
@ -721,7 +721,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
private void EmulatorHandler_PollInput(object sender, PollInputEventArgs e)
|
private void EmulatorHandler_PollInput(object sender, PollInputEventArgs e)
|
||||||
{
|
{
|
||||||
//TODO Input实现
|
//TODO Input实现
|
||||||
|
|
||||||
//e.Keyboard = mUniKeyboard.mKeyCodeCore.GetPressedKeys();
|
//e.Keyboard = mUniKeyboard.mKeyCodeCore.GetPressedKeys();
|
||||||
e.Keyboard.AddRange(mUniKeyboard.GetPressedKeys());
|
e.Keyboard.AddRange(mUniKeyboard.GetPressedKeys());
|
||||||
@ -775,7 +775,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
/* Images, ex. GB Printer printouts */
|
/* Images, ex. GB Printer printouts */
|
||||||
//image.Save(filePath);
|
//image.Save(filePath);
|
||||||
|
|
||||||
//TODO 图像存储
|
//TODO 图像存储
|
||||||
}
|
}
|
||||||
else if (e.Data is byte[] raw)
|
else if (e.Data is byte[] raw)
|
||||||
{
|
{
|
||||||
@ -801,7 +801,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
|
|
||||||
if (emulatorHandler.IsPaused)
|
if (emulatorHandler.IsPaused)
|
||||||
{
|
{
|
||||||
//TODO 音频暂停?
|
//TODO 音频暂停?
|
||||||
//soundHandler?.ClearSampleBuffer();
|
//soundHandler?.ClearSampleBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -825,7 +825,7 @@ public class UEssgee : MonoBehaviour, IEmuCore
|
|||||||
// waveHeader.FileLength += (uint)e.MixedSamples.Length;
|
// waveHeader.FileLength += (uint)e.MixedSamples.Length;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//TODO 音频处理
|
//TODO 音频处理
|
||||||
//soundHandler.SubmitSamples(e.MixedSamples, e.ChannelSamples, e.MixedSamples.Length);
|
//soundHandler.SubmitSamples(e.MixedSamples, e.ChannelSamples, e.MixedSamples.Length);
|
||||||
soundHandler.SubmitSamples(e.MixedSamples, e.ChannelSamples, e.MixedSamplesLength);
|
soundHandler.SubmitSamples(e.MixedSamples, e.ChannelSamples, e.MixedSamplesLength);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ using System.Text;
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
public class UMAME : MonoBehaviour, IEmuCore
|
public class UMAME : IEmuCore
|
||||||
{
|
{
|
||||||
public static UMAME instance { get; private set; }
|
public static UMAME instance { get; private set; }
|
||||||
public MAMEEmu emu { get; private set; }
|
public MAMEEmu emu { get; private set; }
|
||||||
@ -38,9 +38,9 @@ public class UMAME : MonoBehaviour, IEmuCore
|
|||||||
public string EmuDataPath { get { return App.PersistentDataPath(Platform); } }
|
public string EmuDataPath { get { return App.PersistentDataPath(Platform); } }
|
||||||
public string RomPath => EmuDataPath + "/RemoteRoms/";
|
public string RomPath => EmuDataPath + "/RemoteRoms/";
|
||||||
public string SavePath => EmuDataPath + "/sav/";
|
public string SavePath => EmuDataPath + "/sav/";
|
||||||
public RomPlatformType Platform { get { return mPlatform; } }
|
public override RomPlatformType Platform { get { return mPlatform; } }
|
||||||
RomPlatformType mPlatform = RomPlatformType.Cps1;
|
RomPlatformType mPlatform = RomPlatformType.Cps1;
|
||||||
public uint Frame => (uint)emu.currEmuFrame;
|
public override uint Frame => (uint)emu.currEmuFrame;
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
@ -67,31 +67,31 @@ public class UMAME : MonoBehaviour, IEmuCore
|
|||||||
StopGame();
|
StopGame();
|
||||||
}
|
}
|
||||||
#region 实现接口
|
#region 实现接口
|
||||||
public object GetState()
|
public override object GetState()
|
||||||
{
|
{
|
||||||
return SaveState();
|
return SaveState();
|
||||||
}
|
}
|
||||||
public byte[] GetStateBytes()
|
public override byte[] GetStateBytes()
|
||||||
{
|
{
|
||||||
return SaveState();
|
return SaveState();
|
||||||
}
|
}
|
||||||
public void LoadState(object state)
|
public override void LoadState(object state)
|
||||||
{
|
{
|
||||||
LoadState((byte[])state);
|
LoadState((byte[])state);
|
||||||
}
|
}
|
||||||
public void LoadStateFromBytes(byte[] data)
|
public override void LoadStateFromBytes(byte[] data)
|
||||||
{
|
{
|
||||||
LoadState(data);
|
LoadState(data);
|
||||||
}
|
}
|
||||||
public void Pause()
|
public override void Pause()
|
||||||
{
|
{
|
||||||
bLogicUpdatePause = false;
|
bLogicUpdatePause = false;
|
||||||
}
|
}
|
||||||
public void Resume()
|
public override void Resume()
|
||||||
{
|
{
|
||||||
bLogicUpdatePause = true;
|
bLogicUpdatePause = true;
|
||||||
}
|
}
|
||||||
public MsgBool StartGame(RomFile romFile)
|
public override MsgBool StartGame(RomFile romFile)
|
||||||
{
|
{
|
||||||
mPlatform = romFile.Platform;
|
mPlatform = romFile.Platform;
|
||||||
mTimeSpan.InitStandTime();
|
mTimeSpan.InitStandTime();
|
||||||
@ -100,22 +100,22 @@ public class UMAME : MonoBehaviour, IEmuCore
|
|||||||
else
|
else
|
||||||
return "Rom加载失败";
|
return "Rom加载失败";
|
||||||
}
|
}
|
||||||
public void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
StopGame();
|
StopGame();
|
||||||
}
|
}
|
||||||
public void DoReset()
|
public override void DoReset()
|
||||||
{
|
{
|
||||||
StopGame();
|
StopGame();
|
||||||
LoadGame(mChangeRomName, false);
|
LoadGame(mChangeRomName, false);
|
||||||
}
|
}
|
||||||
public IControllerSetuper GetControllerSetuper()
|
public override IControllerSetuper GetControllerSetuper()
|
||||||
{
|
{
|
||||||
return mUniKeyboard.ControllerMapper;
|
return mUniKeyboard.ControllerMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void GetAudioParams(out int frequency, out int channels)
|
public override void GetAudioParams(out int frequency, out int channels)
|
||||||
{
|
{
|
||||||
mUniSoundPlayer.GetAudioParams(out frequency, out channels);
|
mUniSoundPlayer.GetAudioParams(out frequency, out channels);
|
||||||
}
|
}
|
||||||
@ -160,7 +160,7 @@ public class UMAME : MonoBehaviour, IEmuCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool PushEmulatorFrame()
|
public override bool PushEmulatorFrame()
|
||||||
{
|
{
|
||||||
if (!bInGame) return false;
|
if (!bInGame) return false;
|
||||||
if (!bLogicUpdatePause) return false;
|
if (!bLogicUpdatePause) return false;
|
||||||
@ -175,7 +175,7 @@ public class UMAME : MonoBehaviour, IEmuCore
|
|||||||
emu.UpdateFrame();
|
emu.UpdateFrame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public void AfterPushFrame()
|
public override void AfterPushFrame()
|
||||||
{
|
{
|
||||||
mFPS.text = ($"fpsv {mUniVideoPlayer.videoFPS.ToString("F2")} fpsa {mUniSoundPlayer.audioFPS.ToString("F2")} ,Idx:{App.roomMgr.netReplay?.mCurrClientFrameIdx},RIdx:{App.roomMgr.netReplay?.mRemoteFrameIdx},RForward:{App.roomMgr.netReplay?.mRemoteForwardCount} ,RD:{App.roomMgr.netReplay?.mRemoteForwardCount} ,D:{App.roomMgr.netReplay?.mDiffFrameCount} ,Q:{App.roomMgr.netReplay?.mNetReplayQueue.Count}");
|
mFPS.text = ($"fpsv {mUniVideoPlayer.videoFPS.ToString("F2")} fpsa {mUniSoundPlayer.audioFPS.ToString("F2")} ,Idx:{App.roomMgr.netReplay?.mCurrClientFrameIdx},RIdx:{App.roomMgr.netReplay?.mRemoteFrameIdx},RForward:{App.roomMgr.netReplay?.mRemoteForwardCount} ,RD:{App.roomMgr.netReplay?.mRemoteForwardCount} ,D:{App.roomMgr.netReplay?.mDiffFrameCount} ,Q:{App.roomMgr.netReplay?.mNetReplayQueue.Count}");
|
||||||
}
|
}
|
||||||
@ -227,9 +227,9 @@ public class UMAME : MonoBehaviour, IEmuCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Texture OutputPixel => mUniVideoPlayer.rawBufferWarper;
|
public override Texture OutputPixel => mUniVideoPlayer.rawBufferWarper;
|
||||||
|
|
||||||
public RawImage DrawCanvas => mUniVideoPlayer.DrawCanvas;
|
public override RawImage DrawCanvas => mUniVideoPlayer.DrawCanvas;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -11,7 +11,7 @@ using VirtualNes.Core.Debug;
|
|||||||
|
|
||||||
namespace AxibugEmuOnline.Client
|
namespace AxibugEmuOnline.Client
|
||||||
{
|
{
|
||||||
public class NesEmulator : MonoBehaviour, IEmuCore
|
public class NesEmulator : IEmuCore
|
||||||
{
|
{
|
||||||
public VideoProvider VideoProvider;
|
public VideoProvider VideoProvider;
|
||||||
public AudioProvider AudioProvider;
|
public AudioProvider AudioProvider;
|
||||||
@ -35,12 +35,12 @@ namespace AxibugEmuOnline.Client
|
|||||||
AudioProvider.NesEmu = this;
|
AudioProvider.NesEmu = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RomPlatformType Platform => RomPlatformType.Nes;
|
public override RomPlatformType Platform => RomPlatformType.Nes;
|
||||||
private CoreSupporter m_coreSupporter;
|
private CoreSupporter m_coreSupporter;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 指定ROM开始游戏
|
/// 指定ROM开始游戏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public MsgBool StartGame(RomFile rom)
|
public override MsgBool StartGame(RomFile rom)
|
||||||
{
|
{
|
||||||
StopGame();
|
StopGame();
|
||||||
|
|
||||||
@ -63,28 +63,28 @@ namespace AxibugEmuOnline.Client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Pause()
|
public override void Pause()
|
||||||
{
|
{
|
||||||
IsPause = true;
|
IsPause = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Resume()
|
public override void Resume()
|
||||||
{
|
{
|
||||||
IsPause = false;
|
IsPause = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void DoReset()
|
public override void DoReset()
|
||||||
{
|
{
|
||||||
NesCore.Reset();
|
NesCore.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(object state)
|
public override void LoadState(object state)
|
||||||
{
|
{
|
||||||
NesCore.LoadState((State)state);
|
NesCore.LoadState((State)state);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object GetState()
|
public override object GetState()
|
||||||
{
|
{
|
||||||
return NesCore.GetState();
|
return NesCore.GetState();
|
||||||
}
|
}
|
||||||
@ -93,7 +93,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
/// 获取即时存档
|
/// 获取即时存档
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public byte[] GetStateBytes()
|
public override byte[] GetStateBytes()
|
||||||
{
|
{
|
||||||
return NesCore.GetState().ToBytes();
|
return NesCore.GetState().ToBytes();
|
||||||
}
|
}
|
||||||
@ -104,14 +104,14 @@ namespace AxibugEmuOnline.Client
|
|||||||
/// <param
|
/// <param
|
||||||
/// name="data">
|
/// name="data">
|
||||||
/// </param>
|
/// </param>
|
||||||
public void LoadStateFromBytes(byte[] data)
|
public override void LoadStateFromBytes(byte[] data)
|
||||||
{
|
{
|
||||||
var st = new State();
|
var st = new State();
|
||||||
st.FromByte(data);
|
st.FromByte(data);
|
||||||
NesCore.LoadState(st);
|
NesCore.LoadState(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint Frame => NesCore.FrameCount;
|
public override uint Frame => NesCore.FrameCount;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 停止游戏
|
/// 停止游戏
|
||||||
@ -127,7 +127,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
private ControllerState m_lastState;
|
private ControllerState m_lastState;
|
||||||
#endif
|
#endif
|
||||||
//推进帧
|
//推进帧
|
||||||
public bool PushEmulatorFrame()
|
public override bool PushEmulatorFrame()
|
||||||
{
|
{
|
||||||
if (NesCore == null || IsPause) return false;
|
if (NesCore == null || IsPause) return false;
|
||||||
|
|
||||||
@ -145,23 +145,22 @@ namespace AxibugEmuOnline.Client
|
|||||||
NesCore.pad.Sync(controlState);
|
NesCore.pad.Sync(controlState);
|
||||||
NesCore.EmulateFrame(true);
|
NesCore.EmulateFrame(true);
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public unsafe void AfterPushFrame()
|
public override unsafe void AfterPushFrame()
|
||||||
{
|
{
|
||||||
var screenBuffer = NesCore.ppu.GetScreenPtr();
|
var screenBuffer = NesCore.ppu.GetScreenPtr();
|
||||||
VideoProvider.SetDrawData(screenBuffer);
|
VideoProvider.SetDrawData(screenBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IControllerSetuper GetControllerSetuper()
|
public override IControllerSetuper GetControllerSetuper()
|
||||||
{
|
{
|
||||||
return ControllerMapper;
|
return ControllerMapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
StopGame();
|
StopGame();
|
||||||
}
|
}
|
||||||
@ -197,9 +196,9 @@ namespace AxibugEmuOnline.Client
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public Texture OutputPixel => VideoProvider.OutputPixel;
|
public override Texture OutputPixel => VideoProvider.OutputPixel;
|
||||||
public RawImage DrawCanvas => VideoProvider.Drawer;
|
public override RawImage DrawCanvas => VideoProvider.Drawer;
|
||||||
public void GetAudioParams(out int frequency, out int channels)
|
public override void GetAudioParams(out int frequency, out int channels)
|
||||||
{
|
{
|
||||||
AudioProvider.GetAudioParams(out frequency, out channels);
|
AudioProvider.GetAudioParams(out frequency, out channels);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ using UnityEngine;
|
|||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
using CartridgeMetadata = StoicGoose.Core.Cartridges.Metadata;
|
using CartridgeMetadata = StoicGoose.Core.Cartridges.Metadata;
|
||||||
|
|
||||||
public class UStoicGoose : MonoBehaviour, IEmuCore
|
public class UStoicGoose : IEmuCore
|
||||||
{
|
{
|
||||||
public static UStoicGoose instance;
|
public static UStoicGoose instance;
|
||||||
public static System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
|
public static System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
|
||||||
@ -49,44 +49,44 @@ public class UStoicGoose : MonoBehaviour, IEmuCore
|
|||||||
public string CurrRomName { get; private set; }
|
public string CurrRomName { get; private set; }
|
||||||
|
|
||||||
#region 实现IEmuCore
|
#region 实现IEmuCore
|
||||||
public RomPlatformType Platform => mPlatform;
|
public override RomPlatformType Platform => mPlatform;
|
||||||
|
|
||||||
public uint Frame => (uint)emulatorHandler.AxiEmuRunFrame;
|
public override uint Frame => (uint)emulatorHandler.AxiEmuRunFrame;
|
||||||
|
|
||||||
public Texture OutputPixel => graphicsHandler.rawBufferWarper;
|
public override Texture OutputPixel => graphicsHandler.rawBufferWarper;
|
||||||
|
|
||||||
public RawImage DrawCanvas => graphicsHandler.DrawCanvas;
|
public override RawImage DrawCanvas => graphicsHandler.DrawCanvas;
|
||||||
public object GetState()
|
public override object GetState()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] GetStateBytes()
|
public override byte[] GetStateBytes()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadState(object state)
|
public override void LoadState(object state)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadStateFromBytes(byte[] data)
|
public override void LoadStateFromBytes(byte[] data)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Pause()
|
public override void Pause()
|
||||||
{
|
{
|
||||||
PauseEmulation();
|
PauseEmulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Resume()
|
public override void Resume()
|
||||||
{
|
{
|
||||||
UnpauseEmulation();
|
UnpauseEmulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MsgBool StartGame(RomFile romFile)
|
public override MsgBool StartGame(RomFile romFile)
|
||||||
{
|
{
|
||||||
mPlatform = romFile.Platform;
|
mPlatform = romFile.Platform;
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ public class UStoicGoose : MonoBehaviour, IEmuCore
|
|||||||
return "Rom加载失败";
|
return "Rom加载失败";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
//保存当前正在进行的游戏存档
|
//保存当前正在进行的游戏存档
|
||||||
if (emulatorHandler != null && !emulatorHandler.IsRunning)
|
if (emulatorHandler != null && !emulatorHandler.IsRunning)
|
||||||
@ -115,27 +115,27 @@ public class UStoicGoose : MonoBehaviour, IEmuCore
|
|||||||
EmuClose();
|
EmuClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoReset()
|
public override void DoReset()
|
||||||
{
|
{
|
||||||
ResetEmulation();
|
ResetEmulation();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IControllerSetuper GetControllerSetuper()
|
public override IControllerSetuper GetControllerSetuper()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool PushEmulatorFrame()
|
public override bool PushEmulatorFrame()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AfterPushFrame()
|
public override void AfterPushFrame()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetAudioParams(out int frequency, out int channels)
|
public override void GetAudioParams(out int frequency, out int channels)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,52 +4,41 @@ using UnityEngine.UI;
|
|||||||
|
|
||||||
namespace AxibugEmuOnline.Client
|
namespace AxibugEmuOnline.Client
|
||||||
{
|
{
|
||||||
public interface IEmuCore
|
public abstract class IEmuCore : MonoBehaviour
|
||||||
{
|
{
|
||||||
GameObject gameObject { get; }
|
|
||||||
|
|
||||||
/// <summary> 获得模拟器核心中的状态快照对象 </summary>
|
/// <summary> 获得模拟器核心中的状态快照对象 </summary>
|
||||||
object GetState();
|
public abstract object GetState();
|
||||||
/// <summary> 获得模拟器核心中的状态快照字节数据 </summary>
|
/// <summary> 获得模拟器核心中的状态快照字节数据 </summary>
|
||||||
byte[] GetStateBytes();
|
public abstract byte[] GetStateBytes();
|
||||||
/// <summary> 加载状态快照 </summary>
|
/// <summary> 加载状态快照 </summary>
|
||||||
/// <param name="state">该对象应该来自核心的<see cref="GetState"/>方法的返回值,或是从<see cref="GetStateBytes"/>返回的byte数组构建</param>
|
/// <param name="state">该对象应该来自核心的<see cref="GetState"/>方法的返回值,或是从<see cref="GetStateBytes"/>返回的byte数组构建</param>
|
||||||
void LoadState(object state);
|
public abstract void LoadState(object state);
|
||||||
/// <summary> 加载状态快照 </summary>
|
/// <summary> 加载状态快照 </summary>
|
||||||
/// <param name="data">该对象应该来自核心的<see cref="GetStateBytes"/>返回的byte数组</param>
|
/// <param name="data">该对象应该来自核心的<see cref="GetStateBytes"/>返回的byte数组</param>
|
||||||
void LoadStateFromBytes(byte[] data);
|
public abstract void LoadStateFromBytes(byte[] data);
|
||||||
/// <summary> 暂停核心推帧 </summary>
|
/// <summary> 暂停核心推帧 </summary>
|
||||||
void Pause();
|
public abstract void Pause();
|
||||||
/// <summary> 恢复核心推帧(从Pause状态恢复) </summary>
|
/// <summary> 恢复核心推帧(从Pause状态恢复) </summary>
|
||||||
void Resume();
|
public abstract void Resume();
|
||||||
/// <summary> 启动模拟器逻辑 </summary>
|
/// <summary> 启动模拟器逻辑 </summary>
|
||||||
MsgBool StartGame(RomFile romFile);
|
public abstract MsgBool StartGame(RomFile romFile);
|
||||||
/// <summary> 释放模拟器核心 </summary>
|
/// <summary> 释放模拟器核心 </summary>
|
||||||
void Dispose();
|
public abstract void Dispose();
|
||||||
/// <summary> 重置核心,通常由模拟器核心提供的功能 </summary>
|
/// <summary> 重置核心,通常由模拟器核心提供的功能 </summary>
|
||||||
void DoReset();
|
public abstract void DoReset();
|
||||||
/// <summary> 获得模拟器核心的控制器设置器 </summary>
|
/// <summary> 获得模拟器核心的控制器设置器 </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IControllerSetuper GetControllerSetuper();
|
public abstract IControllerSetuper GetControllerSetuper();
|
||||||
/// <summary> 核心所属平台 </summary>
|
/// <summary> 核心所属平台 </summary>
|
||||||
RomPlatformType Platform { get; }
|
public abstract RomPlatformType Platform { get; }
|
||||||
/// <summary> 获取当前模拟器帧序号,在加载快照和Reset后,应当重置为0 </summary>
|
/// <summary> 获取当前模拟器帧序号,在加载快照和Reset后,应当重置为0 </summary>
|
||||||
uint Frame { get; }
|
public abstract uint Frame { get; }
|
||||||
/// <summary> 模拟器核心推帧 </summary>
|
/// <summary> 模拟器核心推帧 </summary>
|
||||||
bool PushEmulatorFrame();
|
public abstract bool PushEmulatorFrame();
|
||||||
/// <summary> 模拟器核心推帧结束 </summary>
|
/// <summary> 模拟器核心推帧结束 </summary>
|
||||||
void AfterPushFrame();
|
public abstract void AfterPushFrame();
|
||||||
public void GetAudioParams(out int frequency, out int channels);
|
public abstract void GetAudioParams(out int frequency, out int channels);
|
||||||
Texture OutputPixel { get; }
|
public abstract Texture OutputPixel { get; }
|
||||||
RawImage DrawCanvas { get; }
|
public abstract RawImage DrawCanvas { get; }
|
||||||
}
|
|
||||||
|
|
||||||
public static class IEnumCoreTool
|
|
||||||
{
|
|
||||||
public static bool IsNull(this IEmuCore core)
|
|
||||||
{
|
|
||||||
if (core == null) return true;
|
|
||||||
return core.Equals(null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
private void OnSelfJoinRoom()
|
private void OnSelfJoinRoom()
|
||||||
{
|
{
|
||||||
//如果当前正在游戏中,就先结束游戏
|
//如果当前正在游戏中,就先结束游戏
|
||||||
if (!m_emuCore.IsNull()) StopGame();
|
if (m_emuCore != null) StopGame();
|
||||||
|
|
||||||
var roomInfo = App.roomMgr.mineRoomMiniInfo;
|
var roomInfo = App.roomMgr.mineRoomMiniInfo;
|
||||||
roomInfo.FetchRomFileInRoomInfo((_, romFile) =>
|
roomInfo.FetchRomFileInRoomInfo((_, romFile) =>
|
||||||
@ -48,7 +48,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
|
|
||||||
public void BeginGame(RomFile romFile)
|
public void BeginGame(RomFile romFile)
|
||||||
{
|
{
|
||||||
if (!m_emuCore.IsNull()) return;
|
if (m_emuCore != null) return;
|
||||||
|
|
||||||
switch (romFile.Platform)
|
switch (romFile.Platform)
|
||||||
{
|
{
|
||||||
@ -120,7 +120,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
|
|
||||||
public void StopGame()
|
public void StopGame()
|
||||||
{
|
{
|
||||||
if (m_emuCore.IsNull()) return;
|
if (m_emuCore == null) return;
|
||||||
m_emuCore.Dispose();
|
m_emuCore.Dispose();
|
||||||
GameObject.Destroy(m_emuCore.gameObject);
|
GameObject.Destroy(m_emuCore.gameObject);
|
||||||
m_emuCore = null;
|
m_emuCore = null;
|
||||||
@ -133,7 +133,7 @@ namespace AxibugEmuOnline.Client.Manager
|
|||||||
|
|
||||||
public void ResetGame()
|
public void ResetGame()
|
||||||
{
|
{
|
||||||
if (m_emuCore.IsNull()) return;
|
if (m_emuCore == null) return;
|
||||||
|
|
||||||
m_emuCore.DoReset();
|
m_emuCore.DoReset();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
void PushCoreFrame()
|
void PushCoreFrame()
|
||||||
{
|
{
|
||||||
if (Core.IsNull()) return;
|
if (Core == null) return;
|
||||||
//fluash netMsg
|
//fluash netMsg
|
||||||
NetMsg.Instance.DequeueNesMsg();
|
NetMsg.Instance.DequeueNesMsg();
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (m_gameUI.Core.IsNull()) return false;
|
if (m_gameUI.Core == null) return false;
|
||||||
|
|
||||||
var isSetMode = App.settings.ScreenScaler.IsSetMode(m_gameUI.Core.Platform);
|
var isSetMode = App.settings.ScreenScaler.IsSetMode(m_gameUI.Core.Platform);
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@ namespace AxibugEmuOnline.Client
|
|||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (CommandDispatcher.Instance.Mode == CommandListener.ScheduleType.Gaming && App.emu.Core.IsNull())
|
if (CommandDispatcher.Instance.Mode == CommandListener.ScheduleType.Gaming && App.emu.Core == null)
|
||||||
CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal;
|
CommandDispatcher.Instance.Mode = CommandListener.ScheduleType.Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public class ControllerInfo : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (App.emu.Core.IsNull())
|
if (App.emu.Core == null)
|
||||||
{
|
{
|
||||||
SetDisconnect();
|
SetDisconnect();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -35,7 +35,7 @@ public class ControllerInfoPanel : MonoBehaviour
|
|||||||
}
|
}
|
||||||
else //不在房间中,直接设置
|
else //不在房间中,直接设置
|
||||||
{
|
{
|
||||||
if (App.emu.Core.IsNull()) return;
|
if (App.emu.Core == null) return;
|
||||||
var setuper = App.emu.Core.GetControllerSetuper();
|
var setuper = App.emu.Core.GetControllerSetuper();
|
||||||
if (setuper == null) return;
|
if (setuper == null) return;
|
||||||
|
|
||||||
|
|||||||
@ -24,7 +24,7 @@ public class XMBInfoBar : MonoBehaviour
|
|||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
ControlSlotInfoNode.SetActiveEx(!App.emu.Core.IsNull());
|
ControlSlotInfoNode.SetActiveEx(App.emu.Core != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDisable()
|
void OnDisable()
|
||||||
@ -46,7 +46,7 @@ public class XMBInfoBar : MonoBehaviour
|
|||||||
ValueTuple<uint, float> m_lastFrameInfo;
|
ValueTuple<uint, float> m_lastFrameInfo;
|
||||||
private void RefreshFps()
|
private void RefreshFps()
|
||||||
{
|
{
|
||||||
if (App.emu.Core.IsNull())
|
if (App.emu.Core == null)
|
||||||
FPS.gameObject.SetActiveEx(false);
|
FPS.gameObject.SetActiveEx(false);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user