#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct CpuRegsSnapshot {
    pub pc: u16,
    pub a: u8,
    pub x: u8,
    pub y: u8,
    pub sp: u8,
    pub p: u8,
    pub cycles: u64,
    pub frame_count: u64,
    pub scanline: u16,
    pub pixel: u16,
    pub interrupt: Option<crate::nes::cpu::InterruptKind>,
    pub nmi_vector: u16,
    pub reset_vector: u16,
    pub irq_vector: u16,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CpuDisasmLineSnapshot {
    pub addr: u16,
    pub bytes: Vec<u8>,
    pub text: String,
    pub is_current: bool,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct MemoryWatchEntrySnapshot {
    pub address: u16,
    pub value: u8,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CpuTraceLineSnapshot {
    pub addr: u16,
    pub bytes: Vec<u8>,
    pub text: String,
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DebuggerSnapshot {
    pub cpu_regs: CpuRegsSnapshot,
    pub prg_hexdump_base: u16,
    pub prg_hexdump_bytes: Vec<u8>,
    pub cpu_disasm: Vec<CpuDisasmLineSnapshot>,
    pub cpu: String,
    pub ppu: String,
    pub apu: String,
    /// Raw OAM data: 256 bytes (64 sprites × 4 bytes: Y, tile, attrs, X).
    pub oam: Vec<u8>,
    /// Memory watch entries with live values from CPU address space.
    pub watch_values: Vec<MemoryWatchEntrySnapshot>,
    /// Most recent executed CPU instructions (bounded ring buffer tail).
    pub recent_trace: Vec<CpuTraceLineSnapshot>,
}

#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub struct CpuDisasmWindowState {
    pub(super) start: Option<u16>,
}
