RIP-Comm / clementine

Gameboy Advance emulator.
MIT License
49 stars 13 forks source link

Check if cartridge checksum is correct #28

Closed FedericoBruzzone closed 2 years ago

FedericoBruzzone commented 2 years ago

It should be in cartridge_header.rs.

Specific in the function:

fn extract_complement_check(data: &[u8]) -> [u8; 1] {
        // TODO: this issue
        data[0x0BD..=0x0BD]
            .try_into()
            .expect("extracting complement check")
    }

Reference here at Complement check header

simo498 commented 2 years ago

It should be already veryfied in the verify_checksum function i think

FedericoBruzzone commented 2 years ago

It's true. I would call that function here to verify the checksum is correct. I don't like that the function returns 1 even if the checksum is wrong.