Skip to content

rc_runtime_serialize_progress

Jamiras edited this page Mar 1, 2024 · 2 revisions

Captures the current state of the runtime.

Syntax

// 11.2+
int rc_runtime_serialize_progress_sized(
    uint8_t* buffer,
    uint32_t buffer_size
    const rc_runtime_t* runtime,
    lua_State* L
);

// [deprecated]
int rc_runtime_serialize_progress(
    void* buffer,
    const rc_runtime_t* runtime,
    lua_State* L
);

Parameters

buffer

A block of memory where the serialized state should be written. Call rc_runtime_progress_size to determine how large the block of memory must be. Using a block that is not large enough will result in memory corruption.

buffer_size

The actual size of buffer (in bytes).

runtime

Pointer to the runtime state object that will have its progress captured.

L (NOT USED)

A pointer to a lua_State that contains the LUA functions needed by the runtime. May be NULL if the runtime does not use LUA functions.

Return value

If the function succeeds, the return value is RC_OK. Otherwise, the error code can be converted to a string using rc_error_str.

Remarks

Should be used to capture the current state of the runtime any time the current state of the emulator is captured (i.e. when save states are written). When the emulator state is restored (i.e. save state loaded), the runtime state should also be restored by calling rc_runtime_deserialize_progress.

Minimum version: 9.0.0

See also

rc_runtime_progress_size

rc_runtime_deserialize_progress

rc_runtime_init

rc_runtime_do_frame

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