Skip to main content

Emu

Enum Emu 

Source
pub enum Emu {
    Single(Box<Nes>),
    Dual(Box<VsDualSystem>),
}
Expand description

The top-level emulator: one standard console, or a Vs. DualSystem pair.

v2.0.0 beta.5 — the API reshape scoped to the major (the plan’s Workstream C/D): a NEW rustynes-core consumer would construct via Emu::from_rom and match on the variant; every existing single-console surface lives unchanged on Nes. rustynes-frontend does NOT yet consume this type — it still constructs Nes directly (Nes::from_rom/from_rom_with_sample_rate), so the DualSystem path is core-and-test-harness-only in this release; wiring the desktop/mobile UI onto Emu (dual-console rendering + 4-port input routing) is explicitly deferred, tracked as a beta.5 known gap (see the beta.5 CHANGELOG entry and docs/audit/vs-dualsystem-combined-dumps-2026-07-02.md for the current disposition).

Variants§

§

Single(Box<Nes>)

A standard single-console system (every cart except the four DualSystem boards).

§

Dual(Box<VsDualSystem>)

A Vs. DualSystem cabinet (two consoles + the cross-wiring).

Implementations§

Source§

impl Emu

Source

pub fn from_rom(bytes: &[u8]) -> Result<Self, RomError>

Construct the right emulator shape for the ROM: a VsDualSystem when the SHA-keyed vs_db flags the cart as a DualSystem board, else a standard Nes.

§Errors

Returns the underlying [RomError] if the bytes don’t parse.

Source

pub fn from_rom_with_sample_rate( bytes: &[u8], sample_rate: u32, ) -> Result<Self, RomError>

Like Self::from_rom, but bakes the frontend’s audio sample rate into the console(s) — the desktop present path uses this so a DualSystem cabinet’s main-console audio resamples to the cpal device rate.

§Errors

Returns the underlying [RomError] if the bytes don’t parse.

Auto Trait Implementations§

§

impl Freeze for Emu

§

impl !RefUnwindSafe for Emu

§

impl Send for Emu

§

impl !Sync for Emu

§

impl Unpin for Emu

§

impl UnsafeUnpin for Emu

§

impl !UnwindSafe for Emu

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<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> Same for T

Source§

type Output = T

Should always be Self
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.