allow debug build (make DEBUG=1)
[pcsx_rearmed.git] / libpcsxcore / psxmem.c
index 1f7aa8c..a85fb27 100644 (file)
@@ -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();