| 198 | //=========================================================================== |
| 199 | |
| 200 | void Disk2InterfaceCard::LoadLastDiskImage(const int drive) |
| 201 | { |
| 202 | _ASSERT(drive == DRIVE_1 || drive == DRIVE_2); |
| 203 | |
| 204 | const std::string regKey = (drive == DRIVE_1) |
| 205 | ? REGVALUE_LAST_DISK_1 |
| 206 | : REGVALUE_LAST_DISK_2; |
| 207 | |
| 208 | char pathname[MAX_PATH]; |
| 209 | |
| 210 | std::string regSection = RegGetConfigSlotSection(m_slot); |
| 211 | if (RegLoadString(regSection.c_str(), regKey.c_str(), TRUE, pathname, MAX_PATH, "") && (pathname[0] != 0)) |
| 212 | { |
| 213 | m_saveDiskImage = false; |
| 214 | ImageError_e error = InsertDisk(drive, pathname, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE); |
| 215 | m_saveDiskImage = true; |
| 216 | |
| 217 | if (error != eIMAGE_ERROR_NONE) |
| 218 | { |
| 219 | NotifyInvalidImage(drive, pathname, error); |
| 220 | EjectDisk(drive); |
| 221 | } |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | //=========================================================================== |
| 226 |
no test coverage detected