void VC1541::ejectDisk() { if (!hasDisk()) return; // Open lid (write protection light barrier will be blocked) setWriteProtection(true); // Drive will notice the change in its interrupt routine... sleepMicrosec((uint64_t)200000); // Remove disk (write protection light barrier is no longer blocked) setWriteProtection(false); resetDisk(); c64->putMessage(MSG_VC1541_DISK, 0); if (sendSoundMessages) c64->putMessage(MSG_VC1541_DISK_SOUND, 0); }
void VC1541::ejectDisk() { if (!hasDisk()) return; // Open lid (this blocks the light barrier) setDiskPartiallyInserted(true); // Let the drive notice the blocked light barrier in its interrupt routine ... sleepMicrosec((uint64_t)200000); // Erase disk data and reset write protection flag resetDisk(); // Remove disk (this unblocks the light barrier) setDiskPartiallyInserted(false); // Notify listener c64->putMessage(MSG_VC1541_DISK, 0); if (sendSoundMessages) c64->putMessage(MSG_VC1541_DISK_SOUND, 0); }