X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=022ad6d9afec738dae00e27cc19a03583290965a;hb=b0d96051c9f087c22922966c651384c3ee84eee0;hp=57d3959f61aca90dc0886a119489667d8c98574e;hpb=6d75addfea5544b926d3924b1bd1e1d8ce9ffdb4;p=pcsx_rearmed.git diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 57d3959f..022ad6d9 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -22,6 +22,7 @@ */ #include +#include #include "misc.h" #include "cdrom.h" #include "mdec.h" @@ -154,7 +155,7 @@ static const unsigned int gpu_data_def[] = { 0x02000000, 0x00000000, 0x01ff03ff, }; -static void fake_bios_gpu_setup(void) +void BiosLikeGPUSetup() { int i; @@ -177,6 +178,14 @@ static void SetBootRegs(u32 pc, u32 gp, u32 sp) psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL); } +void BiosBootBypass() { + assert(psxRegs.pc == 0x80030000); + + // skip BIOS logos and region check + psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, NULL); + psxRegs.pc = psxRegs.GPR.n.ra; +} + int LoadCdrom() { EXE_HEADER tmpHead; struct iso_directory_record *dir; @@ -184,15 +193,10 @@ int LoadCdrom() { u8 mdir[4096]; char exename[256]; - // not the best place to do it, but since BIOS boot logo killer - // is just below, do it here - fake_bios_gpu_setup(); - - if (!Config.HLE && !Config.SlowBoot) { - // skip BIOS logos - psxCpu->Notify(R3000ACPU_NOTIFY_BEFORE_SAVE, NULL); - psxRegs.pc = psxRegs.GPR.n.ra; - return 0; + if (!Config.HLE) { + if (!BiosBooted) return 0; // custom BIOS + if (psxRegs.pc != 0x80030000) return 0; // BiosBootBypass'ed + if (Config.SlowBoot) return 0; } time[0] = itob(0); time[1] = itob(2); time[2] = itob(0x10); @@ -210,6 +214,7 @@ int LoadCdrom() { if (GetCdromFile(mdir, time, "SYSTEM.CNF;1") == -1) { // if SYSTEM.CNF is missing, start an existing PSX.EXE if (GetCdromFile(mdir, time, "PSX.EXE;1") == -1) return -1; + strcpy(exename, "PSX.EXE;1"); READTRACK(); } @@ -243,6 +248,7 @@ int LoadCdrom() { memcpy(&tmpHead, buf + 12, sizeof(EXE_HEADER)); + SysPrintf("manual booting '%s'\n", exename); SetBootRegs(SWAP32(tmpHead.pc0), SWAP32(tmpHead.gp0), SWAP32(tmpHead.s_addr)); tmpHead.t_size = SWAP32(tmpHead.t_size);