diff --git a/Assets/Plugins/Essgee.Unity/Emulation/EmulatorHandler.cs b/Assets/Plugins/Essgee.Unity/Emulation/EmulatorHandler.cs index a4bbc62..2f061bc 100644 --- a/Assets/Plugins/Essgee.Unity/Emulation/EmulatorHandler.cs +++ b/Assets/Plugins/Essgee.Unity/Emulation/EmulatorHandler.cs @@ -365,7 +365,7 @@ namespace Essgee.Emulation // } //} - public void mySaveState(int stateNumber) + public void SaveSnapShotToFile(int stateNumber) { var statePath = GetSaveStateFilename(stateNumber); using (var stream = new FileStream(statePath, FileMode.OpenOrCreate)) @@ -375,7 +375,7 @@ namespace Essgee.Emulation } } - public void myLoadState(int stateNumber) + public void LoadSnapShotFromFile(int stateNumber) { var statePath = GetSaveStateFilename(stateNumber); if (File.Exists(statePath)) @@ -387,5 +387,15 @@ namespace Essgee.Emulation } } } + + public byte[] GetStateData() + { + return emulator.SaveAxiStatus().ToByteArray(); + } + + public void SetStateData(byte[] data) + { + emulator.LoadAxiStatus(data.ToAxiEssgssStatusData()); + } } } diff --git a/Assets/Scripts/UEssgee.cs b/Assets/Scripts/UEssgee.cs index 0346d7d..d7ee5ac 100644 --- a/Assets/Scripts/UEssgee.cs +++ b/Assets/Scripts/UEssgee.cs @@ -65,11 +65,11 @@ public class Essgeeinit : MonoBehaviour if (Input.GetKeyDown(KeyCode.F5)) { - emulatorHandler.mySaveState(0); + emulatorHandler.SaveSnapShotToFile(0); } if (Input.GetKeyDown(KeyCode.F6)) { - emulatorHandler.myLoadState(0); + emulatorHandler.LoadSnapShotFromFile(0); } }