From: notaz Date: Thu, 21 Mar 2024 22:52:37 +0000 (+0200) Subject: misc: allow slow-booting to cdda or whatever X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=commitdiff_plain;h=1f6c92b8e13a8cff95c45f56b885adeff9d32c30 misc: allow slow-booting to cdda or whatever notaz/pcsx_rearmed#335 --- 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