X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=889639d668b79c3f2576cb36ae41fd09210ec46b;hp=0848c267bccd579d6dc08fa156f78a327e5ae86b;hb=HEAD;hpb=8338889c466f3dc392a7a83598a65dcac8cbcc38 diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 0848c267..889639d6 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -362,6 +362,7 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head, u8 *time_bcd_out) { int CheckCdrom() { struct iso_directory_record *dir; + struct CdrStat stat = { 0, 0, }; unsigned char time[4]; char *buf; unsigned char mdir[4096]; @@ -369,17 +370,22 @@ int CheckCdrom() { int i, len, c; FreePPFCache(); + memset(CdromLabel, 0, sizeof(CdromLabel)); + memset(CdromId, 0, sizeof(CdromId)); + memset(exename, 0, sizeof(exename)); time[0] = itob(0); time[1] = itob(2); time[2] = itob(0x10); + if (!Config.HLE && Config.SlowBoot) { + // boot to BIOS in case of CDDA ir lid open + CDR_getStatus(&stat); + if ((stat.Status & 0x10) || stat.Type == 2 || !CDR_readTrack(time)) + return 0; + } READTRACK(); - memset(CdromLabel, 0, sizeof(CdromLabel)); - memset(CdromId, 0, sizeof(CdromId)); - memset(exename, 0, sizeof(exename)); - strncpy(CdromLabel, buf + 52, 32); // skip head and sub, and go to the root directory record