Skip to content

rc_runtime_do_frame

Jamiras edited this page Jun 16, 2023 · 4 revisions

Updates the runtime for a single frame of emulation.

Syntax

void rc_runtime_do_frame(
    rc_runtime_t* runtime,
    rc_runtime_event_handler_t event_handler,
    rc_peek_t peek,
    void* ud,
    lua_State* L
);

Parameters

runtime

Pointer to the rc_runtime_t object to be processed.

event_handler

Pointer to a function that will be called for each rc_runtime_event_t raised for the current frame.

peek

Pointer to a function that will be called to read memory from the emulator.

ud

Caller provided data to pass to the peek function.

L (NOT USED)

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

Remarks

Must be called once for each frame of emulation.

Minimum version: 9.0.0

See also

rc_runtime_init

rc_runtime_destroy


rc_runtime_event_t

Defines a structure to be passed to the event_handler function passed to rc_runtime_do_frame.

typedef struct rc_runtime_event_t {
  unsigned id;
  int value;
  char type;
}
rc_runtime_event_t;

id

The unique identifier of the record associated to the event.

value

The current value of the leaderboard associated to leaderboard events.

type

The type of event.

Event Type Description
RC_RUNTIME_EVENT_ACHIEVEMENT_TRIGGERED The requirements for the achievement have been met.
RC_RUNTIME_EVENT_ACHIEVEMENT_PRIMED² All non-trigger conditions on a challenge achievement have been met indicating the challenge has begun. A challenge indicator should be shown by the client
RC_RUNTIME_EVENT_ACHIEVEMENT_UNPRIMED² A challenge achievement is no longer about to trigger. The challenge indicator for the achievement should no longer be shown by the client
RC_RUNTIME_EVENT_ACHIEVEMENT_PROGRESS_UPDATED Progress has been made towards a measured achievement. An indicator should be shown for 2 seconds containing the achievement icon and progress. No event will be raised to hide the indicator.
RC_RUNTIME_EVENT_ACHIEVEMENT_ACTIVATED¹ The achievement is applicable to trigger. Raised when transitioning from "waiting" or "paused" to "active".
RC_RUNTIME_EVENT_ACHIEVEMENT_PAUSED¹ The core condition or all alt conditions of the achievement are paused.
RC_RUNTIME_EVENT_ACHIEVEMENT_RESET¹ One or more reset conditions has caused all hit counts on the achievement to be reset.
RC_RUNTIME_EVENT_LBOARD_STARTED A leaderboard attempt has started.
RC_RUNTIME_EVENT_LBOARD_TRIGGERED A leaderboard attempt has been completed.
RC_RUNTIME_EVENT_LBOARD_CANCELED A leaderboard attempt has failed.
RC_RUNTIME_EVENT_LBOARD_UPDATED The value being tracked by the leaderboard has changed.

¹ These events are used by the toolkit for debugging. Most clients won't need to respond to them.

² These events are notifications from the runtime to hide/show the challenge indicator. If an achievement is manually deactivated by rc_runtime_deactivate_achievement, the event will not be raised and the caller will be responsible for hiding the indicator (if present).

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