private void txtEEPName_click(object sender, EventArgs e) { // Byte array to load the EEPROM data byte[] EEPROM = new byte[EEPROM_SIZE]; if (openEEPFileDialog.ShowDialog() == DialogResult.OK) { try { if (FileLoaded && EEPFile != null) { EEPFile.Close(); FileLoaded = false; } EEPFile = File.Open(openEEPFileDialog.FileName, FileMode.Open); EEPFile.Read(EEPROM, 0x00, EEPROM_SIZE); FileLoaded = true; } catch (Exception ex) { MessageBox.Show(ex.Message); } } if (FileLoaded) { Slots = new BKSaveSlot[3]; for (int i = 0; i < 4; i++) { byte magic1 = EEPROM[BKSaveSlot.SLOT_SIZE * i]; byte magic2 = EEPROM[BKSaveSlot.SLOT_SIZE * i + 1]; if (magic1 > 0x00 && magic2 > 0x00) { Slots[magic2 - 1] = new BKSaveSlot(EEPROM, i, magic2); } } refreshRadioButtons(); } }
public BKSaveSlot(BKSaveSlot other) { this.physicalIndex = other.physicalIndex; this.SlotData = other.SlotData; }