From 6a5af218c728e07fbd4c6cbb21fe28e8b17fad86 Mon Sep 17 00:00:00 2001 From: Rinnegatamante Date: Fri, 4 Oct 2019 12:12:14 +0200 Subject: [PATCH] [VITA] Implement get_mem_total/free for the frontend. --- frontend/drivers/platform_psp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/drivers/platform_psp.c b/frontend/drivers/platform_psp.c index 64e182c6f2..9944b26fff 100644 --- a/frontend/drivers/platform_psp.c +++ b/frontend/drivers/platform_psp.c @@ -560,6 +560,16 @@ enum retro_language frontend_psp_get_user_language(void) sceAppUtilSystemParamGetInt(SCE_SYSTEM_PARAM_ID_LANG, &langid); return psp_get_retro_lang_from_langid(langid); } + +static uint64_t frontend_psp_get_mem_total(void) +{ + return _newlib_heap_end - _newlib_heap_base; +} + +static uint64_t frontend_psp_get_mem_used(void) +{ + return _newlib_heap_end - _newlib_heap_cur; +} #endif frontend_ctx_driver_t frontend_ctx_psp = { @@ -582,8 +592,13 @@ frontend_ctx_driver_t frontend_ctx_psp = { frontend_psp_get_architecture, frontend_psp_get_powerstate, frontend_psp_parse_drive_list, +#ifdef VITA + frontend_psp_get_mem_total, + frontend_psp_get_mem_used, +#else NULL, /* get_mem_total */ NULL, /* get_mem_free */ +#endif NULL, /* install_signal_handler */ NULL, /* get_sighandler_state */ NULL, /* set_sighandler_state */