Skip to content

rc_hash_init_custom_cdreader

Jamiras edited this page Jan 13, 2022 · 3 revisions

Allows the caller to provide their own functionality for reading CDs.

Syntax

void rc_hash_init_custom_cdreader(
    struct rc_hash_cdreader* reader
);

Parameters

reader

Pointer to a rc_hash_cdreader object containing function pointers for overloaded functions.


struct rc_hash_cdreader
{
    rc_hash_cdreader_open_track_handler           open_track;
    rc_hash_cdreader_read_sector_handler          read_sector;
    rc_hash_cdreader_close_track_handler          close_track;
    rc_hash_cdreader_first_track_sector_handler   first_track_sector;
};

open_track

Opens a track for reading (stream should be raw binary). Returns a handle to pass to the other functions.

NOTE: if asked to open track 0, the handler should open the largest data track on the CD.

read_sector

Reads the specified number of bytes from the CD starting at the beginning of the specified sector of the provided track.

close_track

Closes the track.

first_track_sector (Minimum version 10.3.0)

Returns the absolute sector index for the first sector of a track.

Remarks

rcheevos only supports uncompressed file formats (like bin/cue or iso). This allows the caller to also support compressed formats (like CHD) and/or non-file formats (real CDs).

The caller should zero out the structure before assigning its fields in case additional hooks are added in the future.

Minimum version: 9.0.0

See also

rc_hash_init_custom_filereader

rc_hash_generate_from_file

rc_hash_iterate

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