use crate::constants::constants_system::SIZE_64KB;
use crate::instruction::Instruction;
use crate::mos6502cpu::tick_stages::Mos6502TickStates;
use crate::mos6502flags::Mos6502Flags;
use crate::op_info::OpInfo;

pub mod cpu;
pub mod new;
pub mod tick2;
pub mod dbg;
pub mod tick_stages;
pub mod default;
pub mod bus_device;

pub struct Mos6502Cpu {
    pub(crate) memory: [u8; SIZE_64KB],
    /// accumulator
    pub(crate) a: u8,
    /// x register
    pub(crate) x: u8,
    /// y register
    pub(crate) y: u8,
    /// cpu flags
    pub(crate) flags: Mos6502Flags,
    /// program counter
    pub pc: u16,
    /// stack offset
    pub(crate) s: u8,
    pub microcode_step: u8,
    pub(crate) address_bus: u16,
    pub(crate) data_bus: u8,
    pub(crate) ir: Instruction, // Instruction Register
    pub(crate) oi: OpInfo,
    pub(crate) has_reset: bool,
    pub(crate) iv: u16,          // Interrupt Vector
    pub(crate) cycle_carry: u16, // Value to hold between microsteps
    pub(crate) ir_bytes: [u8; 4],
    /// CPU Read signal
    pub read_signal: bool,
    pub(crate) reset_vector: u16,
    pub(crate) int_vector: u16,
    pub(crate) nmi_vector: u16,
    pub tick_stage: Mos6502TickStates
}
