src/memory/mappers/std_banked.cc
/*
 * Uses the provided rom file and header to initialize the StdBanked class.
 *
 * Assumes the provided rom file is non-null and points to a valid NES rom.
 * Assumes the provided header was created from the rom and is valid.
 */
Uses the provided rom file and header to initialize the StdBanked class.
Assumes the provided rom file is non-null and points to a valid NES rom.
Assumes the provided header was created from the rom and is valid.
Uses the provided rom file and header to initialize the StdBanked class . Assumes the provided rom file is non - null and points to a valid NES rom . Assumes the provided header was created from the rom and is valid .
StdBanked::StdBanked(FILE *rom_file, RomHeader *header, Config *config)
         : Memory(header, config) {
  ram_ = RandNew(RAM_SIZE);
  bat_ = RandNew(BAT_SIZE);
  header_ = header;
  LoadPrg(rom_file);
  LoadChr(rom_file);
  nametable_[0] = RandNew(NAMETABLE_SIZE);
  nametable_[3] = RandNew(NAMETABLE_SIZE);
  if (header_->mirror) {
    nametable_[1] = nametable_[3];
    nametable_[2] = nametable_[0];
  } else {
    nametable_[1] = nametable_[0];
    nametable_[2] = nametable_[3];
  }
  return;
}
StdBanked :: StdBanked ( FILE * rom_file , RomHeader * header , Config * config ) : Memory ( header , config ) { ram_ = RandNew ( RAM_SIZE ) ; bat_ = RandNew ( BAT_SIZE ) ; header_ = header ; LoadPrg ( rom_file ) ; LoadChr ( rom_file ) ; nametable_ [ 0 ] = RandNew ( NAMETABLE_SIZE ) ; nametable_ [ 3 ] = RandNew ( NAMETABLE_SIZE ) ; if ( header_ -> mirror ) { nametable_ [ 1 ] = nametable_ [ 3 ] ; nametable_ [ 2 ] = nametable_ [ 0 ] ; } else { nametable_ [ 1 ] = nametable_ [ 0 ] ; nametable_ [ 2 ] = nametable_ [ 3 ] ; } return ; }
Uses the provided rom file and header to initialize the StdBanked class.
Uses the provided rom file and header to initialize the StdBanked class .
// Setup the ram space. // Load the rom data into memory. // Setup the nametable in vram. // Vertical (horizontal arrangement) mirroring. // Horizontal (vertical arrangement) mirroring.