void BackupDevice::reset() { com = 0; addr = addr_counter = 0; flushPending = false; lazyFlushPending = false; data.resize(0); write_enable = FALSE; data_autodetect.resize(0); state = DETECTING; addr_size = 0; loadfile(); //if the user has requested a manual choice for backup type, and we havent imported a raw save file, then apply it now if(state == DETECTING && CommonSettings.manualBackupType != MC_TYPE_AUTODETECT) { state = RUNNING; int savetype = save_types[CommonSettings.manualBackupType][0]; int savesize = save_types[CommonSettings.manualBackupType][1]; ensure((u32)savesize); //expand properly if necessary data.resize(savesize); //truncate if necessary addr_size = addr_size_for_old_save_type(savetype); flush(); } }
void BackupDevice::raw_applyUserSettings(u32& size, bool manual) { //respect the user's choice of backup memory type if(CommonSettings.manualBackupType == MC_TYPE_AUTODETECT && !manual) { addr_size = addr_size_for_old_save_size(size); resize(size); } else { u32 type = CommonSettings.manualBackupType; if (manual) { u32 res = searchFileSaveType(size); if (res != 0xFF) type = (res + 1); // +1 - skip autodetect } int savetype = save_types[type][0]; int savesize = save_types[type][1]; addr_size = addr_size_for_old_save_type(savetype); if((u32)savesize<size) size = savesize; resize(savesize); } state = RUNNING; }
void BackupDevice::reset() { reset_hardware(); data_autodetect.resize(0); //if the user has requested a manual choice for backup type, and we havent imported a raw save file, then apply it now if(state == DETECTING && CommonSettings.manualBackupType != MC_TYPE_AUTODETECT) { state = RUNNING; int savetype = save_types[CommonSettings.manualBackupType].media_type; int savesize = save_types[CommonSettings.manualBackupType].size; ensure((u32)savesize); //expand properly if necessary addr_size = addr_size_for_old_save_type(savetype); } }
void BackupDevice::raw_applyUserSettings(u32& size) { //respect the user's choice of backup memory type if(CommonSettings.manualBackupType == MC_TYPE_AUTODETECT) addr_size = addr_size_for_old_save_size(size); else { int savetype = save_types[CommonSettings.manualBackupType][0]; int savesize = save_types[CommonSettings.manualBackupType][1]; addr_size = addr_size_for_old_save_type(savetype); if((u32)savesize<size) size = savesize; } state = RUNNING; }
void BackupDevice::reset() { memset(&info, 0, sizeof(info)); reset_hardware(); resize(0); data_autodetect.resize(0); addr_size = 0; loadfile(); //if the user has requested a manual choice for backup type, and we havent imported a raw save file, then apply it now if(state == DETECTING && CommonSettings.manualBackupType != MC_TYPE_AUTODETECT) { state = RUNNING; int savetype = save_types[CommonSettings.manualBackupType][0]; int savesize = save_types[CommonSettings.manualBackupType][1]; ensure((u32)savesize); //expand properly if necessary resize(savesize); //truncate if necessary addr_size = addr_size_for_old_save_type(savetype); flush(); } }