feat: implement cartridge saving

Implemented for MBC1, MBC2, MBC3 and MBC5
This commit is contained in:
2021-09-20 04:13:25 -03:00
parent e1fe00ab64
commit ce121864d2
6 changed files with 263 additions and 8 deletions

View File

@@ -90,6 +90,16 @@ impl Bus {
pub(crate) fn joyp_mut(&mut self) -> &mut Joypad {
&mut self.joypad
}
#[inline]
pub(crate) fn cart(&self) -> Option<&Cartridge> {
self.cart.as_ref()
}
#[inline]
pub(crate) fn cart_mut(&mut self) -> Option<&mut Cartridge> {
self.cart.as_mut()
}
}
impl Bus {