From c50a1845bb20259206f2fd26bc638b7d5be9f3ba Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 15 Dec 2024 23:28:39 +0200 Subject: [PATCH] vita: cleanup --- Makefile.libretro | 7 ++++--- frontend/libretro.c | 10 +--------- frontend/vita/sys/mman.h | 5 +++-- libpcsxcore/new_dynarec/new_dynarec.c | 3 +-- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Makefile.libretro b/Makefile.libretro index 7ea7addb..dc9aefa5 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -330,8 +330,9 @@ else ifeq ($(platform), vita) CFLAGS += -DVITA CFLAGS += -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -marm CFLAGS += -fsingle-precision-constant -mword-relocations -fno-unwind-tables - CFLAGS += -fno-asynchronous-unwind-tables -ftree-vectorize -funroll-loops - CFLAGS += -fno-optimize-sibling-calls + CFLAGS += -fno-asynchronous-unwind-tables -ftree-vectorize + #CFLAGS += -funroll-loops # ~280K bloat + #CFLAGS += -fno-optimize-sibling-calls # debug? CFLAGS += -I$(VITASDK)/include -Ifrontend/vita CFLAGS += -DNO_DYLIB CFLAGS_LAST += -O3 @@ -344,7 +345,7 @@ else ifeq ($(platform), vita) DYNAREC = ari64 ARCH = arm PARTIAL_LINKING = 1 - NO_PTHREAD=1 + NO_MMAP := 1 NO_POSIX_MEMALIGN := 1 HAVE_PHYSICAL_CDROM = 0 diff --git a/frontend/libretro.c b/frontend/libretro.c index e01c80ab..7f953a5f 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -573,7 +573,6 @@ static psx_map_t custom_psx_maps[] = { static int init_vita_mmap() { - int n; void *tmpaddr; addr = malloc(64 * 1024 * 1024); if (addr == NULL) @@ -587,6 +586,7 @@ static int init_vita_mmap() custom_psx_maps[5].buffer = tmpaddr + 0x2000000; memset(tmpaddr, 0, 0x2210000); #if 0 + int n; for(n = 0; n < 5; n++){ sceClibPrintf("addr reserved %x\n",custom_psx_maps[n].buffer); } @@ -3678,14 +3678,6 @@ void retro_deinit(void) update_audio_latency = false; } -#ifdef VITA -#include -int usleep(unsigned long us) -{ - sceKernelDelayThread(us); -} -#endif - void SysPrintf(const char *fmt, ...) { va_list list; diff --git a/frontend/vita/sys/mman.h b/frontend/vita/sys/mman.h index d2634836..e112bd03 100644 --- a/frontend/vita/sys/mman.h +++ b/frontend/vita/sys/mman.h @@ -2,8 +2,7 @@ #define MMAN_H #include -#include -#include +//#include #ifdef __cplusplus extern "C" { @@ -17,6 +16,7 @@ extern "C" { #define MAP_FAILED ((void *)-1) +#if 0 // not used static inline void* mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset) { (void)prot; @@ -62,6 +62,7 @@ static inline int munmap(void *addr, size_t len) return sceKernelFreeMemBlock(uid); } +#endif #ifdef __cplusplus }; diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index e247faf2..6f64e961 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -6322,12 +6322,11 @@ void new_dynarec_init(void) #ifdef VITA sceBlock = getVMBlock(); //sceKernelAllocMemBlockForVM("code", sizeof(*ndrc)); if (sceBlock <= 0) - SysPrintf("sceKernelAllocMemBlockForVM failed: %x\n", sceBlock); + SysPrintf("getVMBlock failed: %x\n", sceBlock); int ret = sceKernelGetMemBlockBase(sceBlock, (void **)&ndrc); if (ret < 0) SysPrintf("sceKernelGetMemBlockBase failed: %x\n", ret); sceKernelOpenVMDomain(); - sceClibPrintf("translation_cache = 0x%08lx\n ", (long)ndrc->translation_cache); #elif defined(_MSC_VER) ndrc = VirtualAlloc(NULL, sizeof(*ndrc), MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); -- 2.39.5