Skip to content

Commit

Permalink
Cartridge: added warning message for INES2.0 games
Browse files Browse the repository at this point in the history
  • Loading branch information
Amjad50 committed Jul 18, 2020
1 parent 28d3efe commit bd34dc2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cartridge/src/cartridge.rs
Expand Up @@ -51,7 +51,7 @@ impl Cartridge {
header[7] >>= 1;
let _playchoice_10_hint = header[7] & 1 != 0;
header[7] >>= 1;
let is_nes_2 = header[7] & 0b11 == 2;
let is_nes_2 = (header[7] & 0b11) == 2;
header[7] >>= 2;
let upper_mapper = header[7]; // the rest

Expand Down Expand Up @@ -84,6 +84,15 @@ impl Cartridge {
chr_data.resize(1 * 8 * 1024, 0);
}

if is_nes_2 {
// print a warning message just to know which games need INES2.
eprintln!(
"[WARN], the cartridge header is in INES2.0 format, but\
this emulator only supports INES1.0, the game might work\
but mostly it will be buggy"
);
}

// there are missing parts
if file.seek(SeekFrom::Current(0))? != file.seek(SeekFrom::End(0))? {
Err(CartridgeError::TooLargeFile)
Expand Down

0 comments on commit bd34dc2

Please sign in to comment.