MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / LoadLastDiskImage

Method LoadLastDiskImage

source/Disk.cpp:200–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198//===========================================================================
199
200void 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

Callers 1

LoadConfigurationFunction · 0.45

Calls 2

RegGetConfigSlotSectionFunction · 0.85
RegLoadStringFunction · 0.85

Tested by

no test coverage detected