| 225 | //=========================================================================== |
| 226 | |
| 227 | void Disk2InterfaceCard::SaveLastDiskImage(const int drive) |
| 228 | { |
| 229 | _ASSERT(drive == DRIVE_1 || drive == DRIVE_2); |
| 230 | |
| 231 | if (!m_saveDiskImage || !m_saveDiskImageToRegistry) |
| 232 | return; |
| 233 | |
| 234 | std::string regSection = RegGetConfigSlotSection(m_slot); |
| 235 | RegSaveValue(regSection.c_str(), REGVALUE_CARD_TYPE, TRUE, CT_Disk2); |
| 236 | |
| 237 | const std::string regKey = (drive == DRIVE_1) |
| 238 | ? REGVALUE_LAST_DISK_1 |
| 239 | : REGVALUE_LAST_DISK_2; |
| 240 | |
| 241 | const std::string& pathName = DiskGetFullPathName(drive); |
| 242 | |
| 243 | RegSaveString(regSection.c_str(), regKey.c_str(), TRUE, pathName); |
| 244 | |
| 245 | // |
| 246 | |
| 247 | // For now, only update 'Starting Directory' for slot6 & drive1 |
| 248 | // . otherwise you'll get inconsistent results if you set drive1, then drive2 (and the images were in different folders) |
| 249 | if (m_slot != SLOT6 || drive != DRIVE_1) |
| 250 | return; |
| 251 | |
| 252 | const size_t slash = pathName.find_last_of(PATH_SEPARATOR); |
| 253 | if (slash != std::string::npos) |
| 254 | { |
| 255 | const std::string dirName = pathName.substr(0, slash + 1); |
| 256 | RegSaveString(REG_PREFS, REGVALUE_PREF_START_DIR, 1, dirName); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | //=========================================================================== |
| 261 |
nothing calls this directly
no test coverage detected