title name w/mbc is more descriptive
This commit is contained in:
parent
aeba27f6cf
commit
5989a1a49f
|
@ -99,7 +99,7 @@ fn main() {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut window = Window::new(
|
let mut window = Window::new(
|
||||||
format!("{} on MBC: {}", rom.get_title(), rom.mbc_type()).as_str(),
|
format!("{} on {}", rom.get_title(), rom.mbc_type()).as_str(),
|
||||||
WIDTH * FACTOR,
|
WIDTH * FACTOR,
|
||||||
HEIGHT * FACTOR,
|
HEIGHT * FACTOR,
|
||||||
WindowOptions::default(),
|
WindowOptions::default(),
|
||||||
|
|
|
@ -57,7 +57,7 @@ impl Rom {
|
||||||
self.mbc.set_ram(address, data);
|
self.mbc.set_ram(address, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mbc_type(&self) -> &str {
|
pub fn mbc_type(&self) -> String {
|
||||||
self.mbc.mbc_type()
|
self.mbc.mbc_type()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ pub(super) trait Mbc {
|
||||||
fn get_ram(&self, address: Address) -> u8;
|
fn get_ram(&self, address: Address) -> u8;
|
||||||
fn set(&mut self, address: Address, data: u8);
|
fn set(&mut self, address: Address, data: u8);
|
||||||
fn set_ram(&mut self, address: Address, data: u8);
|
fn set_ram(&mut self, address: Address, data: u8);
|
||||||
fn mbc_type(&self) -> &str;
|
fn mbc_type(&self) -> String;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) struct None {
|
pub(super) struct None {
|
||||||
|
@ -31,8 +31,8 @@ impl Mbc for None {
|
||||||
|
|
||||||
fn set(&mut self, _address: Address, _data: u8) {}
|
fn set(&mut self, _address: Address, _data: u8) {}
|
||||||
|
|
||||||
fn mbc_type(&self) -> &str {
|
fn mbc_type(&self) -> String {
|
||||||
"None"
|
String::from("None")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,8 +155,12 @@ impl Mbc for Mbc1 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mbc_type(&self) -> &str {
|
fn mbc_type(&self) -> String {
|
||||||
"MBC1"
|
if let Some(ram) = &self.ram {
|
||||||
|
format!("{}KB MBC1 with {}KB RAM", self.rom_len / KB, ram.len() / KB)
|
||||||
|
} else {
|
||||||
|
format!("{}KB MBC1", self.rom_len / KB)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue