add a thp-based huge page alloc fallback
[pcsx_rearmed.git] / libpcsxcore / misc.c
index da1dbea..8997c0b 100644 (file)
@@ -22,6 +22,7 @@
 */
 
 #include <stddef.h>
+#include <errno.h>
 #include <assert.h>
 #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;
 }
@@ -764,7 +770,7 @@ int LoadState(const char *file) {
        padFreeze(f, 0);
 
        if (Config.HLE)
-               psxBiosCheckExe(biosBranchCheckOld, 0x60);
+               psxBiosCheckExe(biosBranchCheckOld, 0x60, 1);
 
        result = 0;
 cleanup: