X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fmisc.c;h=f332f4377aa33f8c197066bf8f5d5468bac74dea;hb=7da5c7ad699ce52d0ef8361709b420751f4e42e0;hp=50caad42233d1751958fa22935851a9db2e4b624;hpb=de74f59932e94887debf30e5ec437d7f63591f74;p=pcsx_rearmed.git diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 50caad42..f332f437 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; } @@ -690,6 +696,7 @@ int SaveState(const char *file) { psxRcntFreeze(f, 1); mdecFreeze(f, 1); new_dyna_freeze(f, 1); + padFreeze(f, 1); result = 0; cleanup: @@ -760,9 +767,11 @@ int LoadState(const char *file) { psxRcntFreeze(f, 0); mdecFreeze(f, 0); new_dyna_freeze(f, 0); + padFreeze(f, 0); + events_restore(); if (Config.HLE) - psxBiosCheckExe(biosBranchCheckOld, 0x60); + psxBiosCheckExe(biosBranchCheckOld, 0x60, 1); result = 0; cleanup: