src/memory/mappers/sxrom.cc
/*
 * Updates the current bank selections using the regsiters in the
 * calling object.
 */
Updates the current bank selections using the regsiters in the
calling object.
Updates the current bank selections using the regsiters in the calling object .
void Sxrom::UpdatePrgRomBanks(void) {
  DataWord prg_bank = (chr_a_reg_ & prg_rom_high_mask_)
                    | (prg_reg_ & PRG_ROM_BANK_LOW_MASK);
  switch(control_reg_ & PRG_ROM_CONTROL_MASK) {
    case PRG_ROM_MODE_32K:
    case PRG_ROM_MODE_32K_ALT:
      prg_rom_bank_a_ = prg_bank & (~1U);
      prg_rom_bank_b_ = prg_bank | 1U;
      break;
    case PRG_ROM_MODE_FIX_LOW:
      prg_rom_bank_a_ = 0;
      prg_rom_bank_b_ = prg_bank;
      break;
    case PRG_ROM_MODE_FIX_HIGH:
      prg_rom_bank_a_ = prg_bank;
      prg_rom_bank_b_ = num_prg_rom_banks_ - 1U;
      break;
  }
  return;
}
void Sxrom :: UpdatePrgRomBanks ( void ) { DataWord prg_bank = ( chr_a_reg_ & prg_rom_high_mask_ ) | ( prg_reg_ & PRG_ROM_BANK_LOW_MASK ) ; switch ( control_reg_ & PRG_ROM_CONTROL_MASK ) { case PRG_ROM_MODE_32K : case PRG_ROM_MODE_32K_ALT : prg_rom_bank_a_ = prg_bank & ( ~ 1U ) ; prg_rom_bank_b_ = prg_bank | 1U ; break ; case PRG_ROM_MODE_FIX_LOW : prg_rom_bank_a_ = 0 ; prg_rom_bank_b_ = prg_bank ; break ; case PRG_ROM_MODE_FIX_HIGH : prg_rom_bank_a_ = prg_bank ; prg_rom_bank_b_ = num_prg_rom_banks_ - 1U ; break ; } return ; }
Updates the current bank selections using the regsiters in the
 calling object.
Updates the current bank selections using the regsiters in the calling object .
// Caculate the current PRG-ROM bank selection. // Update the PRG-ROM bank selection using the method specified in the control // register and the current value of the PRG-ROM bank selection registers.