IPC: add LoadState

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2021-03-01 18:01:01 +01:00 committed by lightningterror
parent e651147c53
commit 5153d9a198
2 changed files with 11 additions and 0 deletions

View File

@ -401,6 +401,16 @@ SocketIPC::IPCBuffer SocketIPC::ParseCommand(char* buf, char* ret_buffer, u32 bu
buf_cnt += 1;
break;
}
case MsgLoadState:
{
if (!m_vm->HasActiveMachine())
goto error;
if (!SafetyChecks(buf_cnt, 1, ret_cnt, 0, buf_size))
goto error;
StateCopy_LoadFromSlot(FromArray<u8>(&buf[buf_cnt], 0), false);
buf_cnt += 1;
break;
}
default:
{
error:

View File

@ -93,6 +93,7 @@ protected:
MsgWrite64 = 7, /**< Write 64 bit value to memory. */
MsgVersion = 8, /**< Returns PCSX2 version. */
MsgSaveState = 9, /**< Saves a savestate. */
MsgLoadState = 0xA, /**< Loads a savestate. */
MsgUnimplemented = 0xFF /**< Unimplemented IPC message. */
};