libretro.drivers.content.standard¶
The standard content driver that loads game files from disk or memory.
See also
libretro.api.contentDefines the game info structures and content loading types this driver handles.
Classes
A |
- class StandardContentDriver[source]¶
Bases:
ContentDriverA
ContentDriverthat loads content from files on disk or from memory buffers.- property enable_extended_info¶
Whether to populate and expose
retro_game_info_extto the core viaRETRO_ENVIRONMENT_GET_GAME_INFO_EXT.
- property game_info_ext¶
The most recently loaded extended game info array, or
Noneif extended info is disabled or no content has been loaded.
- load(content)[source]¶
Load all content files.
- Parameters:
content (
TypeAliasType|SubsystemContent|None) –May be one of the following:
None, which will result in no content being loaded.A
zipfile.Pathobject representing a file within a ZIP archive.A
stror aPathLikeobject representing a file path. The loaded content will not be part of a subsystem. Ifretro_system_info.need_fullpathisFalseand no override for this extension definesContentAttributes.need_fullpathasTrue, the driver will load the content as a file. Otherwise, the path will be provided to the core without opening the file.A
bytes,bytearray,memoryview, orBufferobject that represents content data. The loaded content will be passed directly to the core without being set to a path.A
retro_game_infoobject, which will be passed to the core as-is.A
SubsystemContentobject, which contains multiple content files that together form a subsystem.
- Raises:
FileNotFoundError – If
contentis a path to a non-existent file.ContentError – If loading
Noneand the core requires content, or ifcontentis aretro_game_infowhose attributes are inconsistent withneed_fullpathandblock_extract.RuntimeError – If called before
system_infois set.
- Return type:
Generator[tuple[retro_subsystem_info|None,Sequence[LoadedContentFile] |None]]- Returns:
A context manager that yields a tuple containing the subsystem info and a sequence of loaded content files. Non-persistent content files will be closed when the context manager exits.
Note
All files not marked as persistent will be closed when the context manager exits. The ones that are persistent will be closed when the driver is destroyed.
- property system_info¶
The system info provided by the core.
See also
Core.get_system_info()The method that cores use to provide this information.
- property subsystem_info¶
Subsystem descriptors registered by the core, or
Noneif none were registered.
- property support_no_game¶
Whether the core supports being run without any content.
Noneif the core has not calledRETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME.
- property overrides¶
Per-extension content-info overrides registered by the core.
- classmethod __new__(*args, **kwargs)¶