MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / disk_insert_2

Function disk_insert_2

src/disk.cpp:3341–3369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3339}
3340
3341static void disk_insert_2 (int num, const TCHAR *name, bool forced, bool forcedwriteprotect)
3342{
3343 drive *drv = floppy + num;
3344
3345 if (forced) {
3346 drive_insert (drv, &currprefs, num, name, false, forcedwriteprotect);
3347 return;
3348 }
3349 if (!_tcscmp (currprefs.floppyslots[num].df, name))
3350 return;
3351 drv->dskeject = false;
3352 _tcsncpy(drv->newname, name, MAX_DPATH - 1);
3353 drv->newname[MAX_DPATH - 1] = 0;
3354 drv->newnamewriteprotected = forcedwriteprotect;
3355 _tcscpy (currprefs.floppyslots[num].df, name);
3356 currprefs.floppyslots[num].forcedwriteprotect = forcedwriteprotect;
3357 DISK_history_add (name, -1, HISTORY_FLOPPY, 0);
3358 if (name[0] == 0) {
3359 disk_eject (num);
3360 } else if (!drive_empty(drv) || drv->dskchange_time > 0) {
3361 // delay eject so that it is always called when emulation is active
3362 drv->dskeject = true;
3363 } else if (drv->dskchange) {
3364 // eject + insert without exiting GUI
3365 drv->dskeject = true;
3366 } else {
3367 setdskchangetime (drv, 1 * 312);
3368 }
3369}
3370
3371void disk_insert (int num, const TCHAR *name, bool forcedwriteprotect)
3372{

Callers 2

disk_insertFunction · 0.85
disk_insert_forceFunction · 0.85

Calls 4

DISK_history_addFunction · 0.85
disk_ejectFunction · 0.85
drive_emptyFunction · 0.85
setdskchangetimeFunction · 0.85

Tested by

no test coverage detected