summaryrefslogtreecommitdiff
path: root/libretro.c
diff options
context:
space:
mode:
authorFrancisco José García García2016-10-03 20:19:11 +0200
committerFrancisco José García García2016-10-03 20:19:11 +0200
commit6bfb7e1b479923c084fd9d8645fa00faac4b3d93 (patch)
tree15fcf6e6c71d0177c463942244bdc662da14c79b /libretro.c
parent24cbebe2de483639f83c16452375831f7994fab8 (diff)
downloadpicogpsp-6bfb7e1b479923c084fd9d8645fa00faac4b3d93.tar.gz
picogpsp-6bfb7e1b479923c084fd9d8645fa00faac4b3d93.tar.bz2
picogpsp-6bfb7e1b479923c084fd9d8645fa00faac4b3d93.zip
(VITA) Dynarec working
Diffstat (limited to 'libretro.c')
-rw-r--r--libretro.c20
1 files changed, 14 insertions, 6 deletions
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