Skip to content

rc_client_serialize_progress

Jamiras edited this page Mar 1, 2024 · 3 revisions

Serializes the current state of the runtime into a buffer.

Syntax

// 11.2+
int rc_client_serialize_progress_sized(
    rc_client_t* client,
    uint8_t* buffer,
    size_t buffer_size
);

// [deprecated]
int rc_client_serialize_progress(
    rc_client_t* client,
    uint8_t* buffer
);

Parameters

client

The rc_client_t containing a loaded game.

buffer

The buffer to write the serialized data into. It must hold at least as many bytes as specified by the return value of rc_client_progress_size.

buffer_size

The actual size of buffer (in bytes).

Return value

RC_OK on success, or an error code indicating failure.

result description
RC_OK The runtime data was successfully serialized into buffer.
RC_NO_GAME_LOADED No game is loaded.
RC_INVALID_STATE No buffer was provided.
RC_INSUFFICIENT_BUFFER The provided buffer was not large enough.

Remarks

The runtime state must be captured any time the emulator captures its own state (i.e. save states, rewind buffers, and network synchronization). Similarly, it must be restored whenever the emulator state is restored.

This function requires a buffer of sufficient size to be provided (see rc_client_progress_size). If the provided buffer is too small, it will write past the end of the buffer.

Minimum version: 11.0.0

See also

rc_client_deserialize_progress

rc_client_progress_size

rcheevos

rc_client

Integration guide

client

user

game

processing

rc_client_raintegration

Integration guide

rc_runtime

rhash

rapi

common

user

runtime

info

Clone this wiki locally