gb-emu/src/processor/memory/rom.rs

16 lines
259 B
Rust
Raw Normal View History

2023-02-07 09:19:50 +11:00
use crate::processor::memory::Address;
pub struct ROM {
data: Vec<u8>,
}
impl ROM {
pub fn load(data: Vec<u8>) -> Self {
Self { data }
}
pub(super) fn get(&self, address: Address) -> u8 {
self.data[address as usize]
}
}