X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxmem.c;h=a85fb27d3773d3c6c96b6e08655c8dbdb028c5da;hb=ee8fd5674f74f307878f2dabef7641a837fb2a99;hp=1f7aa8cda92c56f8a988e3bab5972fea3f4ed6f3;hpb=aa314e8ebc2281c4b2d3db3378f143de5d68f335;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 1f7aa8cd..a85fb27d 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -42,7 +42,7 @@ boolean writeok = TRUE; -#ifndef NDEBUG +#if 0 //ndef NDEBUG #include "debug.h" #else void DebugCheckBP(u32 address, enum breakpoint_types type) {} @@ -71,13 +71,13 @@ retry: /* if (is_fixed) flags |= MAP_FIXED; */ - req = (void *)addr; + req = (void *)(uintptr_t)addr; ret = mmap(req, size, PROT_READ | PROT_WRITE, flags, -1, 0); if (ret == MAP_FAILED) return ret; } - if (addr != 0 && ret != (void *)addr) { + if (addr != 0 && ret != (void *)(uintptr_t)addr) { SysMessage("psxMap: warning: wanted to map @%08x, got %p\n", addr, ret); @@ -86,14 +86,14 @@ retry: return MAP_FAILED; } - if (((addr ^ (unsigned long)ret) & ~0xff000000l) && try_ < 2) + if (((addr ^ (unsigned long)(uintptr_t)ret) & ~0xff000000l) && try_ < 2) { psxUnmap(ret, size, tag); // try to use similarly aligned memory instead // (recompiler needs this) mask = try_ ? 0xffff : 0xffffff; - addr = ((unsigned long)ret + mask) & ~mask; + addr = ((uintptr_t)ret + mask) & ~mask; try_++; goto retry; } @@ -175,7 +175,7 @@ int psxMemInit(void) unsigned int i; int ret; - if (LIGHTREC_CUSTOM_MAP && Config.Cpu == CPU_DYNAREC) + if (LIGHTREC_CUSTOM_MAP) ret = lightrec_init_mmap(); else ret = psxMemInitMap(); @@ -255,7 +255,7 @@ void psxMemReset() { } void psxMemShutdown() { - if (LIGHTREC_CUSTOM_MAP && Config.Cpu == CPU_DYNAREC) + if (LIGHTREC_CUSTOM_MAP) lightrec_free_mmap(); else psxMemFreeMap();