Emulator

Struct Emulator 

Source
pub struct Emulator<Clock: TimeDaemon> {
Show 16 fields pub cpu_bus: CpuBus, pub acp_bus: AcpBus, pub cpu: W65C02S, pub acp: W65C02S, pub blitter: Blitter, pub clock_cycles_to_vblank: i32, pub last_emu_tick: f64, pub cpu_ns_per_cycle: f64, pub cpu_frequency_hz: f64, pub last_render_time: f64, pub audio_out: Option<GameTankAudio>, pub target_sample_rate: f64, pub play_state: PlayState, pub wait_counter: u64, pub input_state: FnvIndexMap<InputCommand, KeyState, 32>, pub clock: Clock,
}

Fields§

§cpu_bus: CpuBus§acp_bus: AcpBus§cpu: W65C02S§acp: W65C02S§blitter: Blitter§clock_cycles_to_vblank: i32§last_emu_tick: f64§cpu_ns_per_cycle: f64§cpu_frequency_hz: f64§last_render_time: f64§audio_out: Option<GameTankAudio>§target_sample_rate: f64§play_state: PlayState§wait_counter: u64§input_state: FnvIndexMap<InputCommand, KeyState, 32>§clock: Clock

Implementations§

Source§

impl<Clock: TimeDaemon> Emulator<Clock>

Source

pub fn load_rom(&mut self, bytes: &[u8])

Source§

impl<Clock: TimeDaemon> Emulator<Clock>

Source

pub fn wasm_init(&mut self)

Source

pub fn init(clock: Clock, target_sample_rate: f64) -> Self

Source

pub fn process_cycles(&mut self, is_web: bool)

Source

pub fn set_input_state(&mut self, input_command: InputCommand, state: KeyState)

Trait Implementations§

Source§

impl<Clock: TimeDaemon> Debug for Emulator<Clock>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Clock> !Freeze for Emulator<Clock>

§

impl<Clock> !RefUnwindSafe for Emulator<Clock>

§

impl<Clock> Send for Emulator<Clock>
where Clock: Send,

§

impl<Clock> !Sync for Emulator<Clock>

§

impl<Clock> Unpin for Emulator<Clock>
where Clock: Unpin,

§

impl<Clock> !UnwindSafe for Emulator<Clock>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,