use crate::periph::mos6532::Mos6532;
use crate::traits::bus_device::BusDevice;

impl BusDevice for Mos6532 {
    fn min_offset(&self) -> u16 {
        self.ram_offset.min(self.io_offset)
    }

    fn max_offset(&self) -> u16 { self.min_offset() + 0x40 }

    fn address_bus(&self) -> u16 {
        self.address_bus
    }

    fn data_bus(&self) -> u8 {
        self.data_bus
    }

    fn set_address_bus(&mut self, new_value: u16) {
        self.address_bus = new_value
    }

    fn set_data_bus(&mut self, new_value: u8) {
        self.data_bus = new_value
    }
}