From 6bfb7e1b479923c084fd9d8645fa00faac4b3d93 Mon Sep 17 00:00:00 2001 From: Francisco José García García Date: Mon, 3 Oct 2016 20:19:11 +0200 Subject: (VITA) Dynarec working --- libretro.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'libretro.c') diff --git a/libretro.c b/libretro.c index 00dfe55..d0081da 100644 --- a/libretro.c +++ b/libretro.c @@ -19,6 +19,12 @@ static inline int align(int x, int n) { #define FOUR_KB_ALIGN(x) align(x, 12) #define MB_ALIGN(x) align(x, 20) +int _newlib_vm_size_user = ROM_TRANSLATION_CACHE_SIZE + + RAM_TRANSLATION_CACHE_SIZE + + BIOS_TRANSLATION_CACHE_SIZE; + +int getVMBlock(); + #endif #if defined(_3DS) @@ -163,9 +169,8 @@ void retro_init(void) if(!translation_caches_inited){ void* currentHandle; - sceBlock = sceKernelAllocMemBlockForVM("code", MB_ALIGN(FOUR_KB_ALIGN(ROM_TRANSLATION_CACHE_SIZE + - RAM_TRANSLATION_CACHE_SIZE + - BIOS_TRANSLATION_CACHE_SIZE))); + sceBlock = getVMBlock(); + if (sceBlock < 0) { return; @@ -237,9 +242,7 @@ void retro_deinit(void) #if defined(VITA) && defined(HAVE_DYNAREC) if(translation_caches_inited){ - sceKernelFreeMemBlock(sceBlock); - - translation_caches_inited = 0; + translation_caches_inited = 0; } #endif @@ -438,6 +441,11 @@ bool retro_load_game(const struct retro_game_info* info) rom_translation_ptr = rom_translation_cache; ram_translation_ptr = ram_translation_cache; bios_translation_ptr = bios_translation_cache; +#elif defined(VITA) + dynarec_enable = 1; + rom_translation_ptr = rom_translation_cache; + ram_translation_ptr = ram_translation_cache; + bios_translation_ptr = bios_translation_cache; #endif } else -- cgit v1.2.3