core: cartridge: Don't error when the checksum is invalid.
A lot of test ROMs i'm using don't bother to calculate the checksum :\ Former-commit-id: da02a70271c34bc26e560ea18b3f5052ee171a65 Former-commit-id: 332d917e47b268ae649574844d14cab2da65197d
This commit is contained in:
parent
a3546cbe07
commit
e14c5996d4
|
@ -56,10 +56,12 @@ pub fn parse(bytes: &[u8]) -> GBAResult<CartridgeHeader> {
|
|||
}
|
||||
|
||||
let checksum = bytes[0xbd];
|
||||
if calculate_checksum(&bytes[0xa0..=0xbc]) != checksum {
|
||||
return Err(GBAError::CartridgeLoadError(
|
||||
"invalid header checksum".to_string(),
|
||||
));
|
||||
let calculated_checksum = calculate_checksum(&bytes[0xa0..=0xbc]);
|
||||
if calculated_checksum != checksum {
|
||||
warn!(
|
||||
"invalid header checksum, calculated {:02x} but expected {:02x}",
|
||||
calculated_checksum, checksum
|
||||
);
|
||||
}
|
||||
|
||||
let game_title = from_utf8(&bytes[0xa0..0xac])
|
||||
|
|
Reference in a new issue