Struct rustzx_core::Emulator
source · pub struct Emulator<H: Host> { /* private fields */ }
Expand description
Represents main Emulator structure
Implementations§
source§impl<H: Host> Emulator<H>
impl<H: Host> Emulator<H>
sourcepub fn new(settings: RustzxSettings, context: H::Context) -> Result<Self>
pub fn new(settings: RustzxSettings, context: H::Context) -> Result<Self>
sourcepub fn set_speed(&mut self, new_speed: EmulationMode)
pub fn set_speed(&mut self, new_speed: EmulationMode)
changes emulation speed
sourcepub fn set_fast_load(&mut self, value: bool)
pub fn set_fast_load(&mut self, value: bool)
changes fast loading flag
pub fn load_snapshot( &mut self, snapshot: Snapshot<impl SnapshotAsset> ) -> Result<()>
pub fn save_snapshot<R>(&mut self, recorder: SnapshotRecorder<R>) -> Result<()>where R: DataRecorder,
pub fn load_tape(&mut self, tape: Tape<H::TapeAsset>) -> Result<()>
pub fn load_rom(&mut self, rom: impl RomSet) -> Result<()>
pub fn load_screen(&mut self, screen: Screen<impl ScreenAsset>) -> Result<()>
pub fn play_tape(&mut self)
pub fn stop_tape(&mut self)
sourcepub fn rewind_tape(&mut self) -> Result<()>
pub fn rewind_tape(&mut self) -> Result<()>
Rewinds tape. May return error if underlying tape asset failed to perform seek operation to go back to the the beginning of the tape
pub fn screen_buffer(&self) -> &H::FrameBuffer
pub fn set_io_extender(&mut self, extender: H::IoExtender)
pub fn io_extender(&mut self) -> Option<&mut H::IoExtender>
sourcepub fn set_debug_interface(&mut self, debug_interface: H::DebugInterface)
pub fn set_debug_interface(&mut self, debug_interface: H::DebugInterface)
Sets Host::DebugInterface for the emulator instance
sourcepub fn debug_interface(&mut self) -> Option<&mut H::DebugInterface>
pub fn debug_interface(&mut self) -> Option<&mut H::DebugInterface>
Returns current Host::DebugInterface instance
pub fn border_color(&self) -> ZXColor
pub fn send_key(&mut self, key: ZXKey, pressed: bool)
pub fn send_compound_key(&mut self, key: CompoundKey, pressed: bool)
pub fn send_kempston_key(&mut self, key: KempstonKey, pressed: bool)
pub fn send_sinclair_key( &mut self, num: SinclairJoyNum, key: SinclairKey, pressed: bool )
pub fn send_mouse_wheel(&mut self, dir: KempstonMouseWheelDirection)
pub fn send_mouse_pos_diff(&mut self, x: i8, y: i8)
sourcepub fn execute_poke(&mut self, poke: impl Poke)
pub fn execute_poke(&mut self, poke: impl Poke)
Execute poke::Poke
action on the emulator
sourcepub fn emulate_frames(
&mut self,
emulation_limit: Duration
) -> Result<EmulationInfo>
pub fn emulate_frames( &mut self, emulation_limit: Duration ) -> Result<EmulationInfo>
Perform emulatio up to emulation_limit
duration, returns actual elapsed duration