X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Flibretro.c;h=1e8650918cd06725e1a276b07444e8cdb62049d3;hb=9766e77ddec3157cbf8b7da407b99f47467a8f72;hp=75f9b98381bb50c65eeadb86a456fe1d52e3ec5a;hpb=1a5fd79401ac52789fad34c6b852b947200a6334;p=pcsx_rearmed.git diff --git a/frontend/libretro.c b/frontend/libretro.c index 75f9b983..1e865091 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -10,6 +10,10 @@ #include #include #include +#ifdef __MACH__ +#include +#include +#endif #include "../libpcsxcore/misc.h" #include "../libpcsxcore/psxcounters.h" @@ -290,7 +294,7 @@ void* pl_vita_mmap(unsigned long addr, size_t size, int is_fixed, char blockname[32]; sprintf(blockname, "CODE 0x%08X",tag); - block = sceKernelAllocMemBlockForVM(blockname, size); + block = sceKernelAllocMemBlock(blockname, size + 0x1000); if(block<=0){ sceClibPrintf("could not alloc mem block @0x%08X 0x%08X \n", block, tag); exit(1); @@ -303,7 +307,7 @@ void* pl_vita_mmap(unsigned long addr, size_t size, int is_fixed, sceClibPrintf("could get address @0x%08X 0x%08X 0x%08X \n", block, ret, tag); exit(1); } - + custom_map->buffer = (((u32)custom_map->buffer) + 0xFFF) & ~0xFFF; custom_map->target_map = block; return custom_map->buffer; @@ -1550,6 +1554,11 @@ void retro_init(void) int i, ret; bool found_bios = false; +#ifdef __MACH__ + // magic sauce to make the dynarec work on iOS + syscall(SYS_ptrace, 0 /*PTRACE_TRACEME*/, 0, 0, 0); +#endif + #ifdef _3DS psxMapHook = pl_3ds_mmap; psxUnmapHook = pl_3ds_munmap;