Skip to main content

ConsoleModel

Enum ConsoleModel 

Source
pub enum ConsoleModel {
    Nes,
    Famicom,
}
Expand description

v2.9.8 — which console wires the PPU’s /RESET line.

The 2C02 is the same chip in every NTSC console; what differs is the board around it. The NESdev “PPU power up state” page (§Famicom, and its closing note on front- and top-loaders) documents two wirings:

  • NES (front-loader, NES-001) — the CPU and PPU are reset together. At power-on and on every press of Reset the PPU spends about 29,658 CPU cycles (NTSC) in its warm-up state, ignoring writes to $2000, $2001, $2005 and $2006, and Reset clears PPUCTRL, PPUMASK, the scroll/address latch and the read buffer.
  • Famicom — the PPU’s /RESET is tied to 5 V and only the CPU’s rides a 0.47 µF capacitor. At power-on the PPU therefore starts initialising roughly one frame before the CPU leaves reset, which is longer than the warm-up window, so the CPU’s first instructions can already write the masked registers. The Reset button reaches only the CPU: the PPU keeps running and keeps its register state.

What this models, and what it does not:

  • Power-on under Self::Famicom closes the warm-up window before the first instruction (rustynes_ppu::Ppu::end_warmup). NESdev gives the lead as “approximately one frame … the exact timing has not been measured, and may vary”, so the PPU’s frame position is left where the NES model puts it rather than advanced by a guessed amount.
  • A warm reset under Self::Famicom leaves the PPU untouched. The APU, DMA unit and cartridge reset exactly as under Self::Nes.
  • The NES-101 top-loader shares the Famicom’s reset wiring, but NESdev does not document its power-on lead, so it is not offered as a separate model.

Off by default. Self::Nes is the model every release before v2.9.8 emulated, so the default build is byte-identical. The selection is a host/config knob, never derived from the ROM: NES 2.0 has no console type that distinguishes a Famicom from an NES, and the project does not guess a console from a per-game list. It is not part of the save-state (the warm-up counter it acts on already is), and like the other hardware knobs on Nes it is re-applied by the host after a load or power-cycle.

Variants§

§

Nes

Default. Front-loading NES: the CPU and PPU share the reset line.

§

Famicom

Famicom: the PPU is never held in reset, so it leaves its warm-up before the CPU starts and ignores the Reset button.

Trait Implementations§

Source§

impl Clone for ConsoleModel

Source§

fn clone(&self) -> ConsoleModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ConsoleModel

Source§

impl Debug for ConsoleModel

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for ConsoleModel

Source§

fn default() -> ConsoleModel

Returns the “default value” for a type. Read more
Source§

impl Eq for ConsoleModel

Source§

impl Hash for ConsoleModel

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ConsoleModel

Source§

fn eq(&self, other: &ConsoleModel) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConsoleModel

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.