mbc name
This commit is contained in:
parent
ad51d4173a
commit
c3c02fa539
|
@ -124,7 +124,7 @@ fn main() {
|
|||
};
|
||||
|
||||
let mut window = Window::new(
|
||||
format!("{}", rom.get_title()).as_str(),
|
||||
format!("{} on MBC: {}", rom.get_title(), rom.mbc_type()).as_str(),
|
||||
WIDTH * FACTOR,
|
||||
HEIGHT * FACTOR,
|
||||
WindowOptions::default(),
|
||||
|
|
|
@ -43,4 +43,8 @@ impl ROM {
|
|||
pub(super) fn set(&mut self, address: Address, data: u8) {
|
||||
self.mbc.set(address, data);
|
||||
}
|
||||
|
||||
pub fn mbc_type(&self) -> &str {
|
||||
self.mbc.mbc_type()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ use crate::processor::memory::Address;
|
|||
pub(super) trait MBC {
|
||||
fn get(&self, address: Address) -> u8;
|
||||
fn set(&mut self, address: Address, data: u8);
|
||||
fn mbc_type(&self) -> &str;
|
||||
}
|
||||
|
||||
pub(super) struct NONE {
|
||||
|
@ -23,6 +24,10 @@ impl MBC for NONE {
|
|||
fn set(&mut self, _address: Address, _data: u8) {
|
||||
return;
|
||||
}
|
||||
|
||||
fn mbc_type(&self) -> &str {
|
||||
"None"
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
|
@ -108,4 +113,8 @@ impl MBC for MBC1 {
|
|||
self.rom_bank = (self.rom_bank as usize % self.num_banks) as u8;
|
||||
return;
|
||||
}
|
||||
|
||||
fn mbc_type(&self) -> &str {
|
||||
"MBC1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue