notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gpu_neon: revive the old tests
[pcsx_rearmed.git]
/
libpcsxcore
/
misc.c
diff --git
a/libpcsxcore/misc.c
b/libpcsxcore/misc.c
index
526ebd4
..
aafe522
100644
(file)
--- a/
libpcsxcore/misc.c
+++ b/
libpcsxcore/misc.c
@@
-163,12
+163,19
@@
static void SetBootRegs(u32 pc, u32 gp, u32 sp)
psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL);
}
psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL);
}
-void BiosBootBypass() {
+int BiosBootBypass() {
+ struct CdrStat stat = { 0, 0, };
assert(psxRegs.pc == 0x80030000);
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;
// 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)
}
static void getFromCnf(char *buf, const char *key, u32 *val)
@@
-294,7
+301,7
@@
int LoadCdrom() {
return 0;
}
return 0;
}
-int LoadCdromFile(const char *filename, EXE_HEADER *head) {
+int LoadCdromFile(const char *filename, EXE_HEADER *head
, u8 *time_bcd_out
) {
struct iso_directory_record *dir;
u8 time[4],*buf;
u8 mdir[4096];
struct iso_directory_record *dir;
u8 time[4],*buf;
u8 mdir[4096];
@@
-327,6
+334,7
@@
int LoadCdromFile(const char *filename, EXE_HEADER *head) {
if (GetCdromFile(mdir, time, exename) == -1) return -1;
READTRACK();
if (GetCdromFile(mdir, time, exename) == -1) return -1;
READTRACK();
+ incTime();
memcpy(head, buf + 12, sizeof(EXE_HEADER));
size = SWAP32(head->t_size);
memcpy(head, buf + 12, sizeof(EXE_HEADER));
size = SWAP32(head->t_size);
@@
-336,8
+344,8
@@
int LoadCdromFile(const char *filename, EXE_HEADER *head) {
//psxCpu->Reset();
while (size & ~2047) {
//psxCpu->Reset();
while (size & ~2047) {
- incTime();
READTRACK();
READTRACK();
+ incTime();
mem = PSXM(addr);
if (mem != INVALID_PTR)
mem = PSXM(addr);
if (mem != INVALID_PTR)
@@
-346,12
+354,15
@@
int LoadCdromFile(const char *filename, EXE_HEADER *head) {
size -= 2048;
addr += 2048;
}
size -= 2048;
addr += 2048;
}
+ if (time_bcd_out)
+ memcpy(time_bcd_out, time, 3);
return 0;
}
int CheckCdrom() {
struct iso_directory_record *dir;
return 0;
}
int CheckCdrom() {
struct iso_directory_record *dir;
+ struct CdrStat stat = { 0, 0, };
unsigned char time[4];
char *buf;
unsigned char mdir[4096];
unsigned char time[4];
char *buf;
unsigned char mdir[4096];
@@
-359,17
+370,22
@@
int CheckCdrom() {
int i, len, c;
FreePPFCache();
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);
time[0] = itob(0);
time[1] = itob(2);
time[2] = itob(0x10);
+ if (!Config.HLE && Config.SlowBoot) {
+ // boot to BIOS in case of CDDA or lid is open
+ CDR_getStatus(&stat);
+ if ((stat.Status & 0x10) || stat.Type == 2 || !CDR_readTrack(time))
+ return 0;
+ }
READTRACK();
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
strncpy(CdromLabel, buf + 52, 32);
// skip head and sub, and go to the root directory record
@@
-450,7
+466,7
@@
int CheckCdrom() {
Apply_Hacks_Cdrom();
Apply_Hacks_Cdrom();
- BuildPPFCache();
+ BuildPPFCache(
NULL
);
return 0;
}
return 0;
}
@@
-667,6
+683,10
@@
int SaveState(const char *file) {
assert(!psxRegs.branching);
assert(!psxRegs.cpuInRecursion);
assert(!misc->magic);
assert(!psxRegs.branching);
assert(!psxRegs.cpuInRecursion);
assert(!misc->magic);
+
+ f = SaveFuncs.open(file, "wb");
+ if (f == NULL) return -1;
+
misc->magic = MISC_MAGIC;
misc->gteBusyCycle = psxRegs.gteBusyCycle;
misc->muldivBusyCycle = psxRegs.muldivBusyCycle;
misc->magic = MISC_MAGIC;
misc->gteBusyCycle = psxRegs.gteBusyCycle;
misc->muldivBusyCycle = psxRegs.muldivBusyCycle;
@@
-677,9
+697,6
@@
int SaveState(const char *file) {
misc->frame_counter = frame_counter;
misc->CdromFrontendId = CdromFrontendId;
misc->frame_counter = frame_counter;
misc->CdromFrontendId = CdromFrontendId;
- f = SaveFuncs.open(file, "wb");
- if (f == NULL) return -1;
-
psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, NULL);
SaveFuncs.write(f, (void *)PcsxHeader, 32);
psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, NULL);
SaveFuncs.write(f, (void *)PcsxHeader, 32);