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
Auto Trait Implementations§
impl<H> Freeze for Emulator<H>where
<H as Host>::FrameBuffer: Freeze,
<H as Host>::IoExtender: Freeze,
<H as Host>::DebugInterface: Freeze,
<H as Host>::TapeAsset: Freeze,
impl<H> RefUnwindSafe for Emulator<H>where
<H as Host>::FrameBuffer: RefUnwindSafe,
<H as Host>::IoExtender: RefUnwindSafe,
<H as Host>::DebugInterface: RefUnwindSafe,
<H as Host>::TapeAsset: RefUnwindSafe,
impl<H> Send for Emulator<H>where
<H as Host>::FrameBuffer: Send,
<H as Host>::IoExtender: Send,
<H as Host>::DebugInterface: Send,
<H as Host>::TapeAsset: Send,
impl<H> Sync for Emulator<H>where
<H as Host>::FrameBuffer: Sync,
<H as Host>::IoExtender: Sync,
<H as Host>::DebugInterface: Sync,
<H as Host>::TapeAsset: Sync,
impl<H> Unpin for Emulator<H>where
<H as Host>::FrameBuffer: Unpin,
<H as Host>::IoExtender: Unpin,
<H as Host>::DebugInterface: Unpin,
<H as Host>::TapeAsset: Unpin,
impl<H> UnwindSafe for Emulator<H>where
<H as Host>::FrameBuffer: UnwindSafe,
<H as Host>::IoExtender: UnwindSafe,
<H as Host>::DebugInterface: UnwindSafe,
<H as Host>::TapeAsset: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more