use crate::processor::memory::Address; pub(super) trait MBC { fn get(&self, address: Address) -> u8; fn set(&mut self, address: Address, data: u8); } pub(super) struct NONE { pub(super) data: Vec, } impl MBC for NONE { fn get(&self, address: Address) -> u8 { self.data[address as usize] } fn set(&mut self, address: Address, data: u8) { return; } } pub(super) struct MBC1 { pub(super) data: Vec, } impl MBC for MBC1 { fn get(&self, address: Address) -> u8 { self.data[address as usize] } fn set(&mut self, address: Address, data: u8) { return; } }