X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=9486d23bbf546367c1232812c1ad21e08508d928;hb=9454d33991e921f526c0c6fddb6c1be057ba8ab3;hp=da1dbea83241c7bec3089ae7f19945e229a9a3d4;hpb=3faf5c235830d46b111bfc6459f50071b43f6a0d;p=pcsx_rearmed.git diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index da1dbea8..9486d23b 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -22,6 +22,7 @@ */ #include +#include #include #include "misc.h" #include "cdrom.h" @@ -174,8 +175,13 @@ static void getFromCnf(char *buf, const char *key, u32 *val) buf = strstr(buf, key); if (buf) buf = strchr(buf, '='); - if (buf) - *val = strtol(buf + 1, NULL, 16); + if (buf) { + unsigned long v; + errno = 0; + v = strtoul(buf + 1, NULL, 16); + if (errno == 0) + *val = v; + } } int LoadCdrom() { @@ -282,7 +288,7 @@ int LoadCdrom() { //psxCpu->Reset(); if (Config.HLE) - psxBiosCheckExe(tmpHead.h.t_addr, tmpHead.h.t_size); + psxBiosCheckExe(tmpHead.h.t_addr, tmpHead.h.t_size, 0); return 0; } @@ -732,6 +738,8 @@ int LoadState(const char *file) { SaveFuncs.read(f, &psxRegs, offsetof(psxRegisters, gteBusyCycle)); psxRegs.gteBusyCycle = psxRegs.cycle; psxRegs.biosBranchCheck = ~0; + psxRegs.gpuIdleAfter = psxRegs.cycle - 1; + HW_GPU_STATUS &= SWAP32(~PSXGPU_nBUSY); psxCpu->Notify(R3000ACPU_NOTIFY_AFTER_LOAD, NULL); @@ -744,8 +752,7 @@ int LoadState(const char *file) { SaveFuncs.read(f, gpufP, sizeof(GPUFreeze_t)); GPU_freeze(0, gpufP); free(gpufP); - if (HW_GPU_STATUS == 0) - HW_GPU_STATUS = SWAP32(GPU_readStatus()); + gpuSyncPluginSR(); // spu SaveFuncs.read(f, &Size, 4); @@ -763,8 +770,9 @@ int LoadState(const char *file) { new_dyna_freeze(f, 0); padFreeze(f, 0); + events_restore(); if (Config.HLE) - psxBiosCheckExe(biosBranchCheckOld, 0x60); + psxBiosCheckExe(biosBranchCheckOld, 0x60, 1); result = 0; cleanup: