From b5926d18036e9b3afd462a1222daa9f7bd64b742 Mon Sep 17 00:00:00 2001 From: negativeExponent Date: Sun, 15 Dec 2019 01:54:30 +0800 Subject: [PATCH] Access psx main memory using retro_memory_map --- frontend/libretro.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/frontend/libretro.c b/frontend/libretro.c index 987f90de..7d6d8d48 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1052,6 +1052,20 @@ strcasestr(const char *s, const char*find) } #endif +static void set_retro_memmap(void) +{ + struct retro_memory_map retromap = { 0 }; + struct retro_memory_descriptor mmap = + { + 0, psxM, 0, 0, 0, 0, 0x200000 + }; + + retromap.descriptors = &mmap; + retromap.num_descriptors = 1; + + environ_cb(RETRO_ENVIRONMENT_SET_MEMORY_MAPS, &retromap); +} + bool retro_load_game(const struct retro_game_info *info) { size_t i; @@ -1313,6 +1327,8 @@ bool retro_load_game(const struct retro_game_info *info) } } + set_retro_memmap(); + return true; } -- 2.39.5