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§

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.

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.

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.

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.

Trait Implementations§

Converts to this type from the input type.
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.