src/memory/header.cc
/*
 * Decodes an archaic INES header into the header structure.
 *
 * Assumes that the file header is non-null, 16 bytes long, and in
 * the archaic INES format.
 * Assumes the header structure is non-null.
 */
Decodes an archaic INES header into the header structure.
Assumes that the file header is non-null, 16 bytes long, and in
the archaic INES format.
Assumes the header structure is non-null.
Decodes an archaic INES header into the header structure . Assumes that the file header is non - null 16 bytes long and in the archaic INES format . Assumes the header structure is non - null .
static void DecodeArchaicInes(RomHeader *header, char *file_header) {
  header->prg_rom_size = GetInesPrgRomSize(file_header);
  header->chr_rom_size = GetInesChrRomSize(file_header);
  if (header->chr_rom_size == 0) {
    header->chr_ram_size = INES_CHR_RAM_SIZE;
  }
  header->mapper = static_cast<NesMapperType>((file_header[FLAG_6] >> 4) & 0xF);
  DecodeFlag6(header, file_header);
  return;
}
static void DecodeArchaicInes ( RomHeader * header , char * file_header ) { header -> prg_rom_size = GetInesPrgRomSize ( file_header ) ; header -> chr_rom_size = GetInesChrRomSize ( file_header ) ; if ( header -> chr_rom_size == 0 ) { header -> chr_ram_size = INES_CHR_RAM_SIZE ; } header -> mapper = static_cast < NesMapperType > ( ( file_header [ FLAG_6 ] >> 4 ) & 0xF ) ; DecodeFlag6 ( header , file_header ) ; return ; }
Decodes an archaic INES header into the header structure.
Decodes an archaic INES header into the header structure .
// Gets the ram sizes using the INES standard. // When an INES header does not specify a size for CHR-ROM, 8K of CHR-RAM // is assumed to be present. // The archaic ines format supported only 16 mappers, which were // determined by the upper four bits of flag 6. // All three formats use the same flags in byte 6.