From 85e742149a92007da2b8fcf63a48c4d3c2e0ac63 Mon Sep 17 00:00:00 2001 From: Sven <40953353+RetroSven@users.noreply.github.com> Date: Tue, 31 Jul 2018 23:57:10 -0400 Subject: [PATCH] add libretro hooks for memory pointers to allow usage of new retroarch cheat code searching and rumble-on-memory change features --- libretro/libretro.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index e5cedb7298..cca5331e86 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -15,6 +15,7 @@ #include "Core/HLE/__sceAudio.h" #include "Core/HW/MemoryStick.h" #include "Core/Host.h" +#include "Core/MemMap.h" #include "Core/System.h" #include "Log.h" #include "LogManager.h" @@ -714,12 +715,16 @@ bool retro_unserialize(const void *data, size_t size) { } void *retro_get_memory_data(unsigned id) { - (void)id; + if ( id == RETRO_MEMORY_SYSTEM_RAM ) { + return Memory::GetPointerUnchecked(PSP_GetKernelMemoryBase()) ; + } return NULL; } size_t retro_get_memory_size(unsigned id) { - (void)id; + if ( id == RETRO_MEMORY_SYSTEM_RAM ) { + return Memory::g_MemorySize ; + } return 0; }