Merge pull request #444 from justinweiss/hires-downscale
[pcsx_rearmed.git] / libpcsxcore / new_dynarec / new_dynarec.c
index 059730a..bb6ff0b 100644 (file)
@@ -7085,6 +7085,10 @@ void new_dynarec_init(void)
 {
   SysPrintf("Init new dynarec\n");
 
+#ifdef _3DS
+  check_rosalina();
+#endif
+
   // allocate/prepare a buffer for translation cache
   // see assem_arm.h for some explanation
 #if   defined(BASE_ADDR_FIXED)
@@ -7105,6 +7109,8 @@ void new_dynarec_init(void)
   int ret = sceKernelGetMemBlockBase(sceBlock, (void **)&translation_cache);
   if (ret < 0)
     SysPrintf("sceKernelGetMemBlockBase failed\n");
+    
+  sceKernelOpenVMDomain();
   sceClibPrintf("translation_cache = 0x%08X \n ", translation_cache);
 #elif defined(_MSC_VER)
   base_addr = VirtualAlloc(NULL, 1<<TARGET_SIZE_2, MEM_COMMIT | MEM_RESERVE,
@@ -7121,7 +7127,7 @@ void new_dynarec_init(void)
 #else
 #ifndef NO_WRITE_EXEC
   // not all systems allow execute in data segment by default
-  if (mprotect(out, 1<<TARGET_SIZE_2, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
+  if (mprotect((void *)BASE_ADDR, 1<<TARGET_SIZE_2, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
     SysPrintf("mprotect() failed: %s\n", strerror(errno));
 #endif
 #endif