src/memory/mappers/sxrom.cc
/*
 * Updates the nametable, program rom, and chr addressing mode using the given
 * 5-bit control register update value.
 */
Updates the nametable, program rom, and chr addressing mode using the given
5-bit control register update value.
Updates the nametable program rom and chr addressing mode using the given 5 - bit control register update value .
void Sxrom::UpdateControl(DataWord update) {
  control_reg_ = update;
  switch(update & NAMETABLE_CONTROL_MASK) {
    case NAMETABLE_MIRROR_LOW:
      for (int i = 0; i < 4; i++) { nametable_[i] = nametable_bank_a_; }
      break;
    case NAMETABLE_MIRROR_HIGH:
      for (int i = 0; i < 4; i++) { nametable_[i] = nametable_bank_b_; }
      break;
    case NAMETABLE_MIRROR_VERT:
      nametable_[0] = nametable_bank_a_;
      nametable_[1] = nametable_bank_b_;
      nametable_[2] = nametable_bank_a_;
      nametable_[3] = nametable_bank_b_;
      break;
    case NAMETABLE_MIRROR_HORI:
      nametable_[0] = nametable_bank_a_;
      nametable_[1] = nametable_bank_a_;
      nametable_[2] = nametable_bank_b_;
      nametable_[3] = nametable_bank_b_;
      break;
  }
  UpdateChrBanks();
  UpdatePrgRomBanks();
  return;
}
void Sxrom :: UpdateControl ( DataWord update ) { control_reg_ = update ; switch ( update & NAMETABLE_CONTROL_MASK ) { case NAMETABLE_MIRROR_LOW : for ( int i = 0 ; i < 4 ; i ++ ) { nametable_ [ i ] = nametable_bank_a_ ; } break ; case NAMETABLE_MIRROR_HIGH : for ( int i = 0 ; i < 4 ; i ++ ) { nametable_ [ i ] = nametable_bank_b_ ; } break ; case NAMETABLE_MIRROR_VERT : nametable_ [ 0 ] = nametable_bank_a_ ; nametable_ [ 1 ] = nametable_bank_b_ ; nametable_ [ 2 ] = nametable_bank_a_ ; nametable_ [ 3 ] = nametable_bank_b_ ; break ; case NAMETABLE_MIRROR_HORI : nametable_ [ 0 ] = nametable_bank_a_ ; nametable_ [ 1 ] = nametable_bank_a_ ; nametable_ [ 2 ] = nametable_bank_b_ ; nametable_ [ 3 ] = nametable_bank_b_ ; break ; } UpdateChrBanks ( ) ; UpdatePrgRomBanks ( ) ; return ; }
Updates the nametable, program rom, and chr addressing mode using the given
 5-bit control register update value.
Updates the nametable program rom and chr addressing mode using the given 5 - bit control register update value .
// Update the control register. // Update the nametable mirroring using the low two bits in the 5-bit update. // Update the CHR/PRG bank selections.