src/memory/header.cc
/*
 * Takes in a 16 byte header and calculates the size of the program 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 program 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 program rom . Assumes the header is non - null 16 bytes long and in the NES 2 . 0 format .
static size_t GetNes2PrgRomSize(char *file_header) {
  DataWord prg_lsb = static_cast<DataWord>(file_header[PRG_ROM_SIZE_LSB]);
  DataWord prg_msb = static_cast<DataWord>(file_header[9] & 0x0fU);
  return GetNes2RomSectionSize(prg_lsb, prg_msb, PRG_ROM_CHUNKSIZE);
}
static size_t GetNes2PrgRomSize ( char * file_header ) { DataWord prg_lsb = static_cast < DataWord > ( file_header [ PRG_ROM_SIZE_LSB ] ) ; DataWord prg_msb = static_cast < DataWord > ( file_header [ 9 ] & 0x0fU ) ; return GetNes2RomSectionSize ( prg_lsb , prg_msb , PRG_ROM_CHUNKSIZE ) ; }
Takes in a 16 byte header and calculates the size of the program rom.
Takes in a 16 byte header and calculates the size of the program rom .