Skip to main content

VsPpuType

Enum VsPpuType 

Source
pub enum VsPpuType {
    None,
    Rp2C03,
    Rp2C04_0001,
    Rp2C04_0002,
    Rp2C04_0003,
    Rp2C04_0004,
    Rc2C05_01,
    Rc2C05_02,
    Rc2C05_03,
    Rc2C05_04,
}
Expand description

Vs. System PPU type from NES 2.0 header byte 13 low nibble.

Only meaningful when the console type (byte 7) is ConsoleType::VsSystem; otherwise VsPpuType::None. Per nesdev “NES 2.0” §Vs. System Type and “PPU registers” §2C05 identifier.

Variants§

§

None

Not a Vs. System cart (the default for NES/Famicom + PlayChoice-10).

§

Rp2C03

$0: any RP2C03/RC2C03 variant.

§

Rp2C04_0001

$2: RP2C04-0001.

§

Rp2C04_0002

$3: RP2C04-0002.

§

Rp2C04_0003

$4: RP2C04-0003.

§

Rp2C04_0004

$5: RP2C04-0004.

§

Rc2C05_01

$8: RC2C05-01 (signature unknown; the sole known game does not check $2002).

§

Rc2C05_02

$9: RC2C05-02 ($2002 AND $3F = $3D).

§

Rc2C05_03

$A: RC2C05-03 ($2002 AND $1F = $1C).

§

Rc2C05_04

$B: RC2C05-04 ($2002 AND $1F = $1B).

Implementations§

Source§

impl VsPpuType

Source

pub const fn from_byte13_low_nibble(nibble: u8) -> Self

Decode the NES 2.0 byte-13 low nibble into a Vs. PPU type. Reserved / unknown nibbles fall back to VsPpuType::Rp2C03 (the most common RGB PPU), matching how most emulators treat unspecified Vs. carts.

Source

pub const fn ppu_palette(self) -> VsPpuPalette

Resolve to the output palette.

Source

pub const fn is_2c05(self) -> bool

True for the 2C05 series ($2000/$2001 swap + $2002 identifier).

Source

pub const fn ppu_2c05_id(self) -> u8

The byte returned in the low 5 bits of $2002 on a 2C05 (0 otherwise).

The 2C05-01 signature is unknown (the only known game, Ninja Jajamaru-kun, never reads it), so it returns 0.

Trait Implementations§

Source§

impl Clone for VsPpuType

Source§

fn clone(&self) -> VsPpuType

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 VsPpuType

Source§

impl Debug for VsPpuType

Source§

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

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

impl Default for VsPpuType

Source§

fn default() -> VsPpuType

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

impl Eq for VsPpuType

Source§

impl Hash for VsPpuType

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 VsPpuType

Source§

fn eq(&self, other: &VsPpuType) -> 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 VsPpuType

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> 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.