mirror of https://github.com/PCSX2/pcsx2.git
ipc: implement MsgStatus
This commit is contained in:
parent
bc6e5213a0
commit
4a2482e950
|
@ -462,6 +462,27 @@ SocketIPC::IPCBuffer SocketIPC::ParseCommand(char* buf, char* ret_buffer, u32 bu
|
|||
ret_cnt += 256;
|
||||
break;
|
||||
}
|
||||
case MsgStatus:
|
||||
{
|
||||
if (!SafetyChecks(buf_cnt, 0, ret_cnt, 4, buf_size))
|
||||
goto error;
|
||||
EmuStatus status;
|
||||
switch (m_vm->HasActiveMachine())
|
||||
{
|
||||
case true:
|
||||
if (CoreThread.IsClosing())
|
||||
status = Paused;
|
||||
else
|
||||
status = Running;
|
||||
break;
|
||||
case false:
|
||||
status = Shutdown;
|
||||
break;
|
||||
}
|
||||
ToArray(ret_buffer, status, ret_cnt);
|
||||
ret_cnt += 4;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
error:
|
||||
|
|
11
pcsx2/IPC.h
11
pcsx2/IPC.h
|
@ -103,9 +103,20 @@ protected:
|
|||
MsgID = 0xC, /**< Returns the game ID. */
|
||||
MsgUUID = 0xD, /**< Returns the game UUID. */
|
||||
MsgGameVersion = 0xE, /**< Returns the game verion. */
|
||||
MsgStatus = 0xF, /**< Returns the emulator status. */
|
||||
MsgUnimplemented = 0xFF /**< Unimplemented IPC message. */
|
||||
};
|
||||
|
||||
/**
|
||||
* Emulator status enum.
|
||||
* A list of possible emulator statuses.
|
||||
*/
|
||||
enum EmuStatus : uint32_t
|
||||
{
|
||||
Running = 0, /**< Game is running */
|
||||
Paused = 1, /**< Game is paused */
|
||||
Shutdown = 2 /**< Game is shutdown */
|
||||
};
|
||||
|
||||
/**
|
||||
* IPC message buffer.
|
||||
|
|
Loading…
Reference in New Issue