libretro.drivers.timing.default

Default TimingDriver used when none is supplied to a session.

See also

TimingDriver

The protocol this driver implements.

Classes

DefaultTimingDriver

The default TimingDriver used when a Session is given no other.

class DefaultTimingDriver[source]

Bases: TimingDriver

The default TimingDriver used when a Session is given no other.

Stores the throttle state and target refresh rate verbatim and reports them to the core unchanged.

See also

TimingDriver

The protocol this class implements.

__init__(throttle_state=None, target_refresh_rate=60.0)[source]

Initialize the driver with optional throttle state and target refresh rate.

Parameters:
  • throttle_state (retro_throttle_state | None) – The throttle state to report to the core, or None if no throttle state should be reported.

  • target_refresh_rate (float | None) – The target refresh rate in Hz to report to the core, or None if no target refresh rate should be reported.

Raises:

TypeError – If throttle_state is neither a retro_throttle_state nor None, or if target_refresh_rate is neither a float nor None.

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.

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.

classmethod __new__(*args, **kwargs)
frame_time(time)

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

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.

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.