use crate::mos6502cpu::Mos6502Cpu;

impl Mos6502Cpu {
    /// dump_data
    ///
    /// returns
    ///     PC, A, X, Y, Address_Bus, Data_Bus, Microcode_Step
    pub fn dump_data(&self) -> (u16, u8, u8, u8, u16, u8, u8, u16, u16, u16) {
        (
            self.pc,
            self.a,
            self.x,
            self.y,
            self.address_bus,
            self.data_bus,
            self.microcode_step,
            self.reset_vector,
            self.int_vector,
            self.nmi_vector
        )
    }

    pub fn dump(&self) {
        println!(
            "CPU State: PC: ${:04x} / A: ${:02x} / X: ${:02x} / Y: ${:02x} / ADDRESS: ${:04x} / DATA: ${:02x} / MICROSTEPS: {:02} / S: {} / NMI: ${:04x} / RST: ${:04x} / INT: ${:04x}",
            self.pc,
            self.a,
            self.x,
            self.y,
            self.address_bus,
            self.data_bus,
            self.microcode_step,
            self.flags.dump(),
            self.nmi_vector,
            self.reset_vector,
            self.int_vector
        );
    }
}
