libretro.drivers.disk.driver

Protocol definition for the emulated disk-control interface.

See also

libretro.api.disk

The matching ctypes types and callback definitions.

Classes

DiskDriver

Protocol for drivers that expose the emulated system's disk-control interface.

class DiskDriver[source]

Bases: Protocol

Protocol for drivers that expose the emulated system’s disk-control interface.

See also

libretro.api.disk

The matching ctypes types and callback definitions.

abstract property version

The version of the disk-control interface registered by the core.

Returns 1 if the core registered a retro_disk_control_callback via RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE, 2 if it registered a retro_disk_control_ext_callback via RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE, and 0 if no callback has been registered.

abstract property callback

The disk-control callback registered by the core, if any.

The concrete type reflects which env-call the core used to register it. None if the core has not registered a disk-control interface.

Parameters:

value – The callback to register. Use retro_disk_control_callback for v1 and retro_disk_control_ext_callback for v2.

Raises:

UnsupportedEnvCall – If this driver does not accept disk-control callbacks of the given type.

See also

retro_disk_control_callback

The v1 callback struct registered via RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE.

retro_disk_control_ext_callback

The v2 callback struct registered via RETRO_ENVIRONMENT_SET_DISK_CONTROL_EXT_INTERFACE.

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

Whether the emulated disk tray is currently open.

Reads and writes pass through to retro_disk_control_callback.get_eject_state and retro_disk_control_callback.set_eject_state respectively.

Parameters:

valueTrue to open the tray, False to close it.

Raises:

UnsupportedEnvCall – If no disk-control callback has been registered.