libretro.drivers.timing.driver

Protocol definition for frame and audio timing drivers.

See also

libretro.api.timing

The matching ctypes types and callback definitions.

Classes

TimingDriver

Protocol for drivers that expose frame and audio timing information to a core.

class TimingDriver[source]

Bases: Protocol

Protocol for drivers that expose frame and audio timing information to a core.

See also

libretro.api.timing

The matching ctypes types and callback definitions.

abstract property frame_time_callback

The frame-time callback registered by the core, if any.

Set via RETRO_ENVIRONMENT_SET_FRAME_TIME_CALLBACK. None if the core has not registered one.

Parameters:

value – The frame-time callback to register.

Raises:

UnsupportedEnvCall – If this driver does not support the frame-time callback.

See also

retro_frame_time_callback

The C struct registered by the core that contains this callback.

frame_time(time)[source]

Invoke the registered frame_time_callback, if any.

Parameters:

time (int | None) – Microseconds elapsed since the previous frame, or None to use the callback’s configured reference time.

Return type:

None

abstract property fastforwarding_override

The fast-forward override requested by the core, if any.

Set via RETRO_ENVIRONMENT_SET_FASTFORWARDING_OVERRIDE.

Parameters:

value – The fast-forward override to register.

Raises:

UnsupportedEnvCall – If this driver does not support fast-forward overrides.

See also

retro_fastforwarding_override

The C struct describing the override.

__init__(*args, **kwargs)
classmethod __new__(*args, **kwargs)
abstract property throttle_state

The current throttle state reported to the core.

Returned to the core in response to RETRO_ENVIRONMENT_GET_THROTTLE_STATE.

Parameters:

value – The throttle state to report.

Raises:

UnsupportedEnvCall – If this driver does not report a throttle state.

See also

retro_throttle_state

The C struct describing the throttle state.

abstract property target_refresh_rate

The frontend’s target refresh rate in Hz, if any.

Returned to the core in response to RETRO_ENVIRONMENT_GET_TARGET_REFRESH_RATE. None if no target refresh rate is configured.

Parameters:

value – The target refresh rate in Hz.

Raises:

UnsupportedEnvCall – If this driver does not report a target refresh rate.