Skip to content

rc_runtime_deserialize_progress

Jamiras edited this page Mar 1, 2024 · 2 revisions

Restores the current state of the runtime.

Syntax

// 11.2+
int rc_runtime_deserialize_progress_sized(
    const rc_runtime_t* runtime,
    const uint8_t* serialized,
    uint32_t serialized_size,
    lua_State* L
);

// [deprecated]
int rc_runtime_deserialize_progress(
    const rc_runtime_t* runtime,
    const uint8_t* serialized,
    lua_State* L
);

Parameters

runtime

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

serialized

A block of memory where the serialized state will be read from. This block should have been previously created by rc_runtime_serialize_progress.

serialized_size

The number of bytes in serialized.

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

This should be used to restore the current state of the runtime any time the current state of the emulator is restored (i.e. after loading a save state). To do so, the runtime state must be captured using rc_runtime_serialize_progress when the emulator state is captured.

Any achievements that have been added or changed since the state was captured will have their hit counts reset to 0 and be reset to the "waiting" state.

If deserialization fails, all achievements will have their hit counts reset to 0 and be reset to the "waiting" state.

Minimum version: 9.0.0

See also

rc_runtime_serialize_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