Trait RetroCore

Source
pub trait RetroCore {
    const SUPPORT_NO_GAME: bool = false;
Show 16 methods // Required methods fn init(env: &RetroEnvironment) -> Self; fn get_system_info() -> RetroSystemInfo; fn reset(&mut self, env: &RetroEnvironment); fn run(&mut self, env: &RetroEnvironment, runtime: &RetroRuntime); fn load_game( &mut self, env: &RetroEnvironment, game: RetroGame<'_>, ) -> RetroLoadGameResult; // Provided methods fn set_controller_port_device( &mut self, env: &RetroEnvironment, port: u32, device: RetroDevice, ) { ... } fn serialize_size(&self, env: &RetroEnvironment) -> usize { ... } fn serialize( &self, env: &RetroEnvironment, data: *mut (), size: usize, ) -> bool { ... } fn unserialize( &mut self, env: &RetroEnvironment, data: *const (), size: usize, ) -> bool { ... } fn cheat_reset(&mut self, env: &RetroEnvironment) { ... } fn cheat_set( &mut self, env: &RetroEnvironment, index: u32, enabled: bool, code: *const c_char, ) { ... } fn load_game_special( &mut self, env: &RetroEnvironment, game_type: u32, info: RetroGame<'_>, num_info: usize, ) -> bool { ... } fn unload_game(&mut self, env: &RetroEnvironment) { ... } fn get_region(&self, env: &RetroEnvironment) -> RetroRegion { ... } fn get_memory_data(&mut self, env: &RetroEnvironment, id: u32) -> *mut () { ... } fn get_memory_size(&self, env: &RetroEnvironment, id: u32) -> usize { ... }
}

Provided Associated Constants§

Required Methods§

Source

fn init(env: &RetroEnvironment) -> Self

Called when a new instance of the core is needed. The env parameter can be used to set-up and/or query values required for the core to function properly.

Source

fn get_system_info() -> RetroSystemInfo

Called to get information about the core. This information can then be displayed in a frontend, or used to construct core-specific paths.

Source

fn reset(&mut self, env: &RetroEnvironment)

Called when a player resets their game.

Source

fn run(&mut self, env: &RetroEnvironment, runtime: &RetroRuntime)

Called continuously once the core is initialized and a game is loaded. The core is expected to advance emulation by a single frame before returning.

Source

fn load_game( &mut self, env: &RetroEnvironment, game: RetroGame<'_>, ) -> RetroLoadGameResult

Provided Methods§

Source

fn set_controller_port_device( &mut self, env: &RetroEnvironment, port: u32, device: RetroDevice, )

Called to associate a particular device with a particular port. A core is allowed to ignore this request.

Source

fn serialize_size(&self, env: &RetroEnvironment) -> usize

Called to determine the size of the save state buffer. This is only ever called once per run, and the core must not exceed the size returned here for subsequent saves.

Source

fn serialize(&self, env: &RetroEnvironment, data: *mut (), size: usize) -> bool

Allows a core to save its internal state into the specified buffer. The buffer is guaranteed to be at least size bytes, where size is the value returned from serialize_size.

Source

fn unserialize( &mut self, env: &RetroEnvironment, data: *const (), size: usize, ) -> bool

Allows a core to load its internal state from the specified buffer. The buffer is guaranteed to be at least size bytes, where size is the value returned from serialize_size.

Source

fn cheat_reset(&mut self, env: &RetroEnvironment)

Source

fn cheat_set( &mut self, env: &RetroEnvironment, index: u32, enabled: bool, code: *const c_char, )

Source

fn load_game_special( &mut self, env: &RetroEnvironment, game_type: u32, info: RetroGame<'_>, num_info: usize, ) -> bool

Source

fn unload_game(&mut self, env: &RetroEnvironment)

Source

fn get_region(&self, env: &RetroEnvironment) -> RetroRegion

Source

fn get_memory_data(&mut self, env: &RetroEnvironment, id: u32) -> *mut ()

Source

fn get_memory_size(&self, env: &RetroEnvironment, id: u32) -> usize

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§