pub mod mos6522;
pub mod registers;
pub mod new;
pub mod tick;

#[derive(Default)]
pub struct Mos6522 {
    /// data direction
    pub dda: u8,
    pub ddb: u8,

    /// bottom 4 address bits
    pub rs0: u8,
    pub rs1: u8,
    pub rs2: u8,
    pub rs3: u8,

    /// external data bus
    pub data_bus: u8,

    pub cs1: bool,
    pub cs2: bool,
    // when true CPU is reading
    pub rw: bool,

    /// reset circuit - true when reset inited
    pub reset: bool,

    /// IRQ - true when interrupt waiting
    pub irq: bool,

    pub ira: u8,
    pub ora: u8,
    pub porta: u8,
    pub irb: u8,
    pub orb: u8,
    pub portb: u8,

    pub ca1: bool,
    pub ca2: bool,
    pub cb1: bool,
    pub cb2: bool,

    // memory offset for where in the computers memory map this fits
    pub offset: u16,
    pub address_bus: u16,
}
