Skip to content

rc_client_set_read_memory_function

Jamiras edited this page Jun 2, 2023 · 2 revisions

Provides a callback for reading memory from the emulator.

Syntax

void rc_client_set_read_memory_function(
    rc_client_t* client,
    rc_client_read_memory_func_t handler
);

Parameters

client

The rc_client_t to associate the handler to.

handler

Function to call to read memory from the emulator


rc_client_read_memory_func_t

uint32_t (*rc_client_read_memory_func_t)(
    uint32_t address,
    uint8_t* buffer,
    uint32_t num_bytes,
    rc_client_t* client
);

address

The RetroAchievements address to begin reading from.

Note that RetroAchievements addresses usually do not accurately represent emulator memory addresses. There is usually a direct mapping though.

buffer

A pointer to a buffer that should be filled.

num_bytes

The number of bytes that should be copied into the buffer.

client

The rc_client_t that's requesting the data.

Return Value

The number of bytes copied into buffer.

If less than num_bytes, the address is marked as invalid and any achievements/leaderboards referencing the address will marked as Unsupported.

Remarks

Minimum version: 11.0.0

See also

rc_client_create

rc_client_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