long CALLBACK CDR__test(void);
void CALLBACK CDR__about(void);
long CALLBACK CDR__setfilename(char *filename);
-long CALLBACK CDR__getStatus(struct CdrStat *stat);
static void DecodeRawSubData(void);
cdr.Reg2 = 0x1f;
cdr.Stat = NoIntr;
cdr.FifoOffset = DATA_SIZE; // fifo empty
- if (CdromId[0] == '\0') {
+
+ CDR_getStatus(&stat);
+ if (stat.Status & STATUS_SHELLOPEN) {
+ cdr.DriveState = DRIVESTATE_LID_OPEN;
+ cdr.StatP = STATUS_SHELLOPEN;
+ }
+ else if (CdromId[0] == '\0') {
cdr.DriveState = DRIVESTATE_STOPPED;
cdr.StatP = 0;
}
psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL);
}
-void BiosBootBypass() {
+int BiosBootBypass() {
+ struct CdrStat stat = { 0, 0, };
assert(psxRegs.pc == 0x80030000);
+ // no bypass if the lid is open
+ CDR__getStatus(&stat);
+ if (stat.Status & 0x10)
+ return 0;
+
// skip BIOS logos and region check
psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, NULL);
psxRegs.pc = psxRegs.GPR.n.ra;
+ return 1;
}
static void getFromCnf(char *buf, const char *key, u32 *val)
extern char CdromLabel[33];
extern int CdromFrontendId; // for frontend use
-void BiosBootBypass();
+int BiosBootBypass();
int LoadCdrom();
int LoadCdromFile(const char *filename, EXE_HEADER *head);
extern CDRreadCDDA CDR_readCDDA;\r
extern CDRgetTE CDR_getTE;\r
\r
+long CALLBACK CDR__getStatus(struct CdrStat *stat);\r
+\r
// SPU Functions\r
typedef long (CALLBACK* SPUinit)(void); \r
typedef long (CALLBACK* SPUshutdown)(void); \r
if (!Config.HLE) {
psxExecuteBios();
if (psxRegs.pc == 0x80030000 && !Config.SlowBoot) {
- BiosBootBypass();
- introBypassed = TRUE;
+ introBypassed = BiosBootBypass();
}
}
if (Config.HLE || introBypassed)