From 1f6c92b8e13a8cff95c45f56b885adeff9d32c30 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 22 Mar 2024 00:52:37 +0200 Subject: [PATCH] misc: allow slow-booting to cdda or whatever notaz/pcsx_rearmed#335 --- libpcsxcore/misc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 -- 2.39.5