From c9854deeec0d4ca73133e9ce14bfa96ec60b5ea2 Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 7 Feb 2014 09:32:15 +0100 Subject: [PATCH] Update libretro.h docs. Fix conditional string check. --- dynamic.c | 4 ++-- libretro.h | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dynamic.c b/dynamic.c index e19a92bc59..0920549e95 100644 --- a/dynamic.c +++ b/dynamic.c @@ -612,12 +612,12 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; case RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY: - *(const char **)data = *g_settings.system_directory ? g_settings.system_directory : NULL; + *(const char**)data = *g_settings.system_directory ? g_settings.system_directory : NULL; RARCH_LOG("Environ SYSTEM_DIRECTORY: \"%s\".\n", g_settings.system_directory); break; case RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY: - *(const char **)data = g_extern.savefile_dir ? g_extern.savefile_dir : NULL; + *(const char**)data = *g_extern.savefile_dir ? g_extern.savefile_dir : NULL; RARCH_LOG("Environ SAVE_DIRECTORY: \"%s\".\n", g_extern.savefile_dir); break; diff --git a/libretro.h b/libretro.h index 1c4a3f3d4b..43464ec1d3 100755 --- a/libretro.h +++ b/libretro.h @@ -413,6 +413,9 @@ enum retro_mod // If so, no such directory is defined, // and it's up to the implementation to find a suitable directory. // + // NOTE: Some cores used this folder also for "save" data such as memory cards, etc, for lack of a better place to put it. + // This is now discouraged, and if possible, cores should try to use the new GET_SAVE_DIRECTORY. + // #define RETRO_ENVIRONMENT_SET_PIXEL_FORMAT 10 // const enum retro_pixel_format * -- // Sets the internal pixel format used by the implementation. @@ -578,7 +581,12 @@ enum retro_mod #define RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY 31 // const char ** -- // Returns the "save" directory of the frontend. - // This directory can be used to store SRAM, memory cards, high scores, etc + // This directory can be used to store SRAM, memory cards, high scores, etc, if the libretro core + // cannot use the regular memory interface (retro_get_memory_data()). + // + // NOTE: libretro cores used to check GET_SYSTEM_DIRECTORY for similar things before. + // They should still check GET_SYSTEM_DIRECTORY if they want to be backwards compatible. + // The path here can be NULL. It should only be non-NULL if the frontend user has set a specific save path. enum retro_log_level {