use log::debug;
use crate::periph::mos6530::Mos6530;
use crate::traits::rom_chip::RomChip;

impl RomChip for Mos6530 {
    fn program(new_data: &[u8]) -> Box<Self> {
        debug!("🐙 programming {}b to ROM", new_data.len());
        Box::new(Mos6530 {
            data: new_data.to_vec().try_into().unwrap(),
            ram: [0x00; 64],
            port_a: 0,
            ddra: 0,
            in_a: 0,
            out_a: 0,
            port_b: 0,
            ddrb: 0,
            in_b: 0,
            out_b: 0,
            data_bus: 0,
            address_bus: 0,
            cs1: false,
            cs2: false,
            rw: false,
            reset: false,
            io_offset: 0,
            ram_offset: 0,
            rom_offset: 0,
        })
    }
}