Skip to content

Commit

Permalink
CDVD: Fix tray closure on No Disc
Browse files Browse the repository at this point in the history
  • Loading branch information
refractionpcsx2 committed Oct 14, 2021
1 parent d736c8b commit f14c9e7
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions pcsx2/CDVD/CDVD.cpp
Expand Up @@ -602,7 +602,7 @@ s32 cdvdCtrlTrayOpen()

cdvd.mediaChanged = true;

if (cdvd.Type > 0)
if (cdvd.Type > 0 || CDVDsys_GetSourceType() == CDVD_SourceType::NoDisc)
{
cdvd.Tray.cdvdActionSeconds = 3;
cdvd.Tray.trayState = CDVD_DISC_EJECT;
Expand Down Expand Up @@ -678,7 +678,10 @@ static int cdvdTrayStateDetecting()
return CDVD_TYPE_DETCTDVDS;
}

return CDVD_TYPE_DETCTCD;
if(cdvd.Type != CDVD_TYPE_NODISC)
return CDVD_TYPE_DETCTCD;
else
return CDVD_TYPE_DETCT; //Detecting any kind of disc existing
}
static uint cdvdRotationalLatency(CDVD_MODE_TYPE mode)
{
Expand Down Expand Up @@ -1273,11 +1276,16 @@ void cdvdUpdateTrayState()
break;
case CDVD_DISC_SEEKING:
case CDVD_DISC_ENGAGED:
cdvd.mediaChanged = true;
DevCon.WriteLn(Color_Green, L"Media ready to read");
cdvd.Tray.trayState = CDVD_DISC_ENGAGED;
cdvd.Status = CDVD_STATUS_PAUSE;
cdvd.Ready |= CDVD_DRIVE_READY;
if (CDVDsys_GetSourceType() != CDVD_SourceType::NoDisc)
{
DevCon.WriteLn(Color_Green, L"Media ready to read");
cdvd.mediaChanged = true;
cdvd.Status = CDVD_STATUS_PAUSE;
}
else
cdvd.Status = CDVD_STATUS_STOP;
break;
}
}
Expand Down

0 comments on commit f14c9e7

Please sign in to comment.