pub fn parse_ram_banks(&self) -> Option<(usize, usize)> {

        let model = models::from_id(self.rom_byte(offsets::TYPE as u16));

        // Special case for MBC2, the RAM_SIZE field is not
        // trustworthy here (it advertises 0 banks but there's still
        // some RAM on the cartridge).
        if model.name == "MBC2" {
            // MBC2 contains 1 "bank" of 256bytes
            return Some((1, 256));
        }

        let id = self.rom_byte(offsets::RAM_SIZE as u16);

        let (nbanks, bank_size_kb) =
            match id {
                0x00 => (0,  0),
                0x01 => (1,  2),
                0x02 => (1,  8),
                0x03 => (4,  8),
                0x04 => (16, 8),
                // Unknown value
                _    => return None,
            };

        Some((nbanks, bank_size_kb * 1024))
    }
/// Return the number of RAM banks for this ROM along with the
/// size of each bank in bytes.
Return the number of RAM banks for this ROM along with the
size of each bank in bytes.
Return the number of RAM banks for this ROM along with the size of each bank in bytes .
pub fn parse_ram_banks(&self) -> Option<(usize, usize)> {
        let model = models::from_id(self.rom_byte(offsets::TYPE as u16));
        // Special case for MBC2, the RAM_SIZE field is not
        // trustworthy here (it advertises 0 banks but there's still
        // some RAM on the cartridge).
        if model.name == "MBC2" {
            // MBC2 contains 1 "bank" of 256bytes
            return Some((1, 256));
        }
        let id = self.rom_byte(offsets::RAM_SIZE as u16);
        let (nbanks, bank_size_kb) =
            match id {
                0x00 => (0,  0),
                0x01 => (1,  2),
                0x02 => (1,  8),
                0x03 => (4,  8),
                0x04 => (16, 8),
                // Unknown value
                _    => return None,
            };
        Some((nbanks, bank_size_kb * 1024))
    }
pub fn parse_ram_banks ( & self ) -> Option < ( usize , usize ) > { let model = models :: from_id ( self . rom_byte ( offsets :: TYPE as u16 ) ) ; // Special case for MBC2, the RAM_SIZE field is not // trustworthy here (it advertises 0 banks but there's still // some RAM on the cartridge). if model . name == " " { // MBC2 contains 1 "bank" of 256bytes return Some ( ( 1 , 256 ) ) ; } let id = self . rom_byte ( offsets :: RAM_SIZE as u16 ) ; let ( nbanks , bank_size_kb ) = match id { 0x00 => ( 0 , 0 ) , 0x01 => ( 1 , 2 ) , 0x02 => ( 1 , 8 ) , 0x03 => ( 4 , 8 ) , 0x04 => ( 16 , 8 ) , // Unknown value _ => return None , } ; Some ( ( nbanks , bank_size_kb * 1024 ) ) }
Return the number of RAM banks for this ROM along with the
size of each bank in bytes.
Return the number of RAM banks for this ROM along with the size of each bank in bytes .
&self
&self