src/memory/header.cc
/*
 * Decodes an INES header into the header structure.
 *
 * Assumes the file header is non-null, 16 bytes long, and in the INES format.
 * Assumes the header structure is non-null.
 */
Decodes an INES header into the header structure.
Assumes the file header is non-null, 16 bytes long, and in the INES format.
Assumes the header structure is non-null.
Decodes an INES header into the header structure . Assumes the file header is non - null 16 bytes long and in the INES format . Assumes the header structure is non - null .
static void DecodeInes(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 = GetInesMapper(file_header);
  DecodeFlag6(header, file_header);
  header->prg_ram_size = GetInesPrgRamSize(file_header);
  DecodeInesBools(header, file_header);
  return;
}
static void DecodeInes ( 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 = GetInesMapper ( file_header ) ; DecodeFlag6 ( header , file_header ) ; header -> prg_ram_size = GetInesPrgRamSize ( file_header ) ; DecodeInesBools ( header , file_header ) ; return ; }
Decodes an INES header into the header structure.
Decodes an INES header into the header structure .
// Get the ram sizes using the INES standard. // When an INES header does not specify a size for CHR-ROM, CHR-RAM // is assumed to be present. This ram size is not specified, but here we // assume it to be 8KB. // Get the header using the INES standard. // Decode the universal flag byte. // Get the ram size. // Decode the remaining flags and exit.