fn ram_size(header: &[u8; HEADER_LEN]) -> Result<usize, ParseCartridgeError> {
            let code = header[RAM_SIZE];
            match code {
                0 => Ok(0),
                1 => {
                    warn!("2 KiB ram size is unsupported, using 1 8 KiB ram bank instead.");
                    Ok(1)
                }
                2 => Ok(1),
                3 => Ok(4),
                4 => Ok(16),
                5 => Ok(8),
                _ => Err(ParseCartridgeError::UnrecognizedRamSizeCode(code)),
            }
        }
/// Size of the ram in number of banks.
Size of the ram in number of banks.
Size of the ram in number of banks .
fn ram_size(header: &[u8; HEADER_LEN]) -> Result<usize, ParseCartridgeError> {
            let code = header[RAM_SIZE];
            match code {
                0 => Ok(0),
                1 => {
                    warn!("2 KiB ram size is unsupported, using 1 8 KiB ram bank instead.");
                    Ok(1)
                }
                2 => Ok(1),
                3 => Ok(4),
                4 => Ok(16),
                5 => Ok(8),
                _ => Err(ParseCartridgeError::UnrecognizedRamSizeCode(code)),
            }
        }
fn ram_size ( header : & [ u8 ; HEADER_LEN ] ) -> Result < usize , ParseCartridgeError > { let code = header [ RAM_SIZE ] ; match code { 0 => Ok ( 0 ) , 1 => { warn ! ( " " ) ; Ok ( 1 ) } 2 => Ok ( 1 ) , 3 => Ok ( 4 ) , 4 => Ok ( 16 ) , 5 => Ok ( 8 ) , _ => Err ( ParseCartridgeError :: UnrecognizedRamSizeCode ( code ) ) , } }
Size of the ram in number of banks.
Size of the ram in number of banks .
header
&[u8; HEADER_LEN]
header
&[u8; HEADER_LEN]