16 lines
259 B
Rust
16 lines
259 B
Rust
|
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]
|
||
|
}
|
||
|
}
|