Nes6502

Struct Nes6502 

Source
pub struct Nes6502 {
Show 40 fields pub vcc: Pin, pub gnd: Pin, pub rst: Pin, pub out0: Pin, pub out1: Pin, pub out2: Pin, pub oe1: Pin, pub oe2: Pin, pub rw: Pin, pub nmi: Pin, pub irq: Pin, pub m2: Pin, pub tst: Pin, pub clk: Pin, pub ad1: Pin, pub ad2: Pin, pub a0: Pin, pub a1: Pin, pub a2: Pin, pub a3: Pin, pub a4: Pin, pub a5: Pin, pub a6: Pin, pub a7: Pin, pub a8: Pin, pub a9: Pin, pub a10: Pin, pub a11: Pin, pub a12: Pin, pub a13: Pin, pub a14: Pin, pub a15: Pin, pub d0: Pin, pub d1: Pin, pub d2: Pin, pub d3: Pin, pub d4: Pin, pub d5: Pin, pub d6: Pin, pub d7: Pin, /* private fields */
}
Expand description

https://www.nesdev.org/wiki/CPU_pinout Without the APU part yet
Neither the interrupt handling and decimal mode
WARNING: Not cycle accurate yet!

        .--\/--.
 AD1 <- |01  40| -- +5V
 AD2 <- |02  39| -> OUT0
/RST -> |03  38| -> OUT1
 A00 <- |04  37| -> OUT2
 A01 <- |05  36| -> /OE1
 A02 <- |06  35| -> /OE2
 A03 <- |07  34| -> R/W
 A04 <- |08  33| <- /NMI
 A05 <- |09  32| <- /IRQ
 A06 <- |10  31| -> M2
 A07 <- |11  30| <- TST (usually GND)
 A08 <- |12  29| <- CLK
 A09 <- |13  28| <> D0
 A10 <- |14  27| <> D1
 A11 <- |15  26| <> D2
 A12 <- |16  25| <> D3
 A13 <- |17  24| <> D4
 A14 <- |18  23| <> D5
 A15 <- |19  22| <> D6
 GND -- |20  21| <> D7
        `------'

Fields§

§vcc: Pin§gnd: Pin§rst: Pin§out0: Pin§out1: Pin§out2: Pin§oe1: Pin§oe2: Pin§rw: Pin§nmi: Pin§irq: Pin§m2: Pin§tst: Pin§clk: Pin§ad1: Pin§ad2: Pin§a0: Pin§a1: Pin§a2: Pin§a3: Pin§a4: Pin§a5: Pin§a6: Pin§a7: Pin§a8: Pin§a9: Pin§a10: Pin§a11: Pin§a12: Pin§a13: Pin§a14: Pin§a15: Pin§d0: Pin§d1: Pin§d2: Pin§d3: Pin§d4: Pin§d5: Pin§d6: Pin§d7: Pin

Implementations§

Source§

impl Nes6502

Source

pub const VCC: usize = 40usize

Source

pub const GND: usize = 20usize

Source

pub const RST: usize = 3usize

Source

pub const OUT0: usize = 39usize

Source

pub const OUT1: usize = 38usize

Source

pub const OUT2: usize = 37usize

Source

pub const OE1: usize = 36usize

Source

pub const OE2: usize = 35usize

Source

pub const RW: usize = 34usize

Read/write signal, which is used to indicate operations of the same names. Low is write. R/W stays high/low during the entire read/write cycle.

Source

pub const NMI: usize = 33usize

Non-maskable interrupt pin. See the 6502 manual and CPU interrupts for more details.

Source

pub const IRQ: usize = 32usize

Interrupt pin. See the 6502 manual and CPU interrupts for more details

Source

pub const M2: usize = 31usize

Source

pub const TST: usize = 30usize

Source

pub const CLK: usize = 29usize

Source

pub const AD1: usize = 1usize

Source

pub const AD2: usize = 2usize

Source

pub const A0: usize = 4usize

Source

pub const A1: usize = 5usize

Source

pub const A2: usize = 6usize

Source

pub const A3: usize = 7usize

Source

pub const A4: usize = 8usize

Source

pub const A5: usize = 9usize

Source

pub const A6: usize = 10usize

Source

pub const A7: usize = 11usize

Source

pub const A8: usize = 12usize

Source

pub const A9: usize = 13usize

Source

pub const A10: usize = 14usize

Source

pub const A11: usize = 15usize

Source

pub const A12: usize = 16usize

Source

pub const A13: usize = 17usize

Source

pub const A14: usize = 18usize

Source

pub const A15: usize = 19usize

Source

pub const D0: usize = 28usize

Source

pub const D1: usize = 27usize

Source

pub const D2: usize = 26usize

Source

pub const D3: usize = 25usize

Source

pub const D4: usize = 24usize

Source

pub const D5: usize = 23usize

Source

pub const D6: usize = 22usize

Source

pub const D7: usize = 21usize

Source§

impl Nes6502

Source

pub fn set_addr(&mut self, addr: u16)

Source

pub fn set_data(&mut self, data: u8)

Source

pub fn get_data(&self) -> u8

Trait Implementations§

Source§

impl Chip for Nes6502

Source§

fn list_pins(&self) -> Vec<(PinId, &Pin)>

Source§

fn get_pin(&self, pin: PinId) -> Option<&Pin>

Source§

fn get_pin_mut(&mut self, pin: PinId) -> Option<&mut Pin>

Source§

impl ChipBuilder<ChipSet> for Nes6502

Source§

impl ChipRunner for Nes6502

Source§

fn run(&mut self, _: Duration)

Source§

impl Clone for Nes6502

Source§

fn clone(&self) -> Nes6502

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Nes6502

Source§

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

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

impl<'de> Deserialize<'de> for Nes6502

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Nes6502

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToString for Nes6502

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,