完全移除文件形式的replay在模拟器中

This commit is contained in:
sin365 2025-10-08 02:04:37 +08:00
parent 2e5827f212
commit 8669c7a613
4 changed files with 38 additions and 33 deletions

View File

@ -1,4 +1,5 @@
using System;
#if !UNITY_SWITCH
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@ -172,3 +173,4 @@ namespace AxiReplay
}
}
#endif

View File

@ -1,4 +1,5 @@
using System;
#if !UNITY_SWITCH
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
@ -156,3 +157,4 @@ namespace AxiReplay
}
}
#endif

View File

@ -29,8 +29,8 @@ public class UMAME : EmuCore<ulong>
public UniTimeSpan mTimeSpan;
public bool bQuickTestRom = false;
public string mQuickTestRom = string.Empty;
public ReplayWriter mReplayWriter;
public ReplayReader mReplayReader;
//public ReplayWriter mReplayWriter;
//public ReplayReader mReplayReader;
public long currEmuFrame => emu.currEmuFrame;
public static System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();
public static bool bInGame { get; private set; }
@ -125,7 +125,7 @@ public class UMAME : EmuCore<ulong>
{
emu.ResetRomRoot(RomPath);
//Application.targetFrameRate = 60;
mReplayWriter = new ReplayWriter(mChangeRomName, "fuck", ReplayData.ReplayFormat.FM32IP64, Encoding.UTF8);
//mReplayWriter = new ReplayWriter(mChangeRomName, "fuck", ReplayData.ReplayFormat.FM32IP64, Encoding.UTF8);
mChangeRomName = loadRom;
StopGame();
//读取ROM
@ -161,7 +161,7 @@ public class UMAME : EmuCore<ulong>
mUniKeyboard.SyncInput(InputData);
emu.UpdateFrame();
//写入replay
UMAME.instance.mReplayWriter.NextFramebyFrameIdx((int)UMAME.instance.mUniVideoPlayer.mFrame, InputData);
//UMAME.instance.mReplayWriter.NextFramebyFrameIdx((int)UMAME.instance.mUniVideoPlayer.mFrame, InputData);
return true;
}
@ -188,7 +188,7 @@ public class UMAME : EmuCore<ulong>
{
string Path = SavePath + Machine.sName + ".rp";
string dbgPath = SavePath + Machine.sName + ".rpwrite";
mReplayWriter.SaveData(Path, true, dbgPath);
//mReplayWriter.SaveData(Path, true, dbgPath);
}
public void StopGame()
{

View File

@ -121,34 +121,35 @@ public class UniKeyboard : MonoBehaviour, IKeyboard
}
}
public class ReplayMode
{
ulong currInputData;
// public class ReplayMode
// {
// ulong currInputData;
public ReplayMode()
{
}
// public ReplayMode()
// {
// }
public ulong GetPressedKeys()
{
int targetFrame = (int)UMAME.instance.mUniVideoPlayer.mFrame;
AxiReplay.ReplayStep stepData;
//有变化
if (UMAME.instance.mReplayReader.NextFramebyFrameIdx(targetFrame, out stepData))
{
#if UNITY_EDITOR
string ShowKeyNames = string.Empty;
foreach (string keyname in GetInputpDataToMotionKey(currInputData))
{
ShowKeyNames += keyname + " |";
}
Debug.Log("GetPressedKeys=>" + ShowKeyNames);
#endif
currInputData = stepData.InPut;
}
return currInputData;
}
}
// public ulong GetPressedKeys()
// {
// int targetFrame = (int)UMAME.instance.mUniVideoPlayer.mFrame;
// AxiReplay.ReplayStep stepData;
// //有变化
// if (UMAME.instance.mReplayReader.NextFramebyFrameIdx(targetFrame, out stepData))
// {
//#if UNITY_EDITOR
// string ShowKeyNames = string.Empty;
// foreach (string keyname in GetInputpDataToMotionKey(currInputData))
// {
// ShowKeyNames += keyname + " |";
// }
// Debug.Log("GetPressedKeys=>" + ShowKeyNames);
//#endif
// currInputData = stepData.InPut;
// }
// return currInputData;
// }
// }
#endregion
}