mirror of https://github.com/PCSX2/pcsx2.git
IPC: add SaveState
This commit is contained in:
parent
047e63ee5f
commit
e651147c53
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "Common.h"
|
||||
#include "Memory.h"
|
||||
#include "gui/AppSaveStates.h"
|
||||
#include "System/SysThreads.h"
|
||||
#include "svnrev.h"
|
||||
#include "IPC.h"
|
||||
|
@ -390,6 +391,16 @@ SocketIPC::IPCBuffer SocketIPC::ParseCommand(char* buf, char* ret_buffer, u32 bu
|
|||
ret_cnt += 256;
|
||||
break;
|
||||
}
|
||||
case MsgSaveState:
|
||||
{
|
||||
if (!m_vm->HasActiveMachine())
|
||||
goto error;
|
||||
if (!SafetyChecks(buf_cnt, 1, ret_cnt, 0, buf_size))
|
||||
goto error;
|
||||
StateCopy_SaveToSlot(FromArray<u8>(&buf[buf_cnt], 0));
|
||||
buf_cnt += 1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
error:
|
||||
|
|
|
@ -92,6 +92,7 @@ protected:
|
|||
MsgWrite32 = 6, /**< Write 32 bit value to memory. */
|
||||
MsgWrite64 = 7, /**< Write 64 bit value to memory. */
|
||||
MsgVersion = 8, /**< Returns PCSX2 version. */
|
||||
MsgSaveState = 9, /**< Saves a savestate. */
|
||||
MsgUnimplemented = 0xFF /**< Unimplemented IPC message. */
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue