pub struct InitContext<'a> {
pub(crate) environment_callback: &'a retro_environment_t,
pub(crate) interfaces: Arc<RwLock<InterfaceList>>,
}
Expand description
Functions that are safe to be called in Core::on_init
Fields§
§environment_callback: &'a retro_environment_t
§interfaces: Arc<RwLock<InterfaceList>>
Implementations§
Source§impl<'a> InitContext<'a>
impl<'a> InitContext<'a>
pub(crate) fn new( environment_callback: &'a retro_environment_t, interfaces: Arc<RwLock<InterfaceList>>, ) -> Self
Source§impl InitContext<'_>
impl InitContext<'_>
Sourcepub fn get_rumble_interface(&self) -> Option<retro_rumble_interface>
pub fn get_rumble_interface(&self) -> Option<retro_rumble_interface>
Gets an interface which is used by a libretro core to set
state of rumble motors in controllers.
A strong and weak motor is supported, and they can be
controlled indepedently.
Should be called from either Core::on_init
or Core::on_load_game
.
Should not be called from Core::on_set_environment
.
Returns false if rumble functionality is unavailable.
Source§impl InitContext<'_>
impl InitContext<'_>
Sourcepub unsafe fn set_memory_maps(&self, data: retro_memory_map) -> bool
pub unsafe fn set_memory_maps(&self, data: retro_memory_map) -> bool
Unstable This environment call lets a libretro core tell the frontend about the memory maps this core emulates. This can be used to implement, for example, cheats in a core-agnostic way.
Should only be used by emulators; it doesn’t make much sense for anything else. It is recommended to expose all relevant pointers through retro_get_memory_* as well.
Can be called from Core::on_init
and Core::on_load_game
.
§This feature is unstable and guarded by the unstable-env-commands
feature flag.
Please be advised that this feature might change without further notice and no guarantees about its stability can be made.
Source§impl InitContext<'_>
impl InitContext<'_>
Sourcepub unsafe fn set_support_achievements(&self, value: bool) -> bool
pub unsafe fn set_support_achievements(&self, value: bool) -> bool
Unstable If true, the Core implementation supports achievements.
Either via memory descriptors set with RETRO_ENVIRONMENT_SET_MEMORY_MAPS
or via Core::get_memory_data
/ Core::get_memory_size
.
§This feature is unstable and guarded by the unstable-env-commands
feature flag.
Please be advised that this feature might change without further notice and no guarantees about its stability can be made.
Source§impl InitContext<'_>
impl InitContext<'_>
Sourcepub fn set_serialization_quirks(&self, quirks: SerializationQuirks) -> bool
pub fn set_serialization_quirks(&self, quirks: SerializationQuirks) -> bool
Sets quirk flags associated with serialization. The frontend will zero any flags it doesn’t recognize or support.
Should be set in either Core::on_init
or Core::on_load_game
, but not both.