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

Function DoDiskInsert

source/Utilities.cpp:376–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374}
375
376static bool DoDiskInsert(const UINT slot, const int nDrive, LPCSTR szFileName)
377{
378 Disk2InterfaceCard& card = dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(slot));
379
380 if (szFileName[0] == '\0')
381 {
382 card.EjectDisk(nDrive);
383 return true;
384 }
385
386 std::string strPathName = GetFullPath(szFileName);
387 if (strPathName.empty()) return false;
388
389 ImageError_e Error = card.InsertDisk(nDrive, strPathName, IMAGE_USE_FILES_WRITE_PROTECT_STATUS, IMAGE_DONT_CREATE);
390 bool res = (Error == eIMAGE_ERROR_NONE);
391 if (res)
392 SetCurrentDir(strPathName);
393 return res;
394}
395
396static bool DoHardDiskInsert(const UINT slot, const int nDrive, LPCSTR szFileName)
397{

Callers 1

InsertFloppyDisksFunction · 0.85

Calls 4

GetFullPathFunction · 0.85
SetCurrentDirFunction · 0.85
EjectDiskMethod · 0.80
InsertDiskMethod · 0.80

Tested by

no test coverage detected