src/memory/header.cc
/*
 * Takes in a 16 byte header and calculates the size of the chr rom.
 *
 * Assumes the header is non-null, 16 bytes long, and in the NES 2.0 format.
 */
Takes in a 16 byte header and calculates the size of the chr rom.
Assumes the header is non-null, 16 bytes long, and in the NES 2.0 format.
Takes in a 16 byte header and calculates the size of the chr rom . Assumes the header is non - null 16 bytes long and in the NES 2 . 0 format .
static size_t GetNes2ChrRomSize(char *file_header) {
  DataWord chr_lsb = static_cast<DataWord>(file_header[CHR_ROM_SIZE_LSB]);
  DataWord chr_msb = (static_cast<DataWord>(file_header[9])) >> 4;
  return GetNes2RomSectionSize(chr_lsb, chr_msb, CHR_ROM_CHUNKSIZE);
}
static size_t GetNes2ChrRomSize ( char * file_header ) { DataWord chr_lsb = static_cast < DataWord > ( file_header [ CHR_ROM_SIZE_LSB ] ) ; DataWord chr_msb = ( static_cast < DataWord > ( file_header [ 9 ] ) ) >> 4 ; return GetNes2RomSectionSize ( chr_lsb , chr_msb , CHR_ROM_CHUNKSIZE ) ; }
Takes in a 16 byte header and calculates the size of the chr rom.
Takes in a 16 byte header and calculates the size of the chr rom .