WebSocket relay for the PINE IPC protocol using pine-rs.
pine-ws accepts the following command line arguments:
--target: The name of the emulator, i.e.pcsx2,rpcs3,duckstation. Default ispcsx2.- If
targetdoes not equal one of the specified emulators,slotmust be specified.
- If
--slot: The IPC slot/port of the emulator. Default is 28011 iftargetispcsx2orduckstation, 28012 iftargetisrpcs3.--port: The port to run the WebSocket server on. Default is58012.
Messages are sent between the client and server as JSON strings.
Request example:
{
"command": "execute_batch",
"batch": [
{ "command": "MsgTitle" },
{ "command": "MsgGameVersion" }
{ "command": "MsgRead32", "mem": 3565532 }
]
}Response example:
{
"res": [
{ "command": "ResTitle", "title": "Klonoa 2 - Lunatea's Veil" },
{ "command": "ResGameVersion", "version": "1.00" },
{ "command": "ResRead32", "val": 3566512 }
]
}Error response example:
{
"error": "Failed to parse command: ..."
}execute_command(cmd: { command: PINECommand, ... }) -> PINEResponse: Executes a single PINE command and returns the response. Additional parameters are required for certain PINE commands.execute_batch(batch: { command: PINECommand, ... }[]) -> PINEResponse[]: Executes a list of PINE commands and returns a list of responses for each command. Additional parameters are required for certain PINE commands.write_buffer(address: number, buffer: string) -> PINEResponse[]: Writes a Base64-encoded buffer to the specified memory address. This command creates a batch ofMsgWriteNcommands to write the buffer to memory.
pine-ws currently only accepts the commands specified in the PINE standard:
enum PINECommand {
MsgRead8 { mem: u32 },
MsgRead16 { mem: u32 },
MsgRead32 { mem: u32 },
MsgRead64 { mem: u32 },
MsgWrite8 { mem: u32, val: u8 },
MsgWrite16 { mem: u32, val: u16 },
MsgWrite32 { mem: u32, val: u32 },
MsgWrite64 { mem: u32, val: u64 },
MsgVersion,
MsgSaveState { sta: u8 },
MsgLoadState { sta: u8 },
MsgTitle,
MsgID,
MsgUUID,
MsgGameVersion,
MsgStatus,
MsgUnimplemented
}
enum PINEResponse {
ResRead8 { val: u8 },
ResRead16 { val: u16 },
ResRead32 { val: u32 },
ResRead64 { val: u64 },
ResWrite8,
ResWrite16,
ResWrite32,
ResWrite64,
ResVersion { version: String },
ResSaveState,
ResLoadState,
ResTitle { title: String },
ResID { id: String },
ResUUID { uuid: String },
ResGameVersion { version: String },
ResStatus { status: PINEStatus },
ResUnimplemented
}