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
impl Emu
Sourcepub fn from_rom(bytes: &[u8]) -> Result<Self, RomError>
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.
Sourcepub fn from_rom_with_sample_rate(
bytes: &[u8],
sample_rate: u32,
) -> Result<Self, RomError>
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.