This commit is contained in:
Alex Janka 2023-05-18 10:32:54 +10:00
parent 087bef7dc4
commit f90c50ef1d
3 changed files with 3 additions and 15 deletions

View file

@ -182,11 +182,7 @@ impl Mbc for Mbc3 {
rtc.latched_time = Some(Instant::now()); rtc.latched_time = Some(Instant::now());
} }
if data == 0x00 { rtc.latch_prepared = data == 0x00;
rtc.latch_prepared = true;
} else {
rtc.latch_prepared = false;
}
} }
} }
_ => panic!("unsupported addr"), _ => panic!("unsupported addr"),

View file

@ -73,11 +73,7 @@ impl Mbc for Mbc5 {
fn set(&mut self, address: RomAddress, data: u8) { fn set(&mut self, address: RomAddress, data: u8) {
match address.inner() { match address.inner() {
0x0..0x2000 => { 0x0..0x2000 => {
if (data & 0xF) == 0xA { self.ram_enabled = (data & 0xF) == 0xA;
self.ram_enabled = true
} else {
self.ram_enabled = false
}
} }
0x2000..0x3000 => self.rom_bank = (self.rom_bank & 0x100) | (data as u16), 0x2000..0x3000 => self.rom_bank = (self.rom_bank & 0x100) | (data as u16),
0x3000..0x4000 => self.rom_bank = (self.rom_bank & 0xFF) | ((data as u16 & 0b1) << 8), 0x3000..0x4000 => self.rom_bank = (self.rom_bank & 0xFF) | ((data as u16 & 0b1) << 8),

View file

@ -134,11 +134,7 @@ where
self.check_for_new_image(); self.check_for_new_image();
match address.inner() { match address.inner() {
0x0..0x2000 => { 0x0..0x2000 => {
if (data & 0xF) == 0xA { self.ram_enabled = (data & 0xF) == 0xA;
self.ram_enabled = true
} else {
self.ram_enabled = false
}
} }
0x2000..0x4000 => { 0x2000..0x4000 => {
if data < 0x40 { if data < 0x40 {