MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / cdvdCtrlTrayClose

Function cdvdCtrlTrayClose

pcsx2/CDVD/CDVD.cpp:750–778  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

748}
749
750s32 cdvdCtrlTrayClose()
751{
752 if (!(cdvd.Status & CDVD_STATUS_TRAY_OPEN))
753 return 0x80;
754
755 DevCon.WriteLn(Color_Green, "Close virtual disk tray");
756
757 if (VMManager::Internal::IsFastBootInProgress())
758 {
759 DevCon.WriteLn(Color_Green, "Media already loaded (fast boot)");
760 cdvdUpdateReady(CDVD_DRIVE_READY);
761 cdvdUpdateStatus(CDVD_STATUS_PAUSE);
762 cdvd.Spinning = true;
763 cdvd.Tray.trayState = CDVD_DISC_ENGAGED;
764 cdvd.Tray.cdvdActionSeconds = 0;
765 }
766 else
767 {
768 DevCon.WriteLn(Color_Green, "Detecting media");
769 cdvdUpdateReady(CDVD_DRIVE_BUSY);
770 cdvdUpdateStatus(CDVD_STATUS_STOP);
771 cdvd.Spinning = false;
772 cdvd.Tray.trayState = CDVD_DISC_DETECTING;
773 cdvd.Tray.cdvdActionSeconds = 3;
774 }
775 cdvdDetectDisk();
776
777 return 0; // needs to be 0 for success according to homebrew test "CDVD"
778}
779
780// check whether disc is single or dual layer
781// if its dual layer, check what the disctype is and what sector number

Callers 3

cdvdResetFunction · 0.85
cdvdUpdateTrayStateFunction · 0.85
cdvdWrite16Function · 0.85

Calls 4

cdvdUpdateReadyFunction · 0.85
cdvdUpdateStatusFunction · 0.85
cdvdDetectDiskFunction · 0.85
WriteLnMethod · 0.45

Tested by

no test coverage detected